AddStudentLocalLinearTrend(
state.specification = NULL,
y,
save.weights = FALSE,
level.sigma.prior = NULL,
level.nu.prior = NULL,
slope.sigma.prior = NULL,
slope.nu.prior = NULL,
initial.level.prior = NULL,
initial.slope.prior = NULL,
sdy,
initial.y)SdPrior describing the prior distribution for
the standard deviation of the level component.DoubleModel, representing the prior
distribution on the nu tail thickness parameter of the T
distribution for errors in the evolution equaSdPrior describing the prior distribution of
the standard deviation of the slope component.DoubleModel, representing the prior
distribution on the nu tail thickness parameter of the T
distribution for errors in the evolution equaNormalPrior describing the initial distribution
of the level portion of the initial state vector.NormalPrior describing the prior distribution
for the slope portion of the initial state vector.y is provided, or if all the required
prior distributions are supplied directly.y is provided, or if the priors for the initial
state are all provided directly.Durbin and Koopman (2001), "Time series analysis by state space methods", Oxford University Press.
bsts.
SdPrior
NormalPriordata(rsxfs)
ss <- AddStudentLocalLinearTrend(list(), rsxfs)
model <- bsts(rsxfs, state.specification = ss, niter = 500)
pred <- predict(model, horizon = 12, burn = 100)
plot(pred)Run the code above in your browser using DataLab