On Sat, 2016-11-05 at 14:13 -0700,
hon...@uw.edu wrote:
> I have the following poisson model y ~ Possion(beta0+beta1x). Now I
> want to specify the normal prior for beta0 and beta1, however, , the
> results are different depending on whether I
> use list() in mean=list(-0.02) and prec=list(1/0.10^2). As Blangiardo
> & Cameletti (2015), they should be the same.Which result should I
> believe? Thank you!
Hi,
if you use a mean=list() it must be named. [the question is if inla()
should throw an error if you don't...], so like
inla(y~1+a+b, control.fixed = list(mean = list(a=-1111)),
data = data.frame(y=0:1, a=1:2, b=4:3))
the named elements of the list, like 'a' and 'b', refer to the name
of the variables in the formula, while 'default' is referred to as the
default value, if not mentioned in the list. if you pass an NULL name
(ie no name), then it is simply ignored.
you can check the priors used either reading the output using
verbose=T, or by result$logfile, or check the result object all.hyper
and then 'fixed', like
> inla(y~1+a+b, control.fixed = list(mean = list(a=-1111)), data =
data.frame(y=0:1, a=1:2, b=4:3))$all.hyper$fixed
[[1]]
[[1]]$label
[1] "(Intercept)"
[[1]]$prior.mean
[1] 0
[[1]]$prior.prec
[1] 0
[[2]]
[[2]]$label
[1] "a"
[[2]]$prior.mean
[1] -1111
[[2]]$prior.prec
[1] 0.001
[[3]]
[[3]]$label
[1] "b"
[[3]]$prior.mean
[1] 0
[[3]]$prior.prec
[1] 0.001
hope this helps.
H
--
Håvard Rue
he...@r-inla.org