bsts.## S3 method for class 'bsts':
plot(x, y = c("state", "components", "residuals",
"coefficients", "prediction.errors",
"forecast.distribution",
"predictors", "size", "dynamic"),
...) PlotBstsCoefficients(bsts.object, burn = SuggestBurn(.1, bsts.object),
inclusion.threshold = 0, number.of.variables = NULL, ...)
PlotBstsComponents(bsts.object, burn = SuggestBurn(.1, bsts.object),
time, same.scale = TRUE,
layout = c("square", "horizontal", "vertical"),
style = c("dynamic", "boxplot"),
ylim = NULL, ...)
PlotDynamicRegression(bsts.object, burn = SuggestBurn(.1, bsts.object),
time = NULL, style = c("dynamic", "boxplot"),
layout = c("square", "horizontal", "vertical"),
...)
PlotBstsState(bsts.object, burn = SuggestBurn(.1, bsts.object),
time, show.actuals = TRUE,
style = c("dynamic", "boxplot"), ...)
PlotBstsResiduals(bsts.object, burn = SuggestBurn(.1, bsts.object),
time, style = c("dynamic", "boxplot"), ...)
PlotBstsPredictionErrors(bsts.object, burn = SuggestBurn(.1, bsts.object),
time, style = c("dynamic", "boxplot"), ...)
PlotBstsSize(bsts.object, burn = SuggestBurn(.1, bsts.object), style =
c("histogram", "ts"), ...)
bsts.bsts.TRUE then all the state
components will be plotted with the same scale on the vertical axis.
If FALSE then each component will get its own scale for the
vertical axis.TRUE then actual values from
the fitted series will be shown on the plot.what ==
"coefficients". See the help file for plot.lm.spike.NULL this specifies the
number of coefficients to plot, taking precedence over
inclusion.threshold. See plot.lm.spike.NULL these will
be inferred from the state components and the same.scale
argument. Otherwise all plots will be created with the same
ylim values.PlotDynamicDistributionPlotBstsState, PlotBstsComponents, and
PlotBstsResiduals all produce dynamic distribution
plots. PlotBstsState plots the aggregate state
contribution (including regression effects) to the mean, while
PlotBstsComponents plots the contribution of each state
component. PlotBstsResiduals plots the posterior
distribution of the residuals given complete data (i.e. looking
forward and backward in time). PlotBstsPredictionErrors
plots filtering errors (i.e. the one-step-ahead prediction errors
given data up to the previous time point).
PlotBstsForecastDistribution plots the one-step-ahead
forecasts instead of the prediction errors. PlotBstsCoefficients creates a significance plot for
the predictors used in the state space regression model. It is
obviously not useful for models with no regressors.
PlotBstsSize plots the distribution of the number of
predictors included in the model.
bsts
PlotDynamicDistribution
plot.lm.spikedata(AirPassengers)
y <- log(AirPassengers)
ss <- AddLocalLinearTrend(list(), y)
ss <- AddSeasonal(ss, y, nseasons = 12)
model <- bsts(y, state.specification = ss, niter = 500)
plot(model, burn = 100)
plot(model, "residuals", burn = 100)
plot(model, "components", burn = 100)
plot(model, "forecast.distribution", burn = 100)Run the code above in your browser using DataLab