Hi!
I cant register a simulation function as nimble always seems to register my function as a density function. This doesn't just happen with my own function, but also with example from the help file. Am I doing something wrong here?
Here an example:
> rdirchmulti <- nimbleFunction(
+ run = function(n = integer(0), alpha = double(1), size = double(0)) {
+ returnType(double(1))
+ if(n != 1) print("rdirchmulti only allows n = 1; using n = 1.")
+ p <- rdirch(1, alpha)
+ return(rmulti(1, size = size, prob = p))
+ })
> registerDistributions("rdirchmulti")
Registering the following user-provided distributions: rdirchmulti
Error in FUN(X[[i]], ...) :
checkDistributionFunctions: density function for rdirchmulti has invalid or missing returnType, which must be 'double(0)' (or equivalently 'double()').
Thanks for helping me out with this.
>