fitted.SSModel | R Documentation |
Computes fitted values from output of KFS
(or using the SSModel
object), i.e. one-step-ahead
predictions f(\theta_t | y_{t-1}, \ldots, y_1)
(m
) or smoothed estimates
f(\theta_t | y_n, \ldots, y_1)
(muhat
),
where f
is the inverse of the link function
(identity in Gaussian case), except in case of Poisson distribution where
f
is multiplied with the exposure u_t
.
## S3 method for class 'KFS'
fitted(object, start = NULL, end = NULL, filtered = FALSE, ...)
## S3 method for class 'SSModel'
fitted(object, start = NULL, end = NULL, filtered = FALSE, nsim = 0, ...)
object |
An object of class |
start |
The start time of the period of interest. Defaults to first time point of the object. |
end |
The end time of the period of interest. Defaults to the last time point of the object. |
filtered |
Logical, return filtered instead of smoothed estimates of
state vector. Default is |
... |
Additional arguments to |
nsim |
Only for method for for non-Gaussian model of class |
Multivariate time series containing fitted values.
signal
for partial signals and their covariances.
data("sexratio")
model <- SSModel(Male ~ SSMtrend(1,Q = list(NA)),u = sexratio[, "Total"],
data = sexratio, distribution = "binomial")
model <- fitSSM(model,inits = -15, method = "BFGS")$model
out <- KFS(model)
identical(drop(out$muhat), fitted(out))
fitted(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.