Issues with model when using offset

184 views
Skip to first unread message

felipe...@googlemail.com

unread,
Sep 1, 2021, 8:55:16 AM9/1/21
to R-inla discussion group
Hello, 

I am using INLA to forecast health outputs based on seasonal climate forecasts and other ancillary data. Part of the modelling exercise requires fitting a model that predicts the mean seasonal trend for each location. I have created a model of the form:

fb <- casees ~ 1 +
   f(ID.area, model='bym', 
     graph=vnm.adj,
     adjust.for.con.comp=TRUE, 
     constr=TRUE,
     scale.model=TRUE,
     hyper = hyper.bym) +
   f(ID.month1, model='rw1', 
     hyper=hyper.rw1, 
     cyclic=TRUE, 
     scale.model=TRUE,
     constr=TRUE, 
     replicate=ID.area2) +
     offset(log_pop)

where: 
hyper.bym <- list(prec.unstruct=list(prior='pc.prec',param=c(1, 0.01)),
                  prec.spatial=list(prior='pc.prec', param=c(1, 0.01)))
hyper.rw1 <- list(prec=list(prior='pc.prec', param=c(0.5, 0.01)))

I am using the following inla call specification:

inlafun <- function(x, y) {
  inla(as.formula(x), 
       family="nbinomial", 
       data=y,
       control.fixed=list(prec.intercept=1, # prior precision for intercept (wide sd bc. n binomial; intercept likely v small)
                          prec=1),  # prior precision for (scaled) fixed effects
       control.predictor=list(compute=TRUE, link=1), 
       control.compute=list(config=TRUE, dic=TRUE), # Set config to TRUE if sampling
       control.inla=list(strategy="gaussian", # laplace, adaptive or gaussian
                         int.strategy="eb"))
}

The issue I have is that when I use the offset, the model predicts the values of the population used as an offset. This behaviour is not seen in any of the other model specifications that include climate covariates and inter-annual variability. We did a similar exercise last year using data at a coarser spatial resolution and we did not have this issue. Am I missing something?

Felipe


Helpdesk

unread,
Sep 1, 2021, 3:32:18 PM9/1/21
to felipe...@googlemail.com, R-inla discussion group

It could be this: fitted values will include 'offset' but does not
include 'E'

> r = inla(y ~ -1 + offset(off), family="poisson", data =
data.frame(y=0, off = 5), control.predictor=list(compute=TRUE))
> c(r$summary.fitted.values$mean, exp(5))
[1] 148.3912339 148.4131591
> r = inla(y ~ -1, E= exp(off), family="poisson", data = data.frame(y=0,
off = 5), control.predictor=list(compute=TRUE))
> c(r$summary.fitted.values$mean, exp(5))
[1] 0.9998521745 148.4131591026


On Wed, 2021-09-01 at 05:55 -0700, 'felipe...@googlemail.com' via R-inla
> --
> 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/aea564f7-6e49-49a3-9c67-97df479ecdaan%40googlegroups.com
> .

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

Reply all
Reply to author
Forward
0 new messages