plot.svpredict: Graphical Summary of the Posterior Predictive Distribution

Description Usage Arguments Value Note See Also Examples

View source: R/plotting.R

Description

plot.svpredict and plot.svlpredict generate some plots visualizing the posterior predictive distribution of future volatilites and future observations.

Usage

1
2
## S3 method for class 'svpredict'
plot(x, quantiles = c(0.05, 0.25, 0.5, 0.75, 0.95), ...)

Arguments

x

svpredict or svlpredict object.

quantiles

Which quantiles to plot? Defaults to c(.05, .25, .5, .75, .95).

...

further arguments are passed on to the invoked ts.plot or boxplot function.

Value

Called for its side effects. Returns argument x invisibly.

Note

Note that svpredict or svlpredict objects can also be used within plot.svdraws for a possibly more useful visualization. See the examples in predict.svdraws and those below for use cases.

See Also

Other plotting: paradensplot(), paratraceplot.svdraws(), paratraceplot(), plot.svdraws(), volplot()

Other plotting: paradensplot(), paratraceplot.svdraws(), paratraceplot(), plot.svdraws(), volplot()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Simulate a short and highly persistent SV process
sim <- svsim(100, mu = -10, phi = 0.99, sigma = 0.1)

## Obtain 5000 draws from the sampler (that's not a lot)
draws <- svsample(sim$y, draws = 5000, burnin = 1000)

## Predict 10 steps ahead
pred <- predict(draws, 10)

## Visualize the predicted distributions
plot(pred)

## Plot the latent volatilities and some forecasts
plot(draws, forecast = pred)

stochvol documentation built on July 12, 2021, 5:08 p.m.