Hello everyone , I’m trying to fit a shifted lognormal model to a large data set of RT. But no matter how i fixed my code , I still could not run away of the error /(ㄒoㄒ)/.
Because the code was written by others,i could not understand all of them.
And this is the error I do not know how to deal with.
↓↓↓
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: lognormal_lpdf: Random variable[1] is -1.40192, but must be nonnegative! (in 'string', line 194, column 4 to column 62)
.
.
.
[1] "Error : Initialization failed."
[1] "error occurred during calling the sampler; sampling not done"
I really need your help ,cause I have been bothered by this annoying problem for almost 3 weeks.
Hi @Yang_Wang,
what is the result of min(analyze_df2$RT)? It sounds like you have a negative value while your family expects positive values (after the shift).
You could try using other init values. I think the default value is 2, you could try setting it to 0.1 just to see if it works.
Alternatively, can you try to sample only from the prior and look at your prior predictive checks? You might need to help the model a little more with this kind of structure.
init = 0.1, sample_prior = "only" would be the arguments.
Sorry for the time difference!
I am going to try your advice , actually I have tried it but maybe I used wrong grammar of R.I will try to fix it again~Thank you!