Description

Uses Kalman Smoothing on structural time series models (or on the state space representation of an arima model) for imputation.

Usage

1

Arguments

x

Numeric Vector (vector) or Time Series (ts) object in which missing values shall be replaced

model

Model to be used. With this parameter the State Space Model (on which KalmanSmooth is performed) can be chosen. Accepts the following input:

"auto.arima" - For using the state space representation of arima model (using auto.arima)

"StructTS" - For using a structural model fitted by maximum likelihood (using StructTS)

For both auto.arima and StructTS additional parameters for model building can be given with the ... parameter

Additionally it is also possible to use a user created state space model (See code Example 5). This state space model could for example be obtained from another
R package for structural time series modeling. Furthermore providing the state space representation of a arima model from arima
is also possible. But it is important to note, that user created state space models must meet the requirements specified under KalmanLike. This means the user supplied state space model has to be in form of a list with at least components T, Z, h , V, a, P, Pn.
(more details under KalmanLike)

smooth

if TRUE - KalmanSmooth is used for estimation, if FALSE - KalmanRun is used. Since KalmanRun is often considered extrapolation KalmanSmooth is usually the better choice for imputation.

nit

Parameter from Kalman Filtering (see KalmanLike). Usually no need to change from default.

...

Additional parameters to be passed through to the functions that build the State Space Models (StructTS or auto.arima).

Details

The KalmanSmoother used in this function is KalmanSmooth.
It operates either on a Basic Structural Model obtained by StructTS or
the state space representation of a ARMA model obtained by auto.arima.

For an detailed explanation of Kalman Filtering and Space Space Models the following literature is a good starting point: