Changelog¶
0.5.1¶
This version includes the following changes:
-
full_ddmno longer discards the response times betweent - st/2andt(#1292; by @EItanm1999). The blackbox likelihood behindfull_ddm(hddm_wfpt) readsstas the full width of the non-decision-time distribution, so its support starts att - st/2, yet on 0.5.0 and earlier the log-likelihood was floored for every response in(t - st/2, t], biasingtdownward (profile maximum 0.36 against a true 0.40 in a 2000-trial example). Refit anyfull_ddmmodel whose fastest response times fall withinst/2belowt. -
A likelihood can declare where its response-time support starts (#1292; the configurable edge was proposed by @EItanm1999 in #1344, which this supersedes). The optional
"ndt_edge_shift": {"param": "<name>", "scale": s}entry (thehssm._types.NDTEdgeShiftTypedDict) places the floor att - s * param; it is accepted in aregister_modellikelihood dict, as amodel_configoverride onHSSM(...), and asmake_distribution(ndt_edge_shift=...).full_ddmdeclares{"param": "st", "scale": 0.5}; a likelihood without the key keeps the floor att, and a model withoutthas no floor. See Declaring where the response-time support starts. -
RLSSM decision processes carry the same declaration (#1358).
register_ssm(..., ndt_edge_shift=...)stores it with the decision-process spec,RLSSMConfig.ndt_edge_shiftpicks it up from there (as well as from aModelConfigdecision process, and, when the config is built from anssm-simulatorspreset, from the spec of the decision process the preset names), andRLSSMforwards it to the RL likelihood. -
Default initial values that fall outside a parameter's bounds are clamped into them (#1293; by @EItanm1999). A default start outside the declared
boundspreviously gave aNaNstarting point (100% divergences undernumpyro, "Bad initial energy" under PyMC) for boundedUniformpriors, bounded safeInterceptpriors on identity-link regressions, and models whosetbounds start above 0.025; such defaults are now moved just inside the bounds, logged atINFOwith a pointer tosample(initvals=...). Initial values you supply yourself are used as given, and a regression with alogorgen_logitlink keeps its link-scale default. -
Documentation: how bounds act on an identity-link regression (#1343; by @EItanm1999). The
link_settingsdocstrings,RegressionParam.validateand the priors how-to now say that a bounded parameter used in a regression with the identity link does not have its bounds built into the parameterization: a draw that puts any observation's value outside them is penalised by the likelihood (apply_param_bounds_to_loglik) rather than mapped back inside, which is usually harmless when the parameter sits well inside its bounds, and that"log_logit"composes the regression on the link scale instead. The runtime warning proposed in that PR was not adopted. -
The
p_outlierregression and random-slope tutorials execute again (#1366, closes #1363). Both had failed at model construction since the 0.5.0 safe-prior guards.tutorial_p_outlier_regressionnow givesvthegen_logitlink throughlink_settings="log_logit", since the guard refuses an unbounded identity-scale default for a group-only intercept on a bounded parameter;random_slope_safe_priorsnow shows HSSM rejecting the legacy free-mean group priors undernoncentered=Trueinstead of building that graph, and keeps every other comparison. -
A JAX version of the analytical DDM likelihood (#1421, towards #1420).
hssm.likelihoods.logp_ddm_jaxportslogp_ddm(Navarro & Fuss, 2009) to JAX with the same parameterization, response coding, series switch and lower bound. Tests pin it tologp_ddm(per-trial difference at most 1e-10 in float64, including the floor and response times belowt) and keep its float32 gradients finite. The DDM'sanalyticalentry declares it as itsjax_loglik, which is how RLSSM uses the analytical DDM (next item). -
RLSSM can use the analytical DDM (#1422, towards #1420).
hssm.rl.RLSSM(data, model="2AB_RW_DDM", decision_process_loglik_kind="analytical")fits thessm-simulatorsRescorla–Wagner preset with the exact DDM likelihood (logp_ddm_jax, #1421) instead of its LAN, and does not load the network.get_rlssm_model_config,RLSSMConfig.from_ssms_modelandregister_rlssm_modeltake the same argument, and the LAN stays the default. A likelihood entry declares its JAX implementation under the new optionaljax_loglikkey, as the DDM'sanalyticalentry now does; plainhssm.HSSMstill evaluatesloglik. Behaviour change:decision_process_loglik_kindused to be a label only."analytical"now switches the likelihood, a decision process without a JAX implementation of the requested kind (e.g.anglewith"analytical") raises,RLSSM(model_config=..., decision_process_loglik_kind=...)raises when the two disagree, and any kind other than"analytical","approx_differentiable"or"blackbox"is rejected (register_rlssm_modelused to store any string). -
Documentation: using the analytical DDM in an RLSSM (#1423, towards #1420). A new how-to fits a simulated two-armed bandit with
decision_process_loglik_kind="analytical", compares the fit with the LAN, and checkslogp_ddm_jaxagainstlogp_ddm. See Use the analytical DDM in an RLSSM. -
The HSSM-side two-armed-bandit learner handles
-1/1responses (#1419, closes #1418).hssm.rl.likelihoods.two_armed_bandit.compute_v_subject_wiseand its copy inhssm.likelihoods.rldm_optimizedused the response as the arm index, so with-1/1responses JAX wrapped-1to arm 1 and every trial updated arm 1, silently giving wrong drifts. The response now maps to armresponse > 0. Data coded 0/1 and thessms.rlpresets (2AB_RW_DDM, ...) were not affected; refit any custom RLSSM that used this learner with-1/1responses. -
lba2,lba3andlba4start sampling at a valid point (closes #1426). Their default start wasA = 2.0,b = 1.2, where the likelihood'sb > Acheck fails, so withp_outlier=Noneor0the PyMC sampler stopped with "Bad initial energy" and numpyro chains froze in place (r̂ above 3 on simulatedlba4data); under the default lapse the LBA term contributed no gradient at the start. Each config now declaresA's default prior, unchanged atHalfNormal(sigma=2), withinitval=0.5. Priors you supply forAreplace this default as before. -
Opt-in MLflow tracking of fits:
hssm.track()(new modulehssm.tracking, optional extrahssm[tracking]). Wrapping a workflow inwith hssm.track(experiment=..., run_name=...):recordsHSSM(...),sample()/vi()andsave_model()as one MLflow run following the HSSM-ecosystem run schema (phase=infer): model, likelihood kind, network file and its HuggingFace commit (and the missing-data network's, undermissing_data_network_file/missing_data_hf_revision), sampler settings,n_trials/n_subjects, aspec_sha256of the model specification and adata_sha256of the data; metricssampling_seconds,divergences,r_hat_max,ess_bulk_min,ess_tail_min; artifactsmodel_spec.json,summary.csv,traces.nc,data.parquet— the fitted data, covariates included (andmodel.pklwithlog_artifacts="all"). Record your own variables withparams=orrun.log_param(...)so runs can be compared on the dimensions you are varying.dataset_name=registers the observed data as an MLflow dataset, filling the run's Datasets panel with its schema and row count. Variational fits addmethod,niter,backend,vi_seconds,elbo_final/elbo_maxandvi_traces.nc. With nothing configured, runs go to a localmlflow.db. Thelineage_idthat ssm-simulators and LANfactory attach to training data and published networks is read from the repository'smanifest.json, so one query lists every fit built on a dataset. Off by default; nothing changes for users who do not calltrack(). Failures while recording a fit are logged, never raised; an unreachable tracking server raises when the block opens, before the fit starts. See the "Track fits with MLflow" how-to. -
Rebuild a tracked fit:
hssm.load_run(run_id). Reconstructs anHSSMmodel from a run'smodel_spec.jsonanddata.parquetand restores itstraces.nc/vi_traces.nc. Hugging Face networks, including a missing-data network, are fetched at the revision the run recorded, even when the working directory holds a file of the same name. Runs now carrymodel_class,spec_restorableandrebuild_artifactstags (the last set oncedata.parquetandmodel_spec.jsonare stored, sohssm.list_runsneeds no extra request per run);spec_restorable=falsemarks runs whose spec holds arguments recorded as text (bmb.PriororLinkobjects, custom functions), whichload_runrefuses with a clear error. -
List tracked fits:
hssm.list_runs(). Returns a DataFrame of the runs recorded byhssm.track, newest first, withrun_id,run_name,experiment,start_time,status,user,model,loglik_kind,dataset_name(from a newdataset_nametag, so inputs you log yourself are not mistaken for it),n_trialsandrestorable(whetherhssm.load_runcan rebuild the run). Runs logged by other tools on the same server are left out. -
RLSSM can use the LBA (towards #1420).
lba2,lba3andlba4declare a JAX likelihood (jax_loglik):hssm.likelihoods.analytical.logp_lba_jax, thelba4JAX code generalised to any number of accumulators. Anssms.rl.ModelConfigwithdecision_process="lba3"and theRescorlaWagnerRaceDriftslearner then fits throughRLSSMConfig.from_ssms_model(..., decision_process_loglik_kind="analytical");ssm-simulatorshas no Rescorla–Wagner + LBA preset yet (see Use the analytical DDM in an RLSSM). RLSSM now starts each non-regression parameter at the config'sparams_default(forssm-simulatorspresets, the simulator's defaults) instead of its prior's midpoint, unless you specify its prior or HSSM's shared defaults set its start (a,t,v,p_outlier). The midpoint start putAandbboth at 0.5, where the LBA'sb > Acheck fails; for the existing presets it movesrl_alpha,scaler,thetaand the softmaxbetato thessm-simulatorsdefaults. The PyTensorlba2andlba3likelihoods computed their normal CDF with a float32sqrt(2)even under float64, an error of up to about 3e-7 in log p; they now agree withlogp_lba_jaxto 1e-10, which thejax_loglikparity test checks. New tests check the model's log-likelihood against a NumPy learner for 2, 3 and 4 choices, and parameter recovery for 3 choices. -
plot_quantile_probabilitywith ellipses no longer fails on other legend entries or cuts off ellipses (closes #1430, closes #1431). Withpredictive_style="ellipse"or"both", the ellipse colours were read from every legend entry in the axes, so drawing into axes that already held, for example, the bands ofplot_predictive(whichplt.gca()returns right after aplot_predictivecall in a script or marimo) failed withAttributeError: 'FillBetweenPolyCollection' object has no attribute 'get_color'; only lines are read now. The ellipses were also added without rescaling the view, which stayed fitted to the observed quantiles and cut off ellipses reaching beyond them; the view now includes them, and axis limits you set before the call are kept. -
The lapse mixture no longer drops the lapse mass on missing-RT and omission rows (closes #1322). The lapse mixture evaluated the lapse RT density at the
-999.0placeholder of every missing-RT and deadline row, so the defaultUniform(0, 20)lapse contributed-inf(no lapse mass at all) and other lapse priors contributed a meaningless finite value, biasingp_outlierand the SSM parameters whenever such rows were present. The lapse term is now marginalised like the SSM term: observed rows keep the lapse density atrt, missing-RT rows (choice observed, no deadline) use1 / n_choices, and omission rows use the lapse survival probability at the deadline,1 - CDF_lapse(deadline). Lapse priors without a PyMClogcdfnow raise a clear error on deadline data. The missing1 / n_choicesfactor on observed rows is tracked separately in #1323. Refit any model with a lapse (p_outlier, 0.05 by default) whose data has missing-RT or deadline rows. -
Documentation:
compile_logp()returns the log-posterior;distribution_utilsAPI page fixed (closes #1436).HSSM.compile_logp()compiles the model's log-prior plus log-likelihood, plus any Bambipotentials(the unnormalized log-posterior), as a function of natural-scale parameter values, not the log-likelihood alone; the tutorial, renamed "Compile a log-posterior function", and the method's docstring now say so. It also givespip install zeus-mcmcforzeus:hssm[notebook]installs nozeus, sincenotebookis a dependency group, not an extra. Thedistribution_utilsAPI page now listsmake_hssm_rvin place of the nonexistentmake_ssm_rv, and addsmake_distribution_for_supported_model. -
Choice-only softmax models simulate, and their lapse likelihood is fixed (#1416, closes #925, refs #1323; by @digicosmos86).
softmax_inv_temperature_2,_3and the newsoftmax_inv_temperature_4now supportsimulate_data,sample_prior_predictiveandsample_posterior_predictivethrough thessm-simulatorsmodels of the same name (ssm-simulators>=0.16.0). Predictive draws contain the response only. On 0.3.0–0.5.0, choice-onlyHSSMmodels withp_outlier(on by default, 0.05) usedexp(1 / n_choices)instead of1 / n_choicesas the lapse likelihood, which overstatedbeta * logit(by about 17% for a 0.8/0.2 choice split); refit such models.RLSSMwas not affected. -
Posterior predictive sampling works when
p_outlieris the only trial-wise parameter (#1416). With ap_outlierregression and every other parameter intercept-only,sample_posterior_predictivefailed for every model (cannot reshape array of size ... into shape (1, 5, 1)); the other parameters are now broadcast top_outlier's shape before simulating. A regression on any other parameter avoided the error. -
Documentation: the choice-only tutorial simulates with
simulate_dataand checks predictions (#1491, closes #1490). The tutorial now simulates its data withhssm.simulate_datainstead of a hand-written simulator, explains the placeholderrtcolumn (-1.0) that choice-only simulations return, and adds a prior and posterior predictive check of choice frequencies. It has been migrated to marimo (docs/tutorials/choice_only_models.py), and its outputs no longer show the old dummy-simulator warning. -
The
ddmandddm_sdvLAN bounds no longer reach outside the networks' training ranges (closes #1440). A LAN is valid only inside the parameter range it was trained on; outside it, it returns a finite but wrong density. Theapprox_differentiableddmconfig allowedzin(0.0, 1.0), whileddm.onnxwas trained on[0.1, 0.9], andddm_sdvlettandsvstart at 0.0, while its network was trained from 0.001. The bounds are nowz(0.1, 0.9)forddm, andt(0.001, 2.0)andsv(0.001, 2.5)forddm_sdv. With these likelihoods, the defaultzprior becomesUniform(0.1, 0.9)and the defaultsvpriorUniform(0.001, 2.5); parameter values outside the bounds hit the likelihood floor;link_settings="log_logit"mapszinto(0.1, 0.9); and RLSSM decision processes that HSSM builds from these model configs inherit the new bounds.RLSSMConfig.from_ssms_model()takes its bounds from the ssms preset instead, so this change does not affect it; ssms'2AB_RW_DDMalready declaresz(0.1, 0.9). Fixingsv=0.0(ort=0.0) with theddm_sdvLAN now raises aValueError; for zero drift variability usemodel="ddm". The analytical and blackbox likelihoods are unchanged. An audit of every other built-in LAN config found its bounds equal to the training range;test_lan_bounds_match_trainingnow enforces this with no exceptions and no rounding of the lower edge. Refit anyddmLAN model whosezposterior had mass below 0.1 or above 0.9. -
Documentation: the site uses the shared HSSM design-system theme (#1501, closes #1500). The docs now match the HSSM website: an indigo header, a navy dark mode, IBM Plex Sans and Mono (self-hosted, so pages no longer request Google Fonts), the design system's code colours in code blocks and notebook cells, and plots on a white card in dark mode. The theme is vendored from HSSMSpine's
docs-brand/bundle;mkdocs.ymlnow starts from its shared base (INHERIT: docs/overrides/.mkdocs-brand.yml), which owns the palette, fonts, logo and stylesheets. The home page shows the on-dark HSSM logo in dark mode. -
set_floatX("float32")keeps JAX matrix multiplications at full float32 on GPUs (closes #1463). JAX's default runs float32 matrix multiplications as TF32 (a 10-bit mantissa) on NVIDIA GPUs from Ampere on, so a LAN likelihood was computed below float32 precision: foranglewith 10,000 trials, the log-likelihood at the initial point was off by about 1.3e-3 per trial, and 3 of 4 NumPyro fits failed to converge (R-hat 1.6–9.7).set_floatX("float32")now also setsjax_default_matmul_precisionto"highest", unless you have already chosen a precision (JAX_DEFAULT_MATMUL_PRECISIONorjax.config.update). Full float32 costs speed: on one RTX A5000, a LAN log-likelihood and its gradient on 10,000 or more trials took about 1.3x as long as under TF32, and data-center GPUs (A100, H100) can lose more. SetJAX_DEFAULT_MATMUL_PRECISION=tensorfloat32before importing JAX to keep TF32. CPUs and older GPUs are not affected. -
set_floatXreaches every graph and PyMC's worker processes (closes #1464). Three things kept a float32 model partly in float64, and a fourth broke the DDM's gradient once the graph really was float32. (1) Constants HSSM created at import upcast theddm,ddm_sdv,angleandlba2graphs built afterset_floatX("float32"):LOGP_LBand the DDM's π and τ terms were typed with thefloatXof import time (float64 by default), and the LBA's √2 came fromnp.sqrt, which is always float64. They are Python floats now and take the graph's dtype. (2) The default lapse's log-density entered the graph as a float64 constant; it is now infloatX. (3) PyMC's chains under thespawnorforkserverstart method (the default on Linux from Python 3.14, on Intel macOS and on Windows) run in fresh interpreters that imported PyTensor at float64 and turned JAX's x64 back on, so an RLSSM fit at float32 failed withunexpected JAX type ... for argument to VJP function.set_floatXnow also writesfloatXintoPYTENSOR_FLAGS, keeping your other flags, and JAX's matmul precision intoJAX_DEFAULT_MATMUL_PRECISION, so worker processes started afterwards use the same precision. Call it before the first multi-process fit of a session: a forkserver that is already running keeps the environment it started with. (4) In float32, the DDM's fast-time series (ddm,ddm_sdv) gave NaN gradients foraandtwhen a response time was within a few milliseconds abovet: the density underflowed to theLOGP_LBfloor, and dividing by its 1/√(2π t³) normalization overflowed. The normalization now goes into the exponent, as in the JAX likelihood; float64 values and gradients change by less than 1e-13. Under float64, the DDM'slog 4term, which waspt.logof an integer and so always float32, is now float64. A regression on any predictor (v ~ 1 + xas well as a categorical one) still carries Bambi's float64 design matrix as a graph constant; the log density still comes out float32. -
plot_quantile_probabilitystays readable when conditions have similar accuracy (closes #1488). The observed markers had seaborn's white edge, which cut each quantile line around its markers; where two conditions sit at nearly the same proportion (LLandWWincavanagh_theta), the short step between them vanished under two touching markers and one line read as three. Markers are now drawn without an edge;data_kwargs={"markeredgewidth": ...}(ormew) still sets one. The condition labels on the top axis overlapped for the same conditions; a label that would overlap its left neighbour now sits one row higher. -
plot_quantile_probabilityshows five quantiles by default (closes #1474). The defaultq=5was turned intonp.linspace(0, 1, 5)without its ends, so the plot showed three quantiles (0.25, 0.5, 0.75). The default is now(0.1, 0.3, 0.5, 0.7, 0.9), the quantiles conventionally shown in quantile-probability plots. An integerqkeeps its meaning; passq=5for the previous plot. -
Posterior predictive draws can be seeded (closes #1473).
sample_posterior_predictivetakesrandom_seed(anintor anumpy.random.Generator) and passes it to bambi'spredict; in safe mode each chunk of draws gets its own seed spawned from it.plot_predictiveandplot_quantile_probabilitytakerandom_seedtoo: it picks the posterior draws they use and, when they sample the posterior predictive themselves, the simulated responses, so a seeded plot is the same on every run. Without a seed nothing changes. -
A formula that uses a data column named like a model parameter now fails with a clear error (closes #1471). For example,
cavanagh_theta'sthetacolumn in an angle-family model, which has athetaparameter:a ~ 1 + thetafailed later withVariable name a_theta already exists, and with another regression in the model it built without any message. HSSM now raises aValueErrorat construction that names the column and suggests renaming it. -
sample_dosimulates the intercepts it is given (closes #1470). With bambi's defaultcenter_predictors=True, the PyMC intercept of a regression with common predictors belongs to the centered design, while posteriors report it on the original scale, sosample_do(params={"v_Intercept": b0, "v_x": b1})simulated an intercept ofb0 - b1 * mean(x).sample_donow converts each fixed intercept to the centered design when all of that parameter's slopes are fixed too (and warns when they are not), soparamsmeans what the posterior reports. Behaviour change: simulations from such models change; refit any recovery study built on them.sample_doalso gainsstrict=True, which raises when a free variable is not inparamsinstead of drawing it from its prior, and a full docstring. The hierarchical-regression tutorial, whose stated intercept of 0.0 was simulated as about -0.4, is re-executed. -
Free random variables no longer depend on Python's string-hash seed (#1493, closes #1492). bambi collects a family's auxiliary parameters in a set. So in a model with two or more free non-parent parameters without a formula (
a,zandtin the default DDM, or the logits ofsoftmax_inv_temperature_3and_4), the order of the free random variables, and with it the draws ofsample(random_seed=...), depended on the per-process string-hash seed (PYTHONHASHSEED). HSSM's families now keep the order oflist_params, so a seeded fit of such a model from an earlier version cannot be reproduced draw for draw. -
Default intercept priors on bounded parameters are scaled to the bounds (towards #1472). With
prior_settings="safe"and an identity link, a regression intercept on a parameter with finite bounds gotNormal(mean(bounds), 0.25), truncated to the bounds; the SD is now a quarter of the bounds' width. For LAN models the bounds are the network's training range, so the old prior pulled typical values toward its middle:angle_extended'sv_Interceptprior wasNormal(0, 0.25), and a hierarchical fit recovered a group drift of 0.86 against a true 1.00. Behaviour change: default intercept priors are nowNormal(0, 1.5)forvinangle(Normal(0, 3)inangle_extended),Normal(1.65, 0.675)fora,Normal(0.5, 0.2)forz,Normal(1.0005, 0.5)fortandNormal(0.6, 0.35)fortheta. The analyticalddm(HDDM-based priors), slopes and priors you set yourself are unchanged. The prior follows the bounds, so a parameter whose bounds are much wider than its plausible values, as can happen in a custom model, gets a nearly flat intercept prior: give it an explicitprior. A parameter with finite bounds and no regression already gets aUniformover them by default. -
sample(random_seed=...)is reproducible across processes for models with group terms (closes #1494). When it builds a model, HSSM jitters the default start of every vector parameter by up toinitval_jitter(0.01), and it drew that jitter from NumPy's unseeded global generator, whichrandom_seeddoes not control. A model with a group term, such asv ~ 1 + x + (1|subject), therefore started from a different point, and gave a different posterior, in every new process. The jitter now comes from a generator with a fixed seed, somodel.initvalsis the same in every process;initval_jitterkeeps its meaning, andsample(initvals=...)still overrides the start. With #1493 (item 31), seeded fits of such models now reproduce across processes once PyTensor's cache of compiled code is filled. The first fit of a new model can still differ from later ones, with or without group terms (seen with the analytical DDM on the PyMC sampler): PyTensor's numba backend compiles with fast-math, and newly compiled code rounds differently from the cached code that later fits load. SetPYTENSOR_FLAGS=numba__fastmath=Falsewhen fits must match exactly. -
Models registered in ssm-simulators work by name (closes #1467).
hssm.simulate_dataandHSSM(model=...)looked models up inssms.config.model_config, a snapshot taken whenssmsis imported, so a model registered withssms.config.register_model_configwas rejected bysimulate_dataand got none of its configuration inHSSM. Both now resolve the name through the ssm-simulators model registry. For a model HSSM does not ship but ssm-simulators knows,HSSMtakeslist_params,bounds(from itsparam_bounds, the training range of a LAN trained on it),choicesandndt_edge_shift(declared where the simulator's response times start belowt, as forfull_ddm_rv) from the ssm-simulators config unlessmodel_configsets them (or, forchoices, thechoicesargument). This includes ssm-simulators built-ins that HSSM does not ship, which previously took onlychoicesfrom there. A bound that ssm-simulators gives as another parameter's name (full_ddm_rvboundsstbyt) has no HSSM form, so that parameter gets no bound from ssm-simulators. Withloglik_kind="approx_differentiable", aloglikgiven as an ONNX path or file name now defaultsbackendto"jax", as the docstring stated, instead of raising. A registered model with its own network is thenhssm.HSSM(data, model="name", loglik="net.onnx", loglik_kind="approx_differentiable"). Lapse responses in predictive samples of a registered model are drawn from its own choices; ssm-simulators up to 0.16.0 reports[0, 1, 2]for it. The "not supported" warning ssm-simulators logs for such a model when HSSM builds its simulator is fixed in ssm-simulators (lnccbrown/ssm-simulators#427). -
Faceted plots no longer draw the figure title over the facet titles (closes #1513). With
col,roworcol_wrap,plot_predictiveandplot_model_cartoonplaced the figure title at a fixed fraction of the figure height, so at the default facet size (one row of facets, 3 inches high) "Posterior Predictive Distribution" was drawn over the facet titles;plot_quantile_probabilitydid the same at some facet heights. The title now sits above the facet titles at any figure height, and a tall grid no longer leaves a tenth of its height empty for it. A faceted figure with a title is laid out once more withtight_layoutafter its legend is added, so its margins change slightly;title=Noneis unaffected. -
Documentation: tutorials pass
simulate_dataonly the parameters of the simulated model (#1511, refs lnccbrown/ssm-simulators#424). The scenic-route tutorial (twice) and the archived PyMC to HSSM notebook calledhssm.simulate_data(model="ddm", ...)with athetadictionary that also held entries the DDM does not have:theta, and in the tutorial the known regression coefficientsv_x,v_yandv_Intercept, which later cells use as reference values. Until now, ssm-simulators dropped such keys without a message; its next release raises aValueErrorfor them. The calls now passv,a,zandtonly. The simulated data, and with them the published outputs, are unchanged. -
Each lapse row in a predictive sample gets its own lapse draw (closes #1507). The lapse simulation handed out its draws by row position instead of in order, so several lapse rows of one simulated dataset held the same response time and response.
sample_prior_predictiveandsample_dosimulate one dataset per call, and there about a third of the lapse rows repeated another lapse row: over 30 prior predictive draws of 400 trials, 556 lapse rows held 365 distinct lapse response times.sample_posterior_predictivesimulates its draws in batches, which repeated lapse draws only when a batch held fewer than about1 / p_outlierdraws (20 at the default 0.05), and then between draws rather than within one. A batch did draw as many times too many lapse values as it had draws, so the lapses of a batch of 200 draws of 1,000 trials now take 0.06 s instead of 11 s. Which rows lapse and the distribution of a single lapse draw were already correct; fitting and choice-only models are not affected. Seeded predictive samples change on their lapse rows, about a fractionp_outlierof all rows: the same rows lapse, but with other lapse response times and responses. All other rows are unchanged, also in later predictive calls that are given the samenumpy.random.Generator. -
log_likelihoodreads chains and draws by position, not by coordinate label (closes #1447).HSSM.log_likelihoodandRLSSM.log_likelihoodused thechainanddrawcoordinate values as array indices. A posterior with burn-in dropped or thinned (dt.isel(draw=slice(500, None))) raisedIndexError, and duplicate labels, as in two runs concatenated alongchain, raised nothing and left the affected draws at a log-likelihood of0.0. The output keeps the posterior's coordinates, and traces labelled0..n-1give identical values. Recompute any log-likelihood, and any LOO derived from it, obtained from a posterior with duplicate labels. -
missing_datafinds the missing rows wherever thertcolumn sits (closes #1449)._rearrange_datalooked for-999.0in the first column of the DataFrame instead of inrt, so with another column first (hssm.load_data("cavanagh_theta")starts withparticipant_id) the missing rows stayed in place andassemble_callables, which scores the firstn_missingrows with the missing-data network, scored the wrong rows without any warning (log-density -576.1 instead of -78.1 on a 40-trial example). Refit any model withmissing_data=True, with or withoutdeadline, whosertwas not the first column ofdata. A row whose nullablertispd.NAalso stays in the data instead of being dropped, so building the model raises an error about the incomplete row. -
Fixed-vector parameters stay with their rows when HSSM moves missing rows (closes #1451). With
missing_data=True(with or withoutdeadline), HSSM moves the rows withrt == -999.0to the top of the data, because the missing-data network scores the first rows. A parameter fixed to a vector (v=np.array(...), one value per row) kept the user's row order, so rows at or above the last missing row got another row's value; on an 8-row example the log-likelihood was off by 6.9. The vectors are now reordered with the rows. Models whose rows HSSM did not move are not affected; refit any other model with a fixed-vector parameter. -
The legacy RLDM likelihood gives its angle network
-1/1choices (closes #1399).hssm.likelihoods.rldm_optimized.make_rldm_logp_func(andmake_rldm_logp_op) passed the response column to the angle LAN unchanged, so data coded 0/1 reached the network with choice0, outside the-1/1choices thatangle_configdeclares, and lower-boundary trials got a wrong log-likelihood (-6879.15 instead of -6618.57 summed over the test fixture, at the unit tests' parameters). The response now maps to choice-1/1(the positive response is the upper boundary) for the network, as it already did for the Q-value index (#1419), so 0/1 and-1/1data give the same likelihood;-1/1data were not affected since #1419. The docstring now states the[rt, response]column order, and the test values pinned from 0/1 choices, in this module's tests and in the RL likelihood-builder tests, are re-derived. A response other than-1,0or1, NaN included, gives a NaN log-likelihood, and data that do not have exactly the two columns[rt, response]raise aValueError. Nothing inhssmcalls this module; recompute any likelihood you evaluated with it on 0/1 data, and refit any model you fitted with it on such data. -
log_likelihoodrefuses Bambiconstrained(...),truncated(...)andcensored(...)responses (closes #1452). Bambi stores these responses as several columns: the observed values, then the bounds or the censoring status.hssm.utils.log_likelihoodread the extra columns as observations and raised a shapeValueError; for a constrained response withypassed, every draw returned the first draw's log-likelihood. HSSM models do not build these responses, so the function now raisesNotImplementedErrorfor them and no longer carries a copy of Bambi's handling. Bambi's owncompute_log_likelihoodhas the same defect (bambinos/bambi#1101). The function also reads the response throughModel.response_termwhere Bambi has it, which avoids the deprecation warning of Bambi 0.21.
Breaking changes that require migration:¶
-
Choice-only models accept only the uniform lapse (#1416). The lapse of a choice-only model,
RLSSMincluded, is1 / n_choices; any other number, dict orbmb.Priorpassed aslapsenow raisesValueError. On 0.5.0,RLSSMaccepted a scalar lapse in (0, 1], which does not sum to one over choices unless it equals1 / n_choices. Omitlapse. -
The
ddm_sdvLAN no longer acceptssv=0.0ort=0.0(#1440). Its bounds now start at 0.001, where its network's training range starts, so fixing either parameter at 0.0 raisesValueError. For zero drift variability, usemodel="ddm". Likewise, a fixedzoutside[0.1, 0.9]now raises with theddmLAN.
Dependency changes:¶
ssm-simulatorsfloor raised to>=0.16.0, the first release with thesoftmax_inv_temperature_{2,3,4}simulators (lnccbrown/ssm-simulators#421), which replace HSSM's own adapter (#1416).
0.5.0¶
This version includes the following changes:
-
plot_model_cartoondisplays posterior uncertainty as graded bands by default (#1124), adopting the sameuncertainty="band" | "samples" | "both" | Nonevocabulary asplot_predictive(#1122): pointwise quantile bands on the RT histograms, fan-chart ribbons on the decision bounds, a graded drift-quantile fan, graded non-decision-time spans (replacing the per-draw vertical-line smear), and a starting-point whisker.uncertainty=Nonereproduces the previous mean-only look; the default call now runs per-draw simulations (seconds). New parameters:hdi,alpha_mean,alpha_uncertainty,hist_height,legend;plot_predictive_mean/plot_predictive_samplesare deprecated with aFutureWarning. The previously documented-but-ignoredbins,step,colors,linestyles, andlinewidthsparameters now work. With uncertainty display on, the drawn mean is the pointwise predictive mean across draws (it cannot exit its own bands) rather than the plug-in simulation at the posterior-mean parameters. The figure uses a three-way color encoding — model geometry stays neutral black (color_model), predictions and data use the predictive palette. Note for regression/hierarchical models: the drawn geometry of each posterior draw derives from that draw's trial-mean parameter vector (see the correctness entry below). See the new "Model cartoon plot gallery" tutorial. -
plot_model_cartooncorrectness follow-up (#1125). Each posterior draw's geometry now derives from one coherent θ vector — the across-trials mean by default, or one trial via the newobs=parameter (which then conditions every simulated layer on that trial; the observed histogram stays pooled, with a warning). Newrandom_state=(int ornp.random.Generator) makes the whole figure reproducible: which posterior draws are displayed (previously chosen by the unseeded global RNG before any seed applied), every simulator seed, and the trajectories — facets consume successive segments of one stream. Geometry and trajectory simulations now receive amax_thorizon derived from the x-limits instead of the simulator's 20 s default (previously ~75% of every boundary polyline lay outside the axes); the noisy RT simulations deliberately keep the long horizon so defective densities are not silently re-normalized by censoring. Trajectories are noisy realizations of the reduced reference θ, so their crossing markers land on the drawn boundary by construction.n_trajectories,xlims, andylimsare promoted to documented parameters (None keeps each renderer's defaults). Bug fix: the >2-choice renderer simulated each draw's RT histogram withn_samples=1(silently ignoringn_reps) and one seed shared across draws, so its uncertainty bands summarized degenerate, noise-correlated histograms. Deliberate value changes for a fixedrandom_state: a new seeding protocol, trial-mean instead of trial-0 geometry for regression models (intercept-only models unaffected), and reference-θ trajectories. Documented caveat: geometry is nonlinear in θ, so the trial-mean curve is not the mean of per-trial curves and need not sit mid-band — the reduction is a display convention. -
plot_model_cartoonacceptshist_height="auto"(#1127): fits the tallest RT-histogram curve to 90% of the vertical headroom between the histogram baseline (ribbon-aware — expanding bounds are cleared too) and the upper y-limit, so histograms can never overrun the axes; resolves per facet. Its mirror image,ylims="auto", keeps the raw density scale and grows the frame around the content instead (never below the default limits; the two spellings are mutually exclusive). The defaults remain unchanged. The >2-choice renderer now also draws per-choice drift-uncertainty cones in band mode (graded fills in each accumulator's color; previously slope uncertainty appeared only as per-draw spaghetti in the samples display). -
Safe priors now zero-center matching group-specific effects (#1224). HSSM matches each Formulae group expression to an exact common-term counterpart and assigns the generated group deviation
mu=0. This removes disconnected group-mean variables under non-centering and the redundant common/group location under centering. Explicit priors are not rewritten, including Bambi'scommonandgroup_specificwildcards; parameterization diagnostics now describe the graph Bambi actually builds. Item 12 below adds compatibility validation and defines population-location ownership for unmatched group-only effects. -
hssm.Linknow constructs Bambi built-in and custom links (#1231). Standard links delegate correctly to Bambi, while HSSM's boundedgen_logitbehavior remains unchanged. -
Safe common-intercept priors now recognize every identity-link spelling consistently (#1232). An omitted link,
"identity",bambi.Link("identity"), andhssm.Link("identity")all retain response-scale priors, including HDDM-derived priors; transformed links use a coefficient-scaleNormal(mu=0, sigma=0.25). Item 12 below extends semantic identity handling to generated unmatched group-only intercepts and defines their transformed-link predictor-scale behavior. See Link functions and safe priors for the underlying model-design logic. -
Invalid model-level prior and link presets now fail fast (#1233).
prior_settingsaccepts only"safe"orNone, andlink_settingsaccepts only"log_logit"orNone; wrong-case strings, booleans, mappings, and other unsupported values now raise a clearValueErrorinstead of silently changing prior, link, initial-value, or display behavior. The API documentation now clarifies that both presets act on regression parameters:prior_settings=Nonedelegates missing regression-term priors to Bambi but leaves HSSM's simple-parameter defaults unchanged. The Poisson-race tutorial has also been migrated to marimo and no longer presentsprior_settingsas a prior dictionary. -
hssm.load_datanow returns apd.DataFrameunconditionally (#1146). Itsdatasetargument is required, and the return type is no longerpd.DataFrame | str, which forced type-checkers (and users) to narrow away astrbranch that existed only to print the dataset listing. Use the newhssm.list_data()to get the names of the built-in datasets as atuple[str, ...](mirroringhssm.list_models()). Breaking:hssm.load_data()with no argument now raisesTypeErrorinstead of returning a listing string. -
New built-in model:
gamma_drift(#1248) -- a drift-diffusion model whose drift is a constantvplus a gamma-shaped bump with signed peak amplitudec, its time course set byshapeandscale. This is the conflict-task (DMC-style) family: a negativecpulls evidence toward the wrong boundary early in the trial, then decays back to baseline. Parametersv, a, z, t, shape, scale, c. -
New built-in model:
gamma_drift_angle(#1296) --gamma_driftwith a linearly collapsing (angle) decision bound. Parametersv, a, z, t, theta, shape, scale, cin ssms registry order (thetaat index 4 -- the order is the ONNX input contract), bounds set to the network training box, and a registry cross-check test asserting both againstssm-simulators. The LAN artifact ships at the root offranklab/HSSM; its parameter-recovery report (published alongside) documents identifiability limits ofshape/scalewhen the collapsing bound truncates the drift bump -- see the model card on the Hub. -
New built-in model:
angle_extended(#1298) -- the angle model with drift bounds widened to (-6, 6) for designs producing strong evidence. Bounds and parameter order asserted against thessm-simulatorsregistry; the LAN passed a 240-fit parameter-recovery sweep with zero coverage or bias failures (report published beside the artifact). Raises thessm-simulatorsfloor to>=0.14.0, the first release containing the model. -
Safe priors now preserve a unique unmatched group-only population location and reject ambiguous or unrepresentable specifications (#1225). When HSSM generates a prior for a group term with no exact common Formulae counterpart, the group distribution owns the population location. HSSM therefore preserves its location-bearing hierarchy and centers that generated term even when the model or component requested non-centering, because Bambi's current non-centered construction omits
mu. For previously generated unmatched Normal terms under default non-centering, this intentionally changes the likelihood by reconnecting the location that Bambi had discarded. Exact common/group matches remain zero-mean deviations and honor the requested parameterization (#1224). Repeated unmatched expressions now fail when safe generation has no unique owner. Explicit priors are never rewritten, but HSSM raises before Bambi when a group prior cannot be represented faithfully and warns about buildable centered specifications with multiple free owners of one location. Identity-linked group-only intercepts retain their response-scale hierarchy for every identity spelling (#1232); transformed links use a hierarchy on the linear-predictor scale. For generic models, safe generation now fails closed when such an identity-linked intercept has finite response bounds, rather than inventing an unqualified unbounded hierarchy (#1269). Explicit priors remain authoritative, and exact/black-box HDDM likelihoods retain their calibrated natural-support hierarchies. Follow-ups cover upstream location-aware non-centering (#1268, Bambi #1003) and broader numeric regression-term semantics (#1271).
Breaking changes that require migration:¶
- Safe priors now refuse to invent a hierarchy for a bounded parameter (#1269). With the
default
prior_settings="safe", a group-only intercept — a formula with no matching common intercept, such asv ~ 0 + (1|subject)orv ~ -1 + (1|subject)— on an identity-linked parameter that carries any finite bound now raisesValueErrorinstead of silently generating an unbounded hierarchy. HSSM's generic group hierarchy is unbounded, so applying it to a bounded parameter through an identity link would place a response-scale default outside the parameter's support.
This affects every approx_differentiable (LAN) model, including existing ones such as
angle, weibull, levy and ornstein — not only models new in this release. Exact and
blackbox ddm, ddm_sdv and full_ddm keep the previous warning. The ordinary hierarchical
form v ~ 1 + (1|subject) is unaffected.
To migrate, pick one:
- keep a common intercept: v ~ 1 + (1|subject);
- use a support-respecting link, e.g. link_settings="log_logit";
- supply an explicit group prior for the term (or a group_specific wildcard) — note this
currently also requires noncentered=False for that parameter;
- set prior_settings=None and specify the complete prior policy yourself.
-
Explicit group-specific priors that bambi cannot represent faithfully now raise (#1225). Previously a logged warning, these are now an aggregated
ValueErrorraised before sampling. Under the default non-centered parameterization, an explicit group prior supplying amuhyperprior cannot be represented, because bambi buildsoffset * sigmaand dropsmu. Passnoncentered=Falsefor that parameter to keep the prior as written. -
ddm_sdv'sapprox_differentiablesvbound widened from(0.0, 1.0)to(0.0, 2.5)(#1230), matching the range the shipped network was actually trained on. The bound feeds default priors and initial values, so fits of existingddm_sdvmodels may differ from 0.4.0. -
hssm.load_data()now requires itsdatasetargument (#1146) and always returns apd.DataFrame. Use the newhssm.list_data()to list the built-in datasets.
Dependency changes:¶
ssm-simulatorsfloor raised to>=0.14.0— the first release containingangle_extended. 0.14.0 also fixesomission_p/choice_p_no_omission, which were computed against the wrong column and read as identically zero on deadline models.
0.4.0¶
This version contains major breaking updates for HSSM. Please read the release notes below to migrate to HSSM 0.4.0.
Major new features:¶
- A new
RLSSMclass has been added to support reinforcement learning sequential sampling models. - Attentional Drift Diffusion Model (aDDM): new
hssm.aDDMmodel (withaDDMConfig) built on a vendored, differentiable JAX first-passage-time likelihood. Supports per-trial fixation covariates (r1, r2, flag, sacc_array, d, sigma), trial-wise regression / hierarchical priors on the core parameters (eta, kappa, a, b, x0), a sampled non-decision timet, and posterior-predictive checks conditioned on the observed fixations (via the aDDM simulator in ssm-simulators). See the "Attentional DDM" tutorial andscripts/addm_parameter_recovery.pyfor an end-to-end recovery check. - Analytical four-choice LBA (LBA4), with a JAX likelihood enabling JAX/NumPyro-compatible sampling and gradients for the analytical LBA4 model.
- Per-parameter centered vs. non-centered parameterization. Pass
noncenteredtoHSSM(...)as adictkeyed by parameter name (e.g.noncentered={"v": False, "a": True}), or set a per-priornoncenteredfield on a group term's prior (dict orhssm.Prior) to override the model-level choice. Requires Bambi >= 0.19. See the "Per-parameter centered vs. non-centered parameterization" tutorial.
Breaking changes that require migration:¶
- Dependencies have been streamlined to support PyMC 6.0+, pytensor 3.0+, ArviZ 1.0+, and Bambi 0.19+.
- We added support for Python 3.14.
- Consistent with PyMC 6.0+ and ArviZ 1,0+ expectations, the
model.sample()by default usesnumbaas the compute backend. model.sample()now returns anxarray.DataTreeobject instead of thearviz.InferenceDataobject. Other functions that expectarviz.InferenceDataobjects have been updated to acceptxarray.DataTreeobjects.model.summary()andmodel.plot_trace()methods are now removed. Useaz.summary()andaz.plot_trace_dist()instead.- HSSM can now be installed directly from PyPI via
piporuv. Conda support is no longer provided.
Dependency changes:¶
bambifloor raised to>=0.19.0(per-parameter non-centered support);ssm-simulatorsfloor raised to>=0.13.1(aDDM engine + fixation continuation).
Bug fixes:¶
- Restore JAX-NUTS jitter control: HSSM again disables the built-in initial-value jitter of the
numpyro/blackjaxsamplers (PyMC 6 removed the public switch that made this possible), so sampling starts from HSSM's own controlledinitval_jitterinstead of an extra uniform jitter (#999). - Python 3.14: posterior/prior predictive sampling fixed. On 3.14, the dynamically created SSM random-variable class carried PEP 649 annotation metadata that numba's vendored cloudpickle could not serialize (
TypeError: cannot pickle '_abc._abc_data' object), breakingsample_posterior_predictiveand related plotting under the numba backend. The class attributes are now un-annotated plain assignments, and the previous 3.14 xfail markers on the predictive/plotting tests have been removed. model.vi(..., backend="jax")now works (#1056). PyMC 6 added abackendoption topm.fit(), whichHSSM.vi()forwards. Requestingbackend="jax"failed withNotImplementedError: No JAX conversion for the given Op: LANLogpVJPOp, because the operator that computes LAN likelihood gradients had no JAX translation. It now has one, and its gradients are tested to match the existing execution path exactly. Two remaining PyMC bugs (which breakpm.fit(backend="jax")for any model, HSSM or not; tracked in #1056) are worked around by scoped, self-disabling compatibility shims inhssm._vi_compat, applied only whenbackend="jax"is requested — they detect a fixed PyMC and become no-ops, and will be removed once the pinned PyMC includes the upstream fixes. Known limitation: models with a single free parameter dimension may still fail to compile; usebackend="c"there.- Fixed incorrect gradients for choice-only models with all-scalar parameters and outlier modeling. For likelihoods that take parameters only (CPN/OPN networks) with no regression parameters, the gradient computation ignored any transformation applied downstream of the likelihood — for example the
p_outliermixture. Gradient-based fitting (VI, or NUTS on the default backend) of such models silently used incorrect gradients. The gradient is now exact, and a regression test asserts the chain rule holds on every backend. - Internal cleanup of the LAN likelihood operators. The Op classes are now defined once at module level instead of once per model, so building many models in one long-running process (e.g. a parameter-recovery loop in a notebook) no longer grows PyTensor's dispatch registry — which previously kept every model's network weights in memory for the lifetime of the process. The gradient hook was also migrated from PyTensor's deprecated
gradto the newpullbackAPI, silencing aFutureWarningthat appeared on every model fit. - Documentation build fix for the marimo aDDM tutorial. The docs build now includes the marimo dependency needed to parse the aDDM marimo tutorial, and skips CI execution for its button-gated sampling cells.
0.3.1¶
This version includes the following changes:
- sbi NRE ONNX integration: train an sbi Neural Ratio Estimator (NRE), export it to ONNX via
lanfactory.onnx.transform_sbi_to_onnx, and load it into HSSM'sloglik_kind="approx_differentiable"pipeline for MCMC inference (keystone tutorialsbi_nre_integration.ipynb). - ONNX loader hardening:
onnx2jaxnow rejects ONNX graphs with dynamic/symbolic input dimensions (enforcing the single-trial +jax.vmapcontract), and raises a clear error when JAX x64 is disabled and a graph carries int64 constants that would be truncated (guarding against silent likelihood corruption from flow-export sentinels). Applies across all ONNX exporters (LANfactory, BayesFlow, sbi).
0.3.0¶
This version includes the following changes:
- Support for choice-only models: the HSSM class, data validator, distributions, and model configs now handle models without reaction times, including a softmax likelihood family.
- Racing Diffusion Model (RDM3): analytical likelihood, model configuration, and tests for a 3-choice RDM, with safe negative-RT handling and JAX backend support.
- Poisson Race model: initial implementation of the Poisson race model.
- Hidden Markov Model (HMM-SSM) example notebook.
- BayesFlow LRE integration through HSSM for likelihood ratio estimation.
- RLSSM config system: new
RLSSMConfigandBaseModelConfigclasses with comprehensive validation, plus a generalized RL likelihood builder supporting multiple computed parameters. - New tutorials: choice-only modeling, first HMM-SSM example, and updated existing tutorials.
DataValidatorrefactored toDataValidatorMixinfor improved extensibility.- Bug fixes: default prior assignment, dimensionality errors with Bambi 0.17.0, negative-RT checks on missing data, flaky tests.
- Infrastructure: Python 3.13 support, restructured CI test workflows with coverage reporting, updated
model.sample()API to match Bambi conventions.
0.2.12¶
This version includes the following changes:
- Compatibility with Python 3.13 and Bambi 0.17.1+.
- A new
make_distribution_for_supported_modelconvenience function for creatingpm.Distribution. - Bug fix for default prior assignment.
- Initial private implementations of RLSSM features.
- Added disaggregation of quantile computation by grouping of choice.
0.2.11¶
This version include the following:
- Simplification of simulator logic inside HSSM random variables (see the
ssm-simulators0.11.3release as well) - Plotting functions now allow
prior_predictiveplots wherever suitable. - A new tutorial on using bayeux for sampling
- Consolidated
plottingtutorial - New tutorial on how to use the
do-operatorfrom PyMC to control forward simulations
0.2.8¶
This version of HSSM incorporated the following changes:
- Addition of tutorials for RLSSM paradigms.
- Restructure
rldm.pyto make it more template-based to allow easy introduction of new models.
0.2.7¶
This version of HSSM incorporated the following changes:
- Bugfix in
mkdocs.yml. No tutorial notebooks should be actively executed when re-building docs.
0.2.6¶
This version of HSSM incorporated the following changes:
- Overhaul of our development infrastructure to depend on
uv - Addition of various new tutorials (highlight: how to fit RL+SSM models)
- New
rldmlikelihoods - Major internal refactor (e.g.
DataValidatorclass for pre-processing)
0.2.5¶
This version of HSSM incorporated the following changes:
- We added a new tutorial on how to use custom likelihood functions with HSSM.
- Added convenience function
compile_logp()to return a compiled log-likelihood function to be used freely downstream. - Some improvements to internals to allow for (1.)
- Major improvments to plotting with
model_cartoon_plots() - Refactoring and minor improvements to pre-existing plots
- Added functionality to save and load models with
save_model()andload_model().
0.2.4¶
This version of HSSM incorporated the following changes:
- We updated HSSM to be compatible with the major API changes in
bambiv0.14.0. - We fixed various graphing issues in
pymc5.16.0+, thanks to the API changes inbambi. - We added variational inference via native
pymc. - We can now use
float64inference. - We fixed some minor bugs in providing initial values.
- We added a model.dic() convenience function.
- We added a model.restore_traces() convenience function.
- Other minor bug fixes.
0.2.3¶
This is a maintenance release of HSSM, mainly to add a version constraint on bambi in light of the many breaking changes that version 0.1.4 introduces. This version also improved compatibility with PyMC>=5.15 and incorporated minor bug fixes:
- We incorporated a temporary fix to graphing which broke after
PyMC>=5.15. - We deprecated
ndimandndim_suppdefinition inSSMRandomVariableinPyMC>-5.16. - We fixed a bug that prevents new traces from being returned if
model.sample()is called again.
0.2.2¶
HSSM is now on Conda! We now recommend installing HSSM through conda install -c conda-forge hssm. For advanced users, we also support installing the GPU version of JAX through pip install hssm[cuda12].
This version incorporates various bug fixes:
- We fixed a major bug that causes divergences for models using
approx_differentiableandblackboxlikelihoods. We are still looking into the issues of divergence withanalyticallikelihoods. - We made the model creation process more robust, fixing errors when categorical variables are used with group identifiers.
- We updated the codebase according to the deprecations in higher versions of JAX.
- We implemented a temporary fix to an issue that might cause the kernel to die due to OOM.
0.2.1¶
We added a few new features in 0.2.1:
- We have finished updating the HSSM code base to support go-nogo data and deadline. We will provide documentation once the networks are added to our huggingface repo.
- We updated
hssm.distribution_utilsto streamline the creation ofpm.Distributions. - We now support response variables other than
rtandresponse. They can be specified throughmodel_configvia the newresponsefield. - We have fixed some of the issues with convergence when using
log-logitlink functions and/or safe priors.
Other minor updates
- Fixed an incompatible shape error during posterior predictive sampling when
p_outlieris estimated as a parameter. - Updated documentation for using
make_distributionwith PyMC.
Bug fixes:
- Fixed default list of parameters for
ddm_fullmodel and the bounds forddm_sdvmodel.
0.2.0¶
This is a major version update! Many changes have taken place in this version:
Breaking changes¶
When hierarchical argument of hssm.HSSM is set to True, HSSM will look into the
data provided for the participant_id field. If it does not exist, an error will
be thrown.
New features¶
-
Added
link_settingsandprior_settingsarguments tohssm.HSSM, which allows HSSM to use intelligent default priors and link functions for complex hierarchical models. -
Added an
hssm.plottingsubmodule withplot_predictive()andplot_quantile_probabilityfor creating posterior predictive plots and quantile probability plots. -
Added an
extra_fieldsargument tohssm.HSSMto pass additional data to the likelihood function computation. -
Limited
PyMC,pytensor,numpy, andjaxdependency versions for compatibility.
0.1.x¶
0.1.5¶
We fixed the errors in v0.1.4. Sorry for the convenience! If you have accidentally downloaded v0.1.4, please make sure that you update hssm to the current version.
- We made Cython dependencies of this package available via pypi. We have also built wheels for (almost) all platforms so there is no need to build these Cython dependencies.
0.1.4¶
- Added support of
blackboxlikelihoods forddmandddm_sdvmodels. - Added support for
full_ddmmodels viablackboxlikelihoods. - Added the ability to use
hssm.Paramandhssm.Priorto specify model parameters. - Added support for non-parameter fields to be involved in the computation of likelihoods.
- Major refactor of the code to improve readability and maintainability.
- Fixed a bug in model.sample_posterior_predictive().
0.1.3¶
- Added the ability to specify
infs in bounds. - Fixed an issue where
nuts_numpyrosampler fails with regression and lapse distribution. - Defaults to
nuts_numpyrosampler withapprox_differentiablelikelihoods andjaxbackend. - Added a
hssm.show_defaults()convenience function to print out default configs. - Added default
blackboxlikelihoods forddmandddm_sdvmodels. - Various under-the-hood documentation improvements.
0.1.2¶
- Improved numerical stability of
analyticallikelihoods. - Added the ability to handle lapse distributions.
- Added the ability to perform prior predictive sampling.
- Improved model information output - now default priors provided by
bambiis also printed. - Added a
hierarchicalswitch which turns all parameters into hierarchical whenparticipant_idis provided in data. -
Parameters are now named more consistently (group-specific terms are now aliased correctly).
-
Fixed a bug where information about which parameter is regression is incorrectly passed.
- Added links to Colab to try out hssm in Google Colab.
0.1.1¶
- Handle
floattypes inPyTensorandJAXmore consistently and explicitly. - Updated model output format to include likelihood kinds and display bounds more consistently.
- Support for
infs in bounds. - Convenient method for simulating data with
ssm_simulators. - More test coverage.
- CI workflows for publishing package to PyPI.
- Enhancement to documentations.