Description Usage Arguments Value See Also Examples

View source: R/utilities_fsvdraws.R

`predh`

simulates from the posterior predictive distribution
of the latent log-variances h, both for factors as well as for
idiosyncratic series.

1 | ```
predh(x, ahead = 1, each = 1)
``` |

`x` |
Object of class |

`ahead` |
Vector of timepoints, indicating how many steps to predict ahead. |

`each` |
Single integer (or coercible to such) indicating how often should be drawn from the posterior predictive distribution for each draw that has been stored during MCMC sampling. |

List of class `fsvpredh`

containing two elements:

idihArray containing the draws of the latent idiosyncratic log-volatilities.

factorhArray containing the draws of the latent factor log-volatilities.

Other predictors: `predcond`

,
`predcor`

, `predcov`

,
`predloglikWB`

, `predloglik`

,
`predprecWB`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.