update
Syntax
Description
update
efficiently updates the state distribution in
real time by applying one recursion of the Kalman filter to compute
state-distribution moments for the final period of the specified response data.
To compute state-distribution moments by recursive application of the Kalman filter for
each period in the specified response data, use filter
instead.
[
returns the updated state-distribution moments at the final time T,
conditioned on the current state distribution, by applying one recursion of the Kalman
filter to the fully specified, standard state-space
model
nextState
,NextStateCov
] = update(Mdl
,Y
)Mdl
given T observed responses
Y
. nextState
and
NextStateCov
are the mean and covariance, respectively, of the
updated state distribution.
[
initializes the Kalman filter at the current state distribution with mean
nextState
,NextStateCov
] = update(Mdl
,Y
,currentState
,CurrentStateCov
)currentState
and covariance matrix
CurrentStateCov
.
[
uses additional options specified by one or more name-value arguments, and uses any of the
input-argument combinations in the previous syntaxes. For example,
nextState
,NextStateCov
] = update(___,Name,Value
)update(Mdl,Y,Params=params,SquareRoot=true)
sets unknown parameters in
the partially specified model Mdl
to the values in
params
, and specifies use of the square-root Kalman filter variant for
numerical stability.
[
also returns the loglikelihoods computed for each observation in
nextState
,NextStateCov
,logL
] = update(___)Y
.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
More About
Algorithms
The Kalman filter accommodates missing data by not updating filtered state estimates corresponding to missing observations. In other words, suppose there is a missing observation at period t. Then, the state forecast for period t based on the previous t – 1 observations and filtered state for period t are equivalent.
For explicitly defined state-space models,
update
applies all predictors to each response series. However, each response series has its own set of regression coefficients.For efficiency,
update
does minimal input validation.In theory, the state covariance matrix must be symmetric and positive semi-definite.
update
forces symmetry of the covariance matrix before it applies the Kalman filter, but it does not check whether the matrix is positive semi-definite.
Alternative Functionality
To obtain filtered states for each period in the response data, call the filter
function instead. Unlike update
,
filter
performs comprehensive input validation.
References
Version History
Introduced in R2021b