Closed HamidLD closed 2 years ago
@FBartos, any idea what's going on here?
hmm, no idea. Maybe an issue for @vandenman to look at?
Looks like the same issue as https://github.com/jasp-stats/INTERNAL-jasp/issues/1816
Looks like the same issue as https://github.com/jasp-stats/INTERNAL-jasp/issues/1816
That link doesn't work for me. ("404" error). To give you more information, here's the experiment that has done what I want to do: https://osf.io/3n98r/ I can also do it in R, but thought to give it a try with Jasp first because it's easier ha!
@HamidLD there is an error because you need to specify initial values for some model components. But unfortunately, an error occurs when trying to show the error message...
With settings like these:
I get the following error in jasp-stats/jaspJags#69:
can you tell me what the correct values for these should be?
@HamidLD there is an error because you need to specify initial values for some model components. But unfortunately, an error occurs when trying to show the error message...
With settings like these:
I get the following error in jasp-stats/jaspJags#69:
can you tell me what the correct values for these should be?
I see. Those values should be: maxpumps: 116 (there is a +1 in the code, so maybe it should be 117) totalTrials: 4830 participants: 161 (each have had 30 trials) This demo file might also be useful: BARTDemo.zip
Okay so I got the model to run with the following settings:
The highlighted changes are:
participant[t]
to participant[t]-100
. This is necessary since rho goes from 1 to 180 (nParticipants
), but you use participant as an index which starts at 101.y
as the initial value for yPrime
. Otherwise, JAGS will use random starting values which leads to an invalid starting point. This also works in the current release of JASP, let me know if there are any other issues!
@vandenman Thanks! It worked! I had almost given up on this ha. The only thing that confuses me is the number of participants. I have 161 participants, yet this gives you 180 for rho and beta, and it gives the error when you try any number other than 180.
I think I found out what's going on. For some reason, the model has calculated imaginary participants, producing very similarly weird numbers and CIs for them (the rho for all of them is 7 with CIs between 0 and 17), so I deleted these and total n is 161 now. Anyway, thanks again, I couldn't have figured this out without you.
For some reason, the model has calculated imaginary participants, producing very similarly weird numbers and CIs for them (the rho for all of them is 7 with CIs between 0 and 17)
Ah yeah in that case all information is sampled from the prior distributions, so the sampled values probably do not make any sense.
For some reason, the model has calculated imaginary participants, producing very similarly weird numbers and CIs for them (the rho for all of them is 7 with CIs between 0 and 17)
Ah yeah in that case all information is sampled from the prior distributions, so the sampled values probably do not make any sense.
Oh yeah that makes sense, thanks!
JASP Version
0.16.2
Commit ID
No response
JASP Module
jaspJags
What analysis are you seeing the problem on?
Model fitting
What OS are you seeing the problem on?
Win10 64bit
Bug Description
I have a behavioral data set BartC.csv , to which I want fit a cognitive model using JAGS (shown in the attached image , but I get the following error:
This analysis terminated unexpectedly.
Error in stringr::str_count(model, chars): object 'model' not found
Stack trace doTryCatch(return(expr), name, parentenv, handler)
withCallingHandlers(expr = analysis(jaspResults = jaspResults, dataset = dataset, options = options), error = .addStackTrace)
analysis(jaspResults = jaspResults, dataset = dataset, options = options)
JAGS(...)
.JAGSrunMCMC(jaspResults, dataset, options)
jaspResults[['mainContainer']]$setError(.JAGSmodelError(e, options))
private$jaspObje
ct$setError(x)
.JAGSmodelError(e, options)
stringr::str_count(model, chars)
stri_count_fixed(string, pattern, opts_fixed = opts(pattern))
Expected Behaviour
It should produce the posterior means of parameters beta and rho for each participant, like the following:
Steps to Reproduce
Use the following model in the JAGS module (I've attached the data earlier) data{ for (k in 1:maxPumps){ cut[k] = k - 0.5 } } model{ for (i in 1:nParticipants){ rho[i] ~ dnorm(7, 1/5^2)T(0,) beta[i] ~ dnorm(3, 1/2^2)T(0, ) yPredTmp[i] ~ dnorm(rho[i], 1/beta[i]^2)T(0, ) yPred[i] = round(yPredTmp[i]) } for (t in 1:totalTrials){ yPrime[t] ~ dnorm(rho[participant[t]], 1/beta[participant[t]]^2)T(0, ) y[t] ~ dinterval(round(yPrime[t]), cut[1:burst[t]]) } }
Select the rho and beta parameters as the output
And here the error is produced.
Jasp file: BartC.zip
Log (if any)
No response
Final Checklist