wex {wex} | R Documentation |
Exact observation weights for the Kalman filter and smoother.
Description
This function computes the exact observation weights for the Kalman filter and smoother,
as described by Koopman and Harvey (2003). The implementation of wex
builds upon the
existing FKF
package (see: https://CRAN.R-project.org/package=FKF).
Usage
wex(a0 = NULL, P0 = NULL, Tt, Zt, HHt, GGt, yt, t)
Arguments
a0 |
A |
P0 |
A |
Tt |
An |
Zt |
An |
HHt |
An |
GGt |
An |
yt |
An |
t |
An observation index for which the weights are returned. |
Details
State space form
\alpha_{t+1} = T_t \alpha_t + H_t \eta_t,
y_t = Z_t \alpha_t + G_t \epsilon_t,
where y_t
represents the observed data (possibly with NA's),
and \alpha_t
is the state vector.
Value
Weight matrices for filtering (Wt) and smoothing (WtT).
References
Koopman, S. J., & Harvey, A. (2003). Computing observation weights for signal extraction and filtering. Journal of Economic Dynamics and Control, 27(7), 1317-1333.
Examples
# Decompose a local level model (Nile data set)
data(Nile)
y <- Nile
wts <- wex(Tt=matrix(1),
Zt=matrix(1),
HHt = matrix(1385.066),
GGt = matrix(15124.13),
yt = t(y),
t=50)