| stan_trace | R Documentation |
This function allows you to produce trace plots for assessing the quality and convergence of MCMC chains.
stan_trace(object, ...)
object |
A fitted |
... |
Other options passed on to |
To use this function, you must pass a fitted idealstan object
along with the name of a parameter in the model. To determine these
parameter names, use the summary function or obtain the data
from a plot by passing the return_data=TRUE option to
id_plot_persons or id_plot_persons_dyn to find the
name of the parameter in the Stan model.
This function is a simple wrapper around mcmc_trace.
Please refer to that function's documentation for further options.
A ggplot2 object (from mcmc_trace) showing MCMC trace plots
for the selected parameter.
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,
fixtype='vb_full', use_method="pathfinder", ncores=4)
stan_trace(sen_est, par='L_full[1]')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.