Major refactor; breaking changes.
cmdstanr::install_cmdstan() after
installing cmdstanr from the Stan r-universe (see README).fit slot on the result object is now a
CmdStanMCMC object (or
CmdStanVB when vb = TRUE), no
longer a rstan::stanfit. Methods that used to apply
directly (e.g. rstan::extract(fit)) need to be replaced
with the cmdstanr / posterior equivalents — fit$draws(),
fit$summary(), posterior::as_draws_*(),
etc.array[N, T] real x instead of real x[N, T];
abs replacing fabs).BUILD_ALL install-time flag is
gone.LinkingTo: rstan, StanHeaders, ... and the C++
machinery they entailed have been removed from the package.rhat() — internally uses posterior::rhat
via fit$summary() (a workaround for a name-collision bug
between hBayesDM::rhat and the string "rhat"
looked up by cmdstanr::CmdStanFit$summary()).extract_ic() — now extracts log_lik from
fit$draws() via posterior::as_draws_array().
The ic = "looic" | "waic" | "both" API is unchanged.plot.hBayesDM() and plot_ind() — now plot
via bayesplot (mcmc_trace,
mcmc_intervals, mcmc_areas) instead of
rstan::stan_plot.printFit → print_fit,
plotHDI → plot_hdi, plotInd →
plot_ind, plotDist → plot_dist,
HDIofMCMC → hdi.modelRegressor →
model_regressor, indPars →
ind_pars, credMass → ci_prob (on
hdi() and plot_hdi()), fontSize →
font_size, xLab → x_lab,
yLab → y_lab, xLim →
x_lim, binSize → bin_size,
sampleVec → sample_vec, roundTo →
round_to, Title → title.$allIndPars →
$all_ind_pars, $parVals →
$par_vals, $modelRegressor →
$model_regressor, $rawdata →
$raw_data. ($model and $fit
unchanged.)hdi() and
plot_hdi() default ci_prob = 0.95 (unchanged
on the R side). The Python package now also defaults to
0.95 (previously 0.94, inherited from arviz)
so the two languages produce matching HDI bands out of the box.additional_args plumbing fixed: model wrappers that
declared a NULL default
(e.g. banditNarm_2par_lapse Narm,
pstRT_ddm initQ) were silently dropping it
because args[[nm]] <- NULL removes a list element in R;
now uses args[nm] <- list(NULL) to preserve the
entry.If you have downstream code that calls
rstan::extract(output$fit), replace it with one of:
posterior::as_draws_df(output$fit$draws()) # tidy data.frame
posterior::as_draws_rvars(output$fit$draws())
output$par_vals[["mu_k"]] # already-extracted samplesrstan and pystan with
cmdstanr and cmdstanpy, respectively.fit objects now use CmdStanMCMC or
CmdStanVB in R and the corresponding CmdStanPy objects in
Python.plot_hgf_ibrb, plot_hgf_ibrb_single.hgf_ibrb for hierarchical Bayesian
analysis and hgf_ibrb_single for individual Bayesian
analysis.pstRT_ddm, pstRT_rlddm1, and
pstRT_rlddm6.banditNarm_2par_lapse, banditNarm_4par,
banditNarm_delta, banditNarm_kalman_filter,
banditNarm_lapse, banditNarm_lapse_decay, and
banditNarm_singleA_lapse.bart_ewmv to avoid dividing by zero.cgt_cm.alt_delta and alt_gamma.bart_ewmv.prl_Q.task2AFC_sdt.data argument for model functions can handle a
data.frame object (#2, #98).choiceRT_lba and choiceRT_lba_single are
temporarily removed since their codes are not suitable to the new
package structure. We plan to re-add the models in future versions.cgt_cm; #108).tau parameter in all models for the risk aversion
task is modified to be bounded to [0, 30] (#77, #78).bart_4par is fixed to compute subject-wise
log-likelihood (#82).extract_ic is fixed for its wrong rep
function usage (#94, #100).delta parameter) in
choiceRT_ddm and choiceRT_ddm_single is
unbounded and now it is estimated between [-Inf, Inf] (#95, #107).choiceRT_ddm and
choiceRT_ddm_single (#95, #109).igt_orl for a wrong Matt trick operation
(#110).bandit4arm_2par_lapse, bandit4arm_lapse_decay
and bandit4arm_singleA_lapse.rstan...insensitive_data_columns.BUILD_ALL to
true before installation.hBayesDM_model function. You don’t have to change anything
to use them, but developers can easily implement new models now!bandit4arm2_kalman_filter; Daw et al., 2006) and a
probability weighting function for general description-based tasks
(dbdm_prob_weight; Erev et al., 2010; Hertwig et al., 2004;
Jessup et al., 2008).sv,
sv_fix, sv_var, and p_var.dd_hyperbolic_single and dd_cs_single).rewlos –> outcome for all models)adapt_delta is set to 0.95 to
reduce the potential for divergences.Initially released.