Added since tag for filter package, minor javadoc fixes.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1242174 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2012-02-08 23:31:10 +00:00
parent ddc27b4a15
commit 6a63df5151
5 changed files with 52 additions and 84 deletions

View File

@ -23,6 +23,7 @@ import org.apache.commons.math.linear.RealMatrix;
* Default implementation of a {@link MeasurementModel} for the use with a
* {@link KalmanFilter}.
*
* @since 3.0
* @version $Id$
*/
public class DefaultMeasurementModel implements MeasurementModel {
@ -42,10 +43,8 @@ public class DefaultMeasurementModel implements MeasurementModel {
* Create a new {@link MeasurementModel}, taking double arrays as input
* parameters for the respective measurement matrix and noise.
*
* @param measMatrix
* the measurement matrix
* @param measNoise
* the measurement noise matrix
* @param measMatrix the measurement matrix
* @param measNoise the measurement noise matrix
*/
public DefaultMeasurementModel(final double[][] measMatrix,
final double[][] measNoise) {
@ -57,10 +56,8 @@ public class DefaultMeasurementModel implements MeasurementModel {
* Create a new {@link MeasurementModel}, taking {@link RealMatrix} objects
* as input parameters for the respective measurement matrix and noise.
*
* @param measMatrix
* the measurement matrix
* @param measNoise
* the measurement noise matrix
* @param measMatrix the measurement matrix
* @param measNoise the measurement noise matrix
*/
public DefaultMeasurementModel(final RealMatrix measMatrix,
final RealMatrix measNoise) {
@ -68,16 +65,12 @@ public class DefaultMeasurementModel implements MeasurementModel {
this.measurementNoise = measNoise;
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public RealMatrix getMeasurementMatrix() {
return measurementMatrix;
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public RealMatrix getMeasurementNoise() {
return measurementNoise;
}

View File

@ -25,6 +25,7 @@ import org.apache.commons.math.linear.RealVector;
* Default implementation of a {@link ProcessModel} for the use with a
* {@link KalmanFilter}.
*
* @since 3.0
* @version $Id$
*/
public class DefaultProcessModel implements ProcessModel {
@ -40,40 +41,30 @@ public class DefaultProcessModel implements ProcessModel {
*/
private RealMatrix controlMatrix;
/**
* The process noise covariance matrix.
*/
/** The process noise covariance matrix. */
private RealMatrix processNoiseCovMatrix;
/**
* The initial state estimation of the observed process.
*/
/** The initial state estimation of the observed process. */
private RealVector initialStateEstimateVector;
/**
* The initial error covariance matrix of the observed process.
*/
/** The initial error covariance matrix of the observed process. */
private RealMatrix initialErrorCovMatrix;
/**
* Create a new {@link ProcessModel}, taking double arrays as input
* parameters.
*
* @param stateTransition
* the state transition matrix
* @param control
* the control matrix
* @param processNoise
* the process noise matrix
* @param initialStateEstimate
* the initial state estimate vector
* @param initialErrorCovariance
* the initial error covariance matrix
* @param stateTransition the state transition matrix
* @param control the control matrix
* @param processNoise the process noise matrix
* @param initialStateEstimate the initial state estimate vector
* @param initialErrorCovariance the initial error covariance matrix
*/
public DefaultProcessModel(final double[][] stateTransition,
final double[][] control, final double[][] processNoise,
final double[] initialStateEstimate,
final double[][] initialErrorCovariance) {
final double[][] control,
final double[][] processNoise,
final double[] initialStateEstimate,
final double[][] initialErrorCovariance) {
this(new Array2DRowRealMatrix(stateTransition),
new Array2DRowRealMatrix(control),
new Array2DRowRealMatrix(processNoise),
@ -86,15 +77,13 @@ public class DefaultProcessModel implements ProcessModel {
* parameters. The initial state estimate and error covariance are omitted
* and will be initialized by the {@link KalmanFilter} to default values.
*
* @param stateTransition
* the state transition matrix
* @param control
* the control matrix
* @param processNoise
* the process noise matrix
* @param stateTransition the state transition matrix
* @param control the control matrix
* @param processNoise the process noise matrix
*/
public DefaultProcessModel(final double[][] stateTransition,
final double[][] control, final double[][] processNoise) {
final double[][] control,
final double[][] processNoise) {
this(new Array2DRowRealMatrix(stateTransition),
new Array2DRowRealMatrix(control),
new Array2DRowRealMatrix(processNoise), null, null);
@ -104,21 +93,17 @@ public class DefaultProcessModel implements ProcessModel {
* Create a new {@link ProcessModel}, taking double arrays as input
* parameters.
*
* @param stateTransition
* the state transition matrix
* @param control
* the control matrix
* @param processNoise
* the process noise matrix
* @param initialStateEstimate
* the initial state estimate vector
* @param initialErrorCovariance
* the initial error covariance matrix
* @param stateTransition the state transition matrix
* @param control the control matrix
* @param processNoise the process noise matrix
* @param initialStateEstimate the initial state estimate vector
* @param initialErrorCovariance the initial error covariance matrix
*/
public DefaultProcessModel(final RealMatrix stateTransition,
final RealMatrix control, final RealMatrix processNoise,
final RealVector initialStateEstimate,
final RealMatrix initialErrorCovariance) {
final RealMatrix control,
final RealMatrix processNoise,
final RealVector initialStateEstimate,
final RealMatrix initialErrorCovariance) {
this.stateTransitionMatrix = stateTransition;
this.controlMatrix = control;
this.processNoiseCovMatrix = processNoise;
@ -126,37 +111,27 @@ public class DefaultProcessModel implements ProcessModel {
this.initialErrorCovMatrix = initialErrorCovariance;
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public RealMatrix getStateTransitionMatrix() {
return stateTransitionMatrix;
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public RealMatrix getControlMatrix() {
return controlMatrix;
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public RealMatrix getProcessNoise() {
return processNoiseCovMatrix;
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public RealVector getInitialStateEstimate() {
return initialStateEstimateVector;
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public RealMatrix getInitialErrorCovariance() {
return initialErrorCovMatrix;
}

View File

@ -78,6 +78,7 @@ import org.apache.commons.math.util.MathUtils;
* Kalman filter example by Dan Simon</a>
* @see ProcessModel
* @see MeasurementModel
* @since 3.0
* @version $Id$
*/
public class KalmanFilter {
@ -286,10 +287,9 @@ public class KalmanFilter {
/**
* Predict the internal state estimation one time step ahead.
*
* @param u
* the control vector
* @throws DimensionMismatchException
* if the dimension of the control vector does not fit
* @param u the control vector
* @throws DimensionMismatchException if the dimension of the control
* vector does not fit
*/
public void predict(final RealVector u) {
// sanity checks
@ -318,12 +318,11 @@ public class KalmanFilter {
/**
* Correct the current state estimate with an actual measurement.
*
* @param z
* the measurement vector
* @param z the measurement vector
* @throws DimensionMismatchException
* if the dimension of the measurement vector does not fit
* if the dimension of the measurement vector does not fit
* @throws org.apache.commons.math.linear.SingularMatrixException
* if the covariance matrix could not be inverted
* if the covariance matrix could not be inverted
*/
public void correct(final double[] z) {
correct(new ArrayRealVector(z));
@ -332,12 +331,11 @@ public class KalmanFilter {
/**
* Correct the current state estimate with an actual measurement.
*
* @param z
* the measurement vector
* @throws DimensionMismatchException
* if the dimension of the measurement vector does not fit
* @param z the measurement vector
* @throws DimensionMismatchException if the dimension of the
* measurement vector does not fit
* @throws org.apache.commons.math.linear.SingularMatrixException
* if the covariance matrix could not be inverted
* if the covariance matrix could not be inverted
*/
public void correct(final RealVector z) {
// sanity checks

View File

@ -21,6 +21,7 @@ import org.apache.commons.math.linear.RealMatrix;
/**
* Defines the measurement model for the use with a {@link KalmanFilter}.
*
* @since 3.0
* @version $Id$
*/
public interface MeasurementModel {

View File

@ -22,6 +22,7 @@ import org.apache.commons.math.linear.RealVector;
/**
* Defines the process dynamics model for the use with a {@link KalmanFilter}.
*
* @since 3.0
* @version $Id$
*/
public interface ProcessModel {