Skip to content

0.3.6

Latest

Choose a tag to compare

@DominiqueMakowski DominiqueMakowski released this 28 Nov 09:06
00b5daf

First CRAN update since 0.3.3. It includes the development versions 0.3.4 and 0.3.5, which did not go to CRAN on their own. Full details are in NEWS.md.

Highlights

  • A faster and more accurate DDM. When sigmabias and sigmandt are fixed at 0, cogmod_ddm() no longer calls Stan's wiener_lpdf(). Its Stan likelihood is now the Navarro and Fuss (2009) series that dcogmod_ddm() already used. With sigmadrift estimated it costs 0.29x what it did per gradient in CmdStan. The classic model, with all three variabilities at 0, got cheaper in two steps: 0.77x per gradient in 0.3.5, then 0.86x of that in 0.3.6. Stan's 5-parameter form was off by up to a log unit per trial in the tails. The new density agrees with an independent reference to about 1e-11, so log_lik(), loo() and p_outlier() now score each trial by the density the model was fitted with.
  • Warm starts across backends. cogmod_warmstart() now reads fits from brms's new stanli backend (in brms's development version). A pilot fitted with cmdstanr or stanli can warm-start a fit with either, and cogmod_inv_metric() and cogmod_step_size() work with both.
  • LBA fixes. cogmod_lba2()'s density could be NaN, which Stan counts as a divergent transition. The LBA densities no longer drop to -Inf where they are merely small, which had handed slow responses to the outlier component. Their gradients are now exact in the tails, at the same cost per gradient. cogmod_lba1() gets the same fixes.
  • New article, Comparison with Other Packages, setting cogmod beside brms's native families and bmm.

Breaking changes: default priors

cogmod_priors() returns different priors in these cases, so a model refitted under 0.3.6 is not the model it was under 0.3.3:

  • poutlier is centred at 0.25% instead of 0.7%: normal(-6, 1) on the logit link, or exponential(280) when it is left out of bf(). This affects every family with an outlier component.
  • boundary gets a prior in cogmod_ddm(), cogmod_invgaussian(), cogmod_exwald() and cogmod_bisa(), where brms left it flat (an improper prior on a softplus link). Its slopes get normal(0, 0.5) and its group-level SDs exponential(1). The DDM's bias gets the same on its slopes and group-level SDs.
  • Smooth terms. The prior on a smooth's SD (sds) is now in link units, scaled to each smooth's basis. Before, it was a fixed exponential(1), whose meaning depended on the basis. The unpenalised part of a smooth (bs_*) on a dpar the family names gets that dpar's slope prior, also in link units. Any model with a smooth gets different priors.
  • Race families (cogmod_lnr(), cogmod_rdm(), cogmod_lba2()): mu's group-level SD gets exponential(1), like the other accumulator's, so the prior no longer depends on the dec() coding.

Starting values

Starting values do not change a posterior, so no fitted model needs revisiting for these.

  • cogmod_inits() now covers cogmod_betagate(), so cogmod_inits() and cogmod_priors() now cover the same families.
  • In cogmod_lnr() and cogmod_lba2(), the error accumulator starts slower than the correct one, as cogmod_rdm()'s already did.
  • The jitter that spreads the chains apart is now scaled by how far each coefficient's design column reaches. A slope on a wide covariate, or a smooth's linear part, no longer tilts the starting surface. A smooth's SD starts at 0.1 link units of wiggle.

Other fixes

  • dcogmod_ddm() keeps its relative precision when the start point is next to the far boundary.
  • cogmod_inits() keeps one-element vectors one-dimensional (for example the SD of (1 | Study)). stanli needs this; cmdstanr corrected it silently.
  • dcogmod_lba1() no longer returns -Inf for strongly negative drifts. Fitted models were not affected.

Documentation

  • The warm-start documentation said that a supplied metric keeps adapting during a short warmup. Because of a Stan bug, Stan never re-estimates the metric when warmup is under 150 iterations. ?cogmod_warmstart and the performance article now say so.
  • ?cogmod_priors and ?cogmod_inits are rewritten, with one table of every prior cogmod_priors() sets.
  • ?rcogmod_exwald and the RT article explain why chains of cogmod_exwald() can settle in different modes.
  • The performance article has a section on stanli, fitted with brm(backend = "stanli").
  • The website moved to https://dominiquemakowski.com/cogmod/.