## Not run:
# set.seed(1)
# sim <- fsvsim(series = 3, factors = 1) # simulate
# res <- fsvsample(sim$y, factors = 1) # estimate
#
# # Predict 1, 10, and 100 days ahead:
# predobj <- predh(res, ahead = c(1, 10, 100))
#
# # Trace plot of draws from posterior predictive factor log-variance
# # (one, ten, and 100 days ahead):
# plot.ts(predobj$factorh[1,,])
#
# # Smoothed kernel density estimates of predicted volas:
# plot(density(exp(predobj$factorh[1,,"1"]/2), adjust = 2))
# lines(density(exp(predobj$factorh[1,,"10"]/2), adjust = 2), col = 2)
# lines(density(exp(predobj$factorh[1,,"100"]/2), adjust = 2), col = 3)
# ## End(Not run)
Run the code above in your browser using DataLab