Add a local level model to a state specification. The local level model assumes the trend is a random walk:
alpha[t+1] = alpha[t] + rnorm(1, 0, sigma).
The prior is on the sigma parameter.
1 2 3 4 5 6 7  AddLocalLevel(
state.specification,
y,
sigma.prior,
initial.state.prior,
sdy,
initial.y)

state.specification 
A list of state components that you wish to add to. If omitted, an empty list will be assumed. 
y 
The time series to be modeled, as a numeric vector. 
sigma.prior 
An object created by 
initial.state.prior 
An object created using

sdy 
The standard deviation of the series to be modeled. This
will be ignored if 
initial.y 
The initial value of the series being modeled. This will be
ignored if 
Returns a list with the elements necessary to specify a local linear trend state model.
Steven L. Scott stevescott@google.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.
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.