Computes the onestepahead prediction errors for a model of class
bsts
on a holdout sample.
1 2 3 4  bsts.holdout.prediction.errors(bsts.object,
newdata,
burn = SuggestBurn(.1, bsts.object),
na.action = na.omit)

bsts.object 
An object of class 
newdata 
The holdout sample of data. If

burn 
An integer giving the number of MCMC iterations to discard
as burnin. If 
na.action 
A function determining what should be done with
missing values in 
A matrix of draws of the onestepahead prediction errors. Rows of the matrix correspond to MCMC draws. Columns correspond to time.
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.
bsts
,
AddLocalLevel
,
AddLocalLinearTrend
,
AddGeneralizedLocalLinearTrend
,
SpikeSlabPrior
,
SdPrior
,
bsts.prediction.errors
.
1 2 3 4 5 6 7  data(AirPassengers)
y < log(AirPassengers)
ss < AddLocalLinearTrend(list(), y)
ss < AddSeasonal(ss, y, nseasons = 12)
model < bsts(y, state.specification = ss, niter = 500)
errors < bsts.prediction.errors(model, burn = 100)
PlotDynamicDistribution(errors)

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.