When 1 or more parameters monitored are included in codaOnly and you run plot or traceplot with the output, you get
Error in x$summary[parameter, "Rhat"] : subscript out of boundstraceback shows this is coming from param_trace.
When parameters=NULL, get_plot_info does
all_params <- param_names(x$samples)
so the default is to plot all the parameters monitored, including those in codaOnly, and that happens with densityplot.
But plot and traceplot display Rhat, and that is not calculated for codaOnly things, hence the error.
Not sure how to solve this. One option is to get all_params from the summary instead of samples, maybe x$summary[, 'Rhat'], but param_names expects an mcmc.list object. Maybe modify param_names to accept any vector of names, which would affect ppcheck and wiskerplot.
Alternatively, catch the error in param_trace and display the trace plot without R-hat.
I favour the first option: I use codaOnly for parameters with thousands of nodes. I don't want to see the summary stats and I sure don't want to plough through the diagnostic plots for all those.
When 1 or more parameters monitored are included in
codaOnly
and you runplot
ortraceplot
with the output, you getError in x$summary[parameter, "Rhat"] : subscript out of bounds
traceback
shows this is coming fromparam_trace
.When
parameters=NULL
,get_plot_info
doesall_params <- param_names(x$samples)
so the default is to plot all the parameters monitored, including those incodaOnly
, and that happens withdensityplot
.But
plot
andtraceplot
displayRhat
, and that is not calculated forcodaOnly
things, hence the error.Not sure how to solve this. One option is to get
all_params
from the summary instead of samples, maybex$summary[, 'Rhat']
, butparam_names
expects anmcmc.list
object. Maybe modifyparam_names
to accept any vector of names, which would affectppcheck
andwiskerplot
.Alternatively, catch the error in
param_trace
and display the trace plot without R-hat.I favour the first option: I use
codaOnly
for parameters with thousands of nodes. I don't want to see the summary stats and I sure don't want to plough through the diagnostic plots for all those.