launch_shinystan-idealstan-method: Function to Launch Shinystan with an 'idealstan' Object

launch_shinystan,idealstan-methodR Documentation

Function to Launch Shinystan with an idealstan Object

Description

This wrapper will pull the posterior draws out of a fitted idealstan model and then launch launch_shinystan. This function is useful for examining convergence statistics of the underlying MCMC sampling. It works with models fitted with either backend ('cmdstanr' or 'stanr'). Models fitted with use_method="pathfinder" or "laplace" have no sampler diagnostics, so only their draws are shown.

Usage

## S4 method for signature 'idealstan'
launch_shinystan(
  object,
  pars = c("L_full", "sigma_reg_full", "sigma_abs_free", "A_int_free", "B_int_free",
    "steps_votes", "steps_votes_grm"),
  ...
)

Arguments

object

A fitted idealstan object

pars

A character vector of the parameters to show. The default shows the ideal points, the discriminations and difficulties of the items, and, for ordinal models, the cutpoints ('steps_votes' and 'steps_votes_grm' select the cutpoints of every ordinal model type). NULL shows every parameter, which can be slow for large models.

...

Other parameters passed on to launch_shinystan and from there to shiny::runApp(), such as port. Whether a browser is opened is set with options(shiny.launch.browser = ).

Value

No return value; called for side effects (launches the Shinystan interactive diagnostics application).

See Also

shinystan

Examples



data('senate114')
senate114$cast_code <- ifelse(senate114$cast_code=="Absent", NA,
                              as.integer(senate114$cast_code) - 1L)
sen_data <- id_make(senate114, outcome_disc='cast_code',
                    person_id='bioname', item_id='rollnumber',
                    group_id='party_code')
sen_est <- id_estimate(sen_data, model_type=1, use_method="pathfinder", fixtype='vb_full', ncores=4)

# will launch interactive browser
if(interactive()) {
  launch_shinystan(sen_est)
}




idealstan documentation built on Dec. 2, 2026, 5:07 p.m.