lfo | R Documentation |
Estimates the leave-future-out (LFO) information criterion for walker
and walker_glm
models.
lfo(object, L, exact = FALSE, verbose = TRUE, k_thres = 0.7)
object |
Output of |
L |
Positive integer defining how many observations should be used for the initial fit. |
exact |
If |
verbose |
If |
k_thres |
Threshold for the pareto k estimate triggering refit. Default is 0.7. |
The LFO for non-Gaussian models is (currently) based on the corresponding Gaussian approximation and not the importance sampling corrected true posterior.
List with components ELPD
(Expected log predictive density), ELPDs
(observation-specific ELPDs),
ks
(Pareto k values in case of approximation was used), and refits
(time points where model was re-estimated)
Paul-Christian Bürkner, Jonah Gabry & Aki Vehtari (2020). Approximate leave-future-out cross-validation for Bayesian time series models, Journal of Statistical Computation and Simulation, 90:14, 2499-2523, DOI: 10.1080/00949655.2020.1783262.
## Not run:
fit <- walker(Nile ~ -1 +
rw1(~ 1,
beta = c(1000, 100),
sigma = c(2, 0.001)),
sigma_y_prior = c(2, 0.005),
iter = 2000, chains = 1)
fit_lfo <- lfo(fit, L = 20, exact = FALSE)
fit_lfo$ELPD
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.