shape = mu .* mu ./ phi;
rate = mu ./ phi;
mu[n] = shape[n] * exp(-(mu[n]));--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/5284cb61-9afd-43fb-a649-204ab44bf2fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm actually trying your wonderful new function, and a question appears : did you implement a way to vectorize the sampling statement? The resulting code is now :// likelihood including all constants if (!prior_only) { for (n in 1:N) { target += gamma2_lpdf(Y[n] | mu[n], phi); } }Which is known to be slower. But I can guess that to ensure compatibility with all possible strange distributions, it is simpler to use a loop!Anyway, great job!
Le jeudi 29 mars 2018 06:06:00 UTC-4, Paul Buerkner a écrit :
In the latest github version of brms, you can define new response distributions yourself using the custom_family() function.
See https://github.com/paul-buerkner/brms/blob/master/vignettes/brms_customfamilies.Rmd for more details
Am Dienstag, 6. März 2018 19:58:20 UTC+1 schrieb Paul Buerkner:
No solution that I am aware of. In the parameterization I use in brms, mu is the mean, but as you say, the precision depends on the mean.The only solution would be to add a new family, gamma2() say, that uses your parameterization. You may comment on https://github.com/paul-buerkner/brms/issues/110 so that I don't lose track of it.
2018-03-06 19:53 GMT+01:00 Lucas Deschamps <lucas.de...@gmail.com>:
Hello!I'm used to model jointly mean and dispersion for strictly positive variables. To do this, I describe response variable by a gamma distribution parametrized by the two orthogonal terms mu (mean) and phi (precision). That is, in stan code :shape = mu .* mu ./ phi;
rate = mu ./ phi;
y ~ gamma(shape, rate);Because I have to use splines to produce a GAMM for a particular problem, I found far more convenient to use brms instead of rstan. Unfortunatly, the gamma disribution is only parametrized in term of mu and shape, with the following formulation I found in the code created by brms :mu[n] = shape[n] * exp(-(mu[n]));
However, in that case, the precision is not independant of the mean.Is there any trick that would allow me to use the formulation with mu and phi, but also to keep the advantages provided by brmsfit objects??Thank you very much!Lucas
--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+...@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/5284cb61-9afd-43fb-a649-204ab44bf2fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/14619c67-9fb0-4321-9076-d295546109d0%40googlegroups.com.