Closed DominiqueMakowski closed 8 months ago
Your prior distributions look good to me. I think it is an issue with numerical stability. I get the following error when setting the seed to 50:
ERROR: DomainError with -4.91550493136807e-18
which occurs around here
but the error might originate deeper in the code. My guess is there is some numerical instability, which could be exacerbated only having 1 accumulator. I will dig into it more over the next couple of days. Thank you for reporting.
I like your idea of including parameter ranges in the docs.
Edit
MWE for reference:
using SequentialSamplingModels: WaldA parms = (ν = 7.018202455250795, k = 7.697512370965172, A = 0.3242128667492429, τ = 0.1507257317320111) rt = 0.517 d = WaldA(; parms...) logpdf(d, rt)
Under the conditions above, the log likelihood evaluates to 0 but due to numerical instability, a small negative number was passed to log
, thus triggering a complex number error. This is likely to happen in your model because you have a lot of parameters relative to the number of response alternatives. The best approach would be to rewrite the log likelihood in terms of logs of individual terms rather than logpdf(...) = log(pdf(...)). Unfortunately, I am not sure if there is a clean way to do so given the number terms added here. If other problems continue to emerge, I can look into a solution using logsumexp
. For now, the solution I implemented seems to work. I'll release an update. The change is breaking (due to some other changed already on master), but it should not affect your models.
Following up on this as I ran into similar, if not the same, numerical instability issue when creating mwe with the RDM. Where the changes released?
It looks the fix was released in v0.9.0. Can you provide a MWE if the issue still persists?
I'm having some trouble parametrizing the RDM, despite using priors that I'd think would be alright (but here's probably my mistake). Very often, the sampling errors with the following:
Code:
Any tips?
Which makes me think that it would be amazing to add the docs, when listing all parameters, some info (where available, it can be a work-in-progress goal) to help people parametrize, e.g.: for sigma, "Cannot be negative", for drift in DDM: "typical range: [..., ....]"