Package dev.nm.stat.dlm.multivariate
Class MultivariateLinearKalmanFilter
- java.lang.Object
-
- dev.nm.stat.dlm.multivariate.MultivariateLinearKalmanFilter
-
public class MultivariateLinearKalmanFilter extends Object
The Kalman filter, also known as linear quadratic estimation (LQE), is an algorithm which uses a series of measurements observed over time, containing noise (random variations) and other inaccuracies, and produces estimates of unknown variables that tend to be more precise than those that would be based on a single measurement alone. More formally, the Kalman filter operates recursively on streams of noisy input data to produce a statistically optimal estimate of the underlying system state.
-
-
Constructor Summary
Constructors Constructor Description MultivariateLinearKalmanFilter(MultivariateDLM model)Construct a Kalman filter from a multivariate controlled dynamic linear model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdimension()Get the dimension of the system, i.e., the dimension of the state vector.voidfiltering(MultivariateIntTimeTimeSeries Yt)Filter the observations without control variable.voidfiltering(MultivariateIntTimeTimeSeries Yt, MultivariateIntTimeTimeSeries Ut)Filter the observations.ImmutableVectorgetFittedState(int t)Get the posterior expected state.MultivariateSimpleTimeSeriesgetFittedStates()Get the posterior expected states.ImmutableMatrixgetFittedStateVariance(int t)Get the posterior expected state variance.ImmutableMatrixgetKalmanGain(int t)Get the Kalman gain.ImmutableVectorgetPredictedObservation(int t)Get the prior observation prediction.MultivariateSimpleTimeSeriesgetPredictedObservations()Get the prior observation predictions.ImmutableMatrixgetPredictedObservationVariance(int t)Get the prior observation prediction variance.ImmutableVectorgetPredictedState(int t)Get the prior expected state.MultivariateSimpleTimeSeriesgetPredictedStates()Get the prior expected states.ImmutableMatrixgetPredictedStateVariance(int t)Get the prior expected state variance.intsize()Get T, the number of hidden states or observations.
-
-
-
Constructor Detail
-
MultivariateLinearKalmanFilter
public MultivariateLinearKalmanFilter(MultivariateDLM model)
Construct a Kalman filter from a multivariate controlled dynamic linear model.- Parameters:
model- a multivariate controlled DLM
-
-
Method Detail
-
filtering
public void filtering(MultivariateIntTimeTimeSeries Yt, MultivariateIntTimeTimeSeries Ut)
Filter the observations.- Parameters:
Yt- the observationsUt- the controls
-
filtering
public void filtering(MultivariateIntTimeTimeSeries Yt)
Filter the observations without control variable.- Parameters:
Yt- the observations
-
dimension
public int dimension()
Get the dimension of the system, i.e., the dimension of the state vector.- Returns:
- the dimension of the system
-
size
public int size()
Get T, the number of hidden states or observations.- Returns:
- T
-
getFittedStates
public MultivariateSimpleTimeSeries getFittedStates()
Get the posterior expected states.- Returns:
- the fitted states
-
getPredictedStates
public MultivariateSimpleTimeSeries getPredictedStates()
Get the prior expected states.- Returns:
- the predicted states
-
getPredictedObservations
public MultivariateSimpleTimeSeries getPredictedObservations()
Get the prior observation predictions.- Returns:
- the predicted observations
-
getFittedState
public ImmutableVector getFittedState(int t)
Get the posterior expected state.- Parameters:
t- time, t ≥ 1- Returns:
- the fitted state
-
getFittedStateVariance
public ImmutableMatrix getFittedStateVariance(int t)
Get the posterior expected state variance.- Parameters:
t- time, t ≥ 1- Returns:
- the fitted state variance
-
getPredictedState
public ImmutableVector getPredictedState(int t)
Get the prior expected state.- Parameters:
t- time, t ≥ 1- Returns:
- the predicted state
-
getPredictedStateVariance
public ImmutableMatrix getPredictedStateVariance(int t)
Get the prior expected state variance.- Parameters:
t- time, t ≥ 1- Returns:
- the predicted state variance
-
getPredictedObservation
public ImmutableVector getPredictedObservation(int t)
Get the prior observation prediction.- Parameters:
t- time, t ≥ 1- Returns:
- the predicted observation
-
getPredictedObservationVariance
public ImmutableMatrix getPredictedObservationVariance(int t)
Get the prior observation prediction variance.- Parameters:
t- time, t ≥ 1- Returns:
- the predicted observation variance
-
getKalmanGain
public ImmutableMatrix getKalmanGain(int t)
Get the Kalman gain.- Parameters:
t- time, t ≥ 1- Returns:
- the Kalman gain
-
-