add.shared.local.level | R Documentation |
Add a shared local level model to a state specification. The shared local level model assumes the trend is a multivariate random walk:
alpha[t+1, ] = alpha[t, ] + rnorm(nfactors, 0, sigma).
The contribution to the mean of the observed series obeys
y[t, ] = B %*% alpha[t, ]
plus
observation error. Identifiability constraints imply that the
observation coefficients B
form a rectangular lower triangular
matrix with diagonal 1.0.
If there are m time series and p factors, then B has m rows and p columns. Having B be lower triangular means that the first factor affects all series. The second affects all but the first, the third excludes the first two, etc.
AddSharedLocalLevel( state.specification, response, nfactors, coefficient.prior = NULL, initial.state.prior = NULL, timestamps = NULL, series.id = NULL, sdy, ...)
state.specification |
A pre-existing list of state components that you wish to add to. If omitted, an empty list will be assumed. |
response |
The time series to be modeled. This can either be a
matrix with rows as time and columns as series, or it can be a numeric
vector. If a vector is passed then |
nfactors |
The number of latent factors to include in the model. This is the dimension of the state for this model component. |
coefficient.prior |
Prior distribution on the observation coefficients. |
initial.state.prior |
An object of class
|
timestamps |
If |
series.id |
If |
sdy |
A vector giving the standard deviation of each series to be
modeled. This argument is only necessary if |
... |
Extra arguments passed to
|
Returns a list with the elements necessary to specify a local linear trend state model.
Steven L. Scott steve.the.bayesian@gmail.com
Harvey (1990), "Forecasting, structural time series, and the Kalman filter", Cambridge University Press.
Durbin and Koopman (2001), "Time series analysis by state space methods", Oxford University Press.
bsts
.
SdPrior
NormalPrior
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.