## Not run:
# set.seed(1)
# sim <- fsvsim(n = 500, series = 4, factors = 1) # simulate
# res <- fsvsample(sim$y, factors = 1) # estimate
#
# # Predict 1 day ahead:
# predobj <- predcond(res, each = 5)
#
# # Draw from the predictive distribution:
# preddraws <- matrix(rnorm(length(predobj$mean[,,1]),
# mean = predobj$mean[,,1],
# sd = predobj$vols[,,1]), nrow = 4)
#
# # Visualize the predictive distribution
# pairs(t(preddraws), col = rgb(0,0,0,.1), pch = 16)
# ## End(Not run)
Run the code above in your browser using DataLab