Hi everyone.
I am defining the following dist
I am using the following code to create my nimblefunction,
dHGA <- nimbleFunction(
run = function(x = double(0),
p = double(0),
alfa = double(0),
beta = double(0),
log = integer(0, default = 0)
) {
returnType(double(0))
if (x > 0) prob <- (1 - p) * dgamma(x, shape = alfa, rate = beta) else prob <- p
return(prob)
}
)
but when i try to use it in the nimbleMCMC, I get the following error message
Defining model
[Note] Registering 'dGHA' as a distribution based on its use in BUGS code. If you make changes to the nimbleFunctions for the distribution, you must call 'deregisterDistributions' before using the distribution in BUGS code for those changes to take effect.
Error in FUN(X[[i]], ...) :
checkDistributionFunctions: density function for dGHA is not available. It must be a nimbleFunction (with no setup code).
Thanks in advance.
Sorry for such a basic question.