simulation from gamma distribution

151 views
Skip to first unread message

BramPar...@live.nl

unread,
Oct 4, 2022, 7:39:41 AM10/4/22
to R-inla discussion group
Dear INLA community, 
I want to validate my model by simulating data from it and compare it with the observations. In inla.doc("gamma") documents I see that the gamma distribution needs the follwing input variables: y = rgamma(n, shape = a, scale = b), whereby 
a = prec.par * prec.scale
b = mu / (prec.par * prec.scale)
prec.scale = runif(n, min = 0.5, max = 2)
prec.par = 1.2

I use the "Precision parameter for the Gamma observations" (one of the available hyperpars of the model) for prec.par, but I cannot find what I should use for prec.scale? Is this something specific per model simulation or something else?
Regards, Bram

Helpdesk (Haavard Rue)

unread,
Oct 5, 2022, 5:50:13 AM10/5/22
to BramPar...@live.nl, R-inla discussion group
'prec.scale' is like an optional (fixed) scaling (vector), maybe easier
to see the documentation for the Gaussian likelihood. its the same
thing.

you can in the simulations, just set it to be 1, as it is 1 by default.
> --
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/7c8a59ff-0855-4f02-9954-67527aea530dn%40googlegroups.com
> .

--
Håvard Rue
he...@r-inla.org

BramPar...@live.nl

unread,
Oct 5, 2022, 8:59:37 AM10/5/22
to R-inla discussion group
Thanks again Håvard, really appreciate your help always!
Bram Parmentier

Op woensdag 5 oktober 2022 om 11:50:13 UTC+2 schreef he...@r-inla.org:
Reply all
Reply to author
Forward
0 new messages