SS.solve.SMW {SSsimple} | R Documentation |
Optimal Estimation
Description
Solve a state space system using the Kalman Filter.
Usage
SS.solve.SMW(Z, F, H, Q, inv.R, length.out, P0, beta0=0)
Arguments
Z |
A T x n data matrix. |
F |
The state matrix. A scalar, or vector of length d, or a d x d matrix. When scalar, |
H |
The measurement matrix. Must be n x d. |
Q |
The state variance. A scalar, or vector of length d, or a d x d matrix. When scalar, |
inv.R |
The inverse of the measurement variance. A scalar, or vector of length n, or a n x n matrix. When scalar, |
length.out |
Scalar integer. |
P0 |
Initial a priori prediction error. |
beta0 |
Initial state value. A scalar, or a vector of length d. |
Details
H
is the master argument from which system dimensionality is determined. Otherwise identical to SS.solve
, except that the Woodbury identity is used for inversion. This method offers a computationally reduced means of solving the system realization of interest; however, this method must be supplied with the inverse of the measurement variance matrix, R – not R.
Value
A named list.
B.apri |
A T x d matrix, the ith row of which is the best state estimate prior to observing data at time i. |
B.apos |
A T x d matrix, the ith row of which is the best state estimate given the observation at time i. |
Note
For a definition of the system of interest, please see SSsimple
.
Examples
set.seed(999)
H <- matrix(1)
R <- 7
inv.R <- 1 / R
x <- SS.sim( 1, H, 1, R, 100, 0 )
y <- SS.solve.SMW( x$Z, 1, H, 1, inv.R, 100, 10^5, 0 )
z.hat <- t( H %*% t( y$B.apri ) )
plot( x$Z, type="l", col="blue" )
points( z.hat[ ,1], type="l", col="red" )