hatvalues.KFS {KFAS} | R Documentation |
Extract Hat Values from KFS Output
Description
Extract hat values from KFS output, when KFS
was run with signal
(non-Gaussian case) or mean smoothing (Gaussian case).
Usage
## S3 method for class 'KFS'
hatvalues(model, ...)
Arguments
model |
An object of class |
... |
Additional arguments to |
Details
Hat values in KFAS
are defined as the diagonal elements of V_t/H_t
where V_t
is the covariance matrix of signal/mean at time t and H_t is the covariance
matrix of disturbance vector \epsilon
of (approximating) Gaussian model
at time t. This definition gives identical results with the standard
definition in case of GLMs. Note that it is possible to construct a state
space model where this definition is not meaningful (for example the
covariance matrix H_t can contain zeros on diagonal).
Value
Multivariate time series containing hat values.
Examples
model <- SSModel(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)
out <- KFS(model, filtering = "state", smoothing = "none")
# estimate sigma2
model["H"] <- mean(c(out$v[1:out$d][out$Finf==0]^2/out$F[1:out$d][out$Finf==0],
out$v[-(1:out$d)]^2/out$F[-(1:out$d)]))
c(hatvalues(KFS(model)))
[Package KFAS version 1.5.1 Index]