I am brand new to Bayesian modeling and I am currently following the Statistical Rethinking course by McElreath. I am using the rethinking package for Rstudio and have been trying to apply the ulam function to fit a gamma distribution model to daily precipitation data. However, R returns an error message that there is no template distribution for dgamma. See code below.
m.2 ← ulam(
p ~ dgamma(shape, scale) ,
log(shape) ← a,
a ~ dnorm(0.5,0.2),
log(scale) ← b ,
b ~ dnorm(0.5,0.2)
), data = dat_list, chains = 1, log_lik = TRUE
Error in get_dist_template(the_dist) :
No template for distribution ‘dgamma’
Can anyone provide example code for how to work with gamma distributions using the rethinking package? Also, are there any general principles to follow when assigning sensible priors to skewed distributions?