Learn R Programming

stochvol (version 1.1.3)

predict.svdraws: Prediction of Future Log-Volatilities

Description

Simulates draws from the predictive density of the latent log-volatility process.

Usage

## S3 method for class 'svdraws':
predict(object, steps = 1, ...)

Arguments

object
svdraws object.
steps
single number, coercible to integer. Denotes the number of steps to forecast.
...
currently ignored.

Value

  • Returns an object of class c("svpredict", "mcmc") containing simulations from the predictive density of h_(n+1),...,h_(n+steps).

See Also

plot.svdraws, volplot.

Examples

Run this code
## Simulate a short and highly persistent SV process 
sim <- svsim(100, mu = -10, phi = 0.99, sigma = 0.2)

## Obtain 5000 draws from the sampler (that's not a lot)
draws <- svsample(sim$y, draws = 5000, burnin = 100,
		  priormu = c(-10, 1), priorphi = c(20, 1.5), priorsigma = 0.2)

## Predict 10 days ahead
fore <- predict(draws, 10)

## Check out the results
summary(fore)
plot(draws, forecast = fore)

Run the code above in your browser using DataLab