loo.bmgarch | R Documentation |
lfocv
returns the LFO-CV ELPD by either computing the exact ELDP or
by approximating it via
forward or backward approximation strategies based on Pareto smoothed
importance sampling
described in \insertCiteBuerkner2019bmgarch.
## S3 method for class 'bmgarch'
loo(x, ..., type = "lfo", L = NULL, M = 1, mode = "backward")
x |
Fitted bmgarch model. |
... |
Not used |
type |
Takes |
L |
Minimal length of times series before computing LFO |
M |
M step head predictions. Defines to what period the LFO-CV should be tuned to. Defaults to M=1. |
mode |
backward elpd_lfo approximation, or exact elpd-lfo;
Takes 'backward', and 'exact'. 'exact' fits N-L models and may
take a very long time to complete. |
Approximate LFO-CV value and log-likelihood values across (L+1):N timepoints
## Not run:
data(stocks)
# Fit a DCC model
fit <- bmgarch(data = stocks[1:100, c("toyota", "nissan" )],
parameterization = "DCC", standardize_data = TRUE,
iterations = 500)
# Compute expected log-predictive density (elpd) using the backward mode
# L is the upper boundary of the time-series before we engage in LFO-CV
lfob <- loo(fit, mode = 'backward', L = 50 )
print(lfob)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.