Analyse divergences in a stanfit object
stan_checkdivergences(sf, nupars = "all")
stanfit object.
either the string 'all', or an integer reflecting how many pars (from first to nupars) to use.
A list of four matrices. $locationsort and $sdsort contian the bivariate interactions of unconstrained parameters, sorted by either the relative location of any divergences, or the relative standard deviation. $locationmeans and $sdmeans collapse across the bivariate interactions to return the means for each parameter.
# NOT RUN {
library(rstan)
scode <- "
parameters {
real y[2];
}
model {
y[1] ~ normal(0, 1);
y[2] ~ double_exponential(0, y[1]);
}
"
fit1 <- stan(model_code = scode, iter = 10)
stan_checkdivergences(fit1)
# }
Run the code above in your browser using DataLab