## Executable examples are disabled for routine package builds. Set LKT_RUN_EXPENSIVE_VIGNETTES=true to run this vignette.
The bootstrap is intentionally not evaluated during routine CRAN
checks. Set LKT_RUN_EXPENSIVE_VIGNETTES=true to execute it
when rendering.
components <- c("KC..Default.", "KC..Default.", "KC..Default.")
features <- c("intercept", "linesuc$", "linefail$")
fixedpars <- NA
mod1 <- LKT(
data.table::setDT(val),
interc = TRUE,
components = components,
features = features,
fixedpars = fixedpars,
seedpars = c(NA)
)
check_lkt_fit(mod1, expected_r2 = 0.21369, expected_loglike = -29866.78674638)
check_has_coefficient_containing(mod1, ":linesucKC..Default.")n_students <- 400
n_boot <- 100
boot_res <- LKT_HDI(
val,
n_boot,
n_students,
comps = components,
feats = features,
fixeds = fixedpars,
cred_mass = 0.99
)
check_true("HDI bootstrap count", nrow(boot_res$par_reps) == n_boot)
check_true("HDI result rows", nrow(boot_res$coef_hdi) >= 20)
check_close("HDI credibility mass", boot_res$coef_hdi$credMass[1], 0.99)