Hi Daniel,
OK, I think I understand, but I’m still trying to wrap my head around these special distributions and dummy variables. I’m not quite there.
However, I have attached a new minimal example that tries to calculate the likelihood for each dummy term by first generating the corresponding imputed value and second calculating its likelihood. It seems that I have to wrap the R versions of the called functions in nimbleRcall, but even that is not working. I feel like I am chasing errors that I have no clue about.
The attached script gives the following error for me:
Error: In sizeAssignAfterRecursing: 'rNorm' is not available or its output type is unknown. This may occur if a user-defined function name is the same as the name of a function in a package that `nimble` uses.
This occurred for: model_x[getNodeFunctionIndexedInfo(ARG1_INDEXEDNODEINFO__,1)] <<- rNorm(=1,mean=model_mu[1],sd=model_sigma[1],Mean=0,SD=1)
This was part of the call: { model_x[getNodeFunctionIndexedInfo(ARG1_INDEXEDNODEINFO__,1)] <<- rNorm(=1,mean=model_mu[1],sd=model_sigma[1],Mean=0,SD=1) }
In addition: Warning messages:
1: In dunif(model$mu[1], min = -0, max = 0, log = 1) : NaNs produced
2: In dunif(model$mu[1], min = -0, max = 0, log = 1) : NaNs produced
3: In dunif(model$mu[1], min = -0, max = 0, log = 1) : NaNs produced
Execution halted
I have no identifier rNorm, so I’m lost.
I thought this was the path you were suggesting, but clearly I’m not understanding completely. Any suggestions are welcome.
Thanks a lot.
Cheers,
Brook
> To view this discussion visit
https://groups.google.com/d/msgid/nimble-users/CAKbe0hpsGX2fRmkxvkgKOQavn67beyuXLMnyfanb2VxVzCDLOA%40mail.gmail.com.