n = 10^4
x = rnorm(n, sd = 0.2)
eta = 3 + x
E = runif(n, min = 1, max=10)
E[] =1
size = 20
q = E*exp(eta);
quantile <- 0.5
p = 1.0 - qbeta(quantile, q + 1.0, size, lower.tail = FALSE);
lambda = size * (1.0 - p) / p / E;
mu = E * lambda
y = rnbinom(n, size, mu=mu)
r = inla(y ~ 1 + x, data = data.frame(y, x, E),
family = "nbinomial", E=E, verbose=T)
summary(r)
> --
> 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/0c8191bd-ac19-406f-b3ea-6204b72be7acn%40googlegroups.com
> .
--
Håvard Rue
he...@r-inla.org