
Multi-chain fit with convergence diagnostics (Gelman-Rubin R-hat, ESS)
Source:R/env_prediction.R
kernel_model_mc.RdRuns independent chains with different seeds and reports R-hat and a crude ESS for the residual and each kernel-scale parameter. R-hat above 1.01 or a tiny ESS means the chain has not mixed: increase `iterations`.
Arguments
- ...
arguments passed to
kernel_model(e.g.y,data,random,env,gid).- n_chains
integer. Number of independent chains. Default 3.
- seed
integer. Base seed; chain
cusesseed + c. Default 1.- tol
numeric. Eigenvalue tolerance passed to the kernel decomposition.
- scale_kernels
logical. If
TRUE(default) kernels are scaled before fitting.
Value
An object of class "kernel_model" (the fit of the first chain;
see kernel_model) with two added elements:
diagnostics, a data.frame giving the Gelman-Rubin Rhat and
effective sample size ESS for the residual variance and each
kernel-scale parameter, and all_chains, the list of individual
per-chain fits.