Brook Milligan
unread,Sep 24, 2025, 2:28:52 PM (13 days ago) Sep 24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nimble-users
Hi,
I am calling dgamma() withing a Nimble function like so:
lp <- dgamma(x, shape=shape, scale=scale, log)
but get the following error message:
Error in dgamma(x, shape = shape, scale = scale, log) : specify 'rate' or 'scale' but not both
As far as I can tell, I am in fact specifying scale, not rate. The synopsis for the R dgamma() function is:
dgamma(x, shape, rate = 1, scale = 1/rate, log = FALSE)
and the synopses for the Nimble dgamma() function are:
dgamma(shape, scale) canonical
dgamma(shape, rate) dgamma(shape, scale = 1 / rate)
dgamma(mean, sd) dgamma(shape = mean^2/sd^2, scale = sd^2/mean)
I’m not sure which gets called from within a Nimble function but I expect the scale/shape parameterization to work with either.
By the way, should there be a log parameter for the Nimble synopses, or do they never take that argument?
What am I missing here?
Thanks for your help.
Cheers,
Brook