diagnostic-plots | R Documentation |

Diagnostic plots for distributions of residuals.

qqdist(draws, ...) AcfDist(draws, lag.max = NULL, xlab = "Lag", ylab = "Autocorrelation", ...)

`draws` |
A matrix of Monte Carlo draws of residual errors. Each row is a Monte Carlo draw, and each column is an observation. In the case of AcfDist successive observations are assumed to be sequential in time. |

`lag.max` |
The number of lags to plot in the autocorrelation
function. See |

`xlab` |
Label for the horizontal axis. |

`ylab` |
Label for the vertical axis. |

`...` |
Extra arguments passed to either |

`qqdist`

sorts the columns of `draws`

by their mean, and
plots the resulting set of curves against the quantiles of the
standard normal distribution. A reference line is added, and the mean
of each column of draws is represented by a blue dot. The dots and
the line are the transpose of what you get with `qqnorm`

and `qqline`

.

`AcfDist`

plots the posterior distribution of the autocorrelation
function using a set of side-by-side boxplots.

data(AirPassengers) y <- log(AirPassengers) ss <- AddLocalLinearTrend(list(), y) ss <- AddSeasonal(ss, y, nseasons = 12) model <- bsts(y, ss, niter = 500) r <- residuals(model) par(mfrow = c(1,2)) qqdist(r) ## A bit of departure in the upper tail AcfDist(r)

bsts documentation built on Nov. 10, 2022, 5:53 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.