id_sim_coverage: Function that computes how often the true value of the...

View source: R/Simulate.R

id_sim_coverageR Documentation

Function that computes how often the true value of the parameter is included within the 95/5 high posterior density interval

Description

Function that computes how often the true value of the parameter is included within the 95/5 high posterior density interval

Usage

id_sim_coverage(obj, rep = 1, quantiles = c(0.95, 0.05))

Arguments

obj

A fitted idealstan object with true data generated by id_sim_gen()

rep

How many times the models were fitted on new data, currently can only be 1

quantiles

What the quantile coverage of the high posterior density interval should be

Value

A named list of tibble objects, one per parameter type (Person Ideal Points, Absence Discriminations, Item Discrimations), each with columns avg, high, low, Params, est_type, and iter summarising posterior coverage of the true parameter values.

Examples


sim <- id_sim_gen()
est <- id_estimate(sim, model_type=1, fixtype='vb_full',
                   use_method="pathfinder", nchains=2, ncores=2)
cov <- id_sim_coverage(est)
# average coverage across all person ideal points
mean(cov[['Person Ideal Points']]$avg)


idealstan documentation built on May 13, 2026, 1:08 a.m.