Interpretation of summary.fitted.values

2,187 views
Skip to first unread message

Adam Green

unread,
Aug 12, 2014, 5:10:22 PM8/12/14
to r-inla-disc...@googlegroups.com
I fit a spatiotemporal poisson model to counts from several sites over 29 years. I am interested in making predictions for each site but am having some trouble interpreting the output. I used the suggestion from the FAQs and included NAs in the data (counts weren't conducted at every site every year anyway) and I included the covariate for the unobserved data. When I plot the means for results$summary.fitted.values, the patterns look reasonable but the values vary very little and are not even close to the observed values. For example, here's the summary for the observed counts and the fitted values:

Observed:
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's
   0.00    0.00    5.00   11.74   18.00  131.00    3001

Fitted:
 Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  3.242   5.610   5.842   5.600   5.925   5.976

I thought this might be due to some transformation, but the expected exp transformation results in overestimates. Am I missing something? Thanks for your help. Here is my code.

formula.tmp=max.male~std.da6400+f(year2,model='ar1',replicate=FID2)+f(FID2,model='besag',graph='W.test.txt',replicate=year2,param=c(1,0.05))
formula.1=as.formula(formula.tmp)

inla.pois.test.link2=inla(formula.1,family='poisson',data=data.test,verbose=T,control.inla=list(int.strategy='eb',strategy='gaussian',h=0.01,diagonal=10000),num.threads=1,control.predictor=list(link=1),control.compute=list(config=TRUE))

Adam Green


Håvard Rue

unread,
Aug 12, 2014, 5:17:34 PM8/12/14
to Adam Green, r-inla-disc...@googlegroups.com
will this solve your problem:

http://www.r-inla.org/faq#TOC-How-can-I-do-predictions-using-INLA-

??

H
> --
> 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 post to this group, send email to
> r-inla-disc...@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/r-inla-discussion-group.
> For more options, visit https://groups.google.com/d/optout.


--
Håvard Rue
Department of Mathematical Sciences
Norwegian University of Science and Technology
N-7491 Trondheim, Norway
Voice: +47-7359-3533 URL : http://www.math.ntnu.no/~hrue
Mobile: +47-9260-0021 Email: havar...@math.ntnu.no

R-INLA: www.r-inla.org

Håvard Rue

unread,
Aug 12, 2014, 5:23:29 PM8/12/14
to Adam Green, r-inla-disc...@googlegroups.com
will this solve your problem:

http://www.r-inla.org/faq#TOC-How-can-I-do-predictions-using-INLA-

??

H

On Tue, 2014-08-12 at 14:10 -0700, Adam Green wrote:

Adam Green

unread,
Aug 12, 2014, 5:58:23 PM8/12/14
to r-inla-disc...@googlegroups.com, adam.g...@gmail.com, hr...@r-inla.org
Which method are you referring to? Using summary.random (e.g., results$summary.random$year2$mean) gives me underestimates (exponentiating the values) and even less variation in the predictions.


Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
 0.9999  1.0000  1.0000  1.0000  1.0000  1.0010

Using summary.fitted.values and marginals.fitted.values gives the results I described in my original post. Maybe the AR1 and Besag components are smoothing out the predictions, but I can't imagine it would smooth them out that much. Do you think the lack of continuous counts in some cases (e.g., no counts at a site for at least 1 year) might affect the predictions using the AR1 model?

Adam

Finn Lindgren

unread,
Aug 12, 2014, 6:54:05 PM8/12/14
to Adam Green, r-inla-disc...@googlegroups.com
Hi,

by setting "diagonal=10000" in control.inla you're altering the model, possibly a lot.
Since the effect of that is to reduce the variability in the model, your results are what I would expect (they are gathered fairly close to the input data median).
Can you run it without that option?  It can be useful for numerical reasons, but is then usually coupled with running a sequence of inla calls, each with progressively smaller "diagonal".

Finn L
--
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.

Adam Green

unread,
Aug 13, 2014, 4:28:19 PM8/13/14
to r-inla-disc...@googlegroups.com, adam.g...@gmail.com
Thanks. The diagonal argument was left over from earlier attempts at fitting larger models. Removing that argument did result in more variation in the summary.random values. However, I think I found what I needed with results$summary.fitted.values. These match up closely to the observed data and seem reasonable for unobserved data (though the credible intervals are sometimes huge). Thanks for all your help.

Adam
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages