## 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)
Run the code above in your browser using DataLab