plot.bsts.predictors {bsts} | R Documentation |
Plot the most likely predictors
Description
Creates a time series plot showing the most likely
predictors of a time series used to fit a bsts
object.
Usage
PlotBstsPredictors(bsts.object,
burn = SuggestBurn(.1, bsts.object),
inclusion.threshold = .1,
ylim = NULL,
flip.signs = TRUE,
show.legend = TRUE,
grayscale = TRUE,
short.names = TRUE,
...)
Arguments
bsts.object |
An object of class |
burn |
The number of observations you wish to discard as burn-in. |
inclusion.threshold |
Plot predictors with marginal inclusion probabilities above this threshold. |
ylim |
Scale for the vertical axis. |
flip.signs |
If true then a predictor with a negative sign will be flipped before being plotted, to better align visually with the target series. |
show.legend |
Should a legend be shown indicating which predictors are plotted? |
grayscale |
Logical. If |
short.names |
Logical. If |
... |
Extra arguments to be passed to |
See Also
bsts
PlotDynamicDistribution
plot.lm.spike
Examples
data(AirPassengers)
y <- log(AirPassengers)
lag.y <- c(NA, head(y, -1))
ss <- AddLocalLinearTrend(list(), y)
ss <- AddSeasonal(ss, y, nseasons = 12)
## Call bsts with na.action = na.omit to omit the leading NA in lag.y
model <- bsts(y ~ lag.y, state.specification = ss, niter = 500,
na.action = na.omit)
plot(model, "predictors")