Class WeightedMeasurement
- java.lang.Object
-
- org.apache.commons.math.estimation.WeightedMeasurement
-
- All Implemented Interfaces:
java.io.Serializable
@Deprecated public abstract class WeightedMeasurement extends java.lang.Object implements java.io.Serializable
Deprecated.as of 2.0, everything in package org.apache.commons.math.estimation has been deprecated and replaced by package org.apache.commons.math.optimization.generalThis class represents measurements in estimation problems.This abstract class implements all the methods needed to handle measurements in a general way. It defines neither the
getTheoreticalValue
nor thegetPartial
methods, which should be defined by sub-classes according to the specific problem.The
getTheoreticalValue
andgetPartial
methods must always use the current estimate of the parameters set by the solver in the problem. These parameters can be retrieved through theEstimationProblem.getAllParameters
method if the measurements are independent of the problem, or directly if they are implemented as inner classes of the problem.The instances for which the
ignored
flag is set through thesetIgnored
method are ignored by the solvers. This can be used to reject wrong measurements at some steps of the estimation.- Since:
- 1.2
- See Also:
EstimationProblem
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WeightedMeasurement(double weight, double measuredValue)
Deprecated.Simple constructor.WeightedMeasurement(double weight, double measuredValue, boolean ignored)
Deprecated.Simple constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description double
getMeasuredValue()
Deprecated.Get the measured valueabstract double
getPartial(EstimatedParameter parameter)
Deprecated.Get the partial derivative of thetheoretical value
according to the parameter.double
getResidual()
Deprecated.Get the residual for this measurement The residual is the measured value minus the theoretical value.abstract double
getTheoreticalValue()
Deprecated.Get the theoretical value expected for this measurementdouble
getWeight()
Deprecated.Get the weight of the measurement in the least squares problemboolean
isIgnored()
Deprecated.Check if this measurement should be ignoredvoid
setIgnored(boolean ignored)
Deprecated.Set the ignore flag to the specified value Setting the ignore flag to true allow to reject wrong measurements, which sometimes can be detected only rather late.
-
-
-
Constructor Detail
-
WeightedMeasurement
public WeightedMeasurement(double weight, double measuredValue)
Deprecated.Simple constructor. Build a measurement with the given parameters, and set its ignore flag to false.- Parameters:
weight
- weight of the measurement in the least squares problem (two common choices are either to use 1.0 for all measurements, or to use a value proportional to the inverse of the variance of the measurement type)measuredValue
- measured value
-
WeightedMeasurement
public WeightedMeasurement(double weight, double measuredValue, boolean ignored)
Deprecated.Simple constructor. Build a measurement with the given parameters- Parameters:
weight
- weight of the measurement in the least squares problemmeasuredValue
- measured valueignored
- true if the measurement should be ignored
-
-
Method Detail
-
getWeight
public double getWeight()
Deprecated.Get the weight of the measurement in the least squares problem- Returns:
- weight
-
getMeasuredValue
public double getMeasuredValue()
Deprecated.Get the measured value- Returns:
- measured value
-
getResidual
public double getResidual()
Deprecated.Get the residual for this measurement The residual is the measured value minus the theoretical value.- Returns:
- residual
-
getTheoreticalValue
public abstract double getTheoreticalValue()
Deprecated.Get the theoretical value expected for this measurementThe theoretical value is the value expected for this measurement if the model and its parameter were all perfectly known.
The value must be computed using the current estimate of the parameters set by the solver in the problem.
- Returns:
- theoretical value
-
getPartial
public abstract double getPartial(EstimatedParameter parameter)
Deprecated.Get the partial derivative of thetheoretical value
according to the parameter.The value must be computed using the current estimate of the parameters set by the solver in the problem.
- Parameters:
parameter
- parameter against which the partial derivative should be computed- Returns:
- partial derivative of the
theoretical value
-
setIgnored
public void setIgnored(boolean ignored)
Deprecated.Set the ignore flag to the specified value Setting the ignore flag to true allow to reject wrong measurements, which sometimes can be detected only rather late.- Parameters:
ignored
- value for the ignore flag
-
isIgnored
public boolean isIgnored()
Deprecated.Check if this measurement should be ignored- Returns:
- true if the measurement should be ignored
-
-