| y | area | month | month1 | area.int | month.int | fitted |
| 142 | 1 | 1 | 1 | 1 | 1 | 142.6 |
| 128 | 2 | 1 | 1 | 2 | 1 | 129.7 |
| 268 | 3 | 1 | 1 | 3 | 1 | 268.2 |
| 156 | 4 | 1 | 1 | 4 | 1 | 157.0 |
| … | … | … | … | ... | ... | |
| 46 | 1 | 2 | 2 | 1 | 2 | 48.3 |
| 287 | 2 | 2 | 2 | 2 | 2 | 286.5 |
| 125 |
3 | 2 | 2 | 3 | 2 | 126.2 |
| 408 | 4 | 2 | 2 | 4 | 2 | 407.6 |
| Hyperparameters | mean | sd | 0.025quant | 0.5quant | 0.975quant | mode |
| Precision for area (iid) |
0.88 | 0.05 | 0.78 | 0.88 | 0.98 | 0.88 |
| Precision for area (spatial component) | 1718.00 | 1819.00 | 122.99 | 1173.00 | 6580.00 | 338.33 |
| Precision for month | 21.54 | 8.42 | 9.06 | 20.27 | 41.73 | 17.75 |
| Rho for month | 0.62 | 0.14 | 0.32 | 0.63 | 0.85 | 0.66 |
| Precision for month1 | 17990.00 | 18310.00 | 1246.90 | 12550.00 | 66570.00 | 3432.81 |
| Precision for area.int | 2.08 | 0.04 | 2.00 | 2.08 | 2.17 | 2.08 |
| GroupRho for areaint | 0.08 | 0.02 | 0.05 | 0.08 | 0.11 | 0.09 |
--
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-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-discussion-group@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsubscr...@googlegroups.com.
To post to this group, send email to r-inla-discussion-group@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
Hi Finn,Firstly thank you for such a quick response!No I did not set the link function, that was just thinking about that... so i'll try link=1, is that the correct assumption.
Also thank you for directing me in the right direction. I have come across inla.posterior.sample() and from my understanding, control.compute( config=TRUE) needs to be called in the INLA call.
Would 1000 samples be enough for 7896 observations? 658(areas)*12(months)?
Please could you direct me to maybe a link or some sample code in how to predict month+1 using the inla.posterior.sample() function, as there seems to not be a lot of examples online.
###########################################################For each area, I have counts from the month 01-12 of 2017. So I want to predict the counts for each area for 01/18.Now I can't reveal the true data for confidentiality reasons, all I can say is that the model is at a regional scale, so covers a large area.I have tried following the FAQ - How can I do predictions using INLA? Which I tested on for month 12, by simply setting y[i] = NA for all the areas in month 12 I want to predict NOT just the locations I want to predict. This gave values far from the actual values of all areas for month 12, in the region of y=5 (mean).Please could some one explain how I can predict counts for month 12 in space&time.
--
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-group+unsubscr...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-discussion-group@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
On 20 July 2018 at 21:25, Thomas <tast...@gmail.com> wrote:Hi Finn,Firstly thank you for such a quick response!No I did not set the link function, that was just thinking about that... so i'll try link=1, is that the correct assumption.Correct. That means "apply the link function from the first likelihood to all the elements", and since you only have one likelihood, that should do it.Also thank you for directing me in the right direction. I have come across inla.posterior.sample() and from my understanding, control.compute( config=TRUE) needs to be called in the INLA call.Correct.Would 1000 samples be enough for 7896 observations? 658(areas)*12(months)?The number of posterior samples required has very little to do with the amount of input data; inla.posterior.sample generates independent samples, so the number of samples depends mostly on how many samples are needed to estimate the desired quantities with the desired precision (e.g. 10 is too small to reliably estimate a variance, but 1000 is quite decent).Please could you direct me to maybe a link or some sample code in how to predict month+1 using the inla.posterior.sample() function, as there seems to not be a lot of examples online.I don't have any links handy, sorry; hopefully someone else will chime in. But in your case, your model should really be set up in the way you already have it, including month+1 in the model.It's then "just" a matter of extracting the relevant part of each posterior sample, and compute whatever quantity you're interested in. For example, to compute P(N<=n | y),P(N <= n | y) = E( P(N <= n | \eta, y) ) \approx 1/S \sum_{s=1}^S P(N <= n | \eta^{[s]}, y)where \eta is the linear predictor, and \eta^{[s]} is each sample of \eta.Another option is to sample from the counts.Finn
###########################################################For each area, I have counts from the month 01-12 of 2017. So I want to predict the counts for each area for 01/18.Now I can't reveal the true data for confidentiality reasons, all I can say is that the model is at a regional scale, so covers a large area.I have tried following the FAQ - How can I do predictions using INLA? Which I tested on for month 12, by simply setting y[i] = NA for all the areas in month 12 I want to predict NOT just the locations I want to predict. This gave values far from the actual values of all areas for month 12, in the region of y=5 (mean).Please could some one explain how I can predict counts for month 12 in space&time.
--
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-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsubscr...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsubscr...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-discussion-group@googlegroups.com.
# define n samplesn.samples = 1000# generate 1000 posterior samples from all of its components from the INLA modelsamples = inla.posterior.sample(n.samples, result = train)
# create a generic code to see the hidden part of the INLA result object & start contents = train$misc$configs$contentscontentsour.experiment = list(x1 = 0, x2 = 0, plate = 7)
nr = 57
s = samples[[nr]]$latent
## beta1 * 0
f.x1.0 = s[44, , drop=F] * our.experiment$x1
## beta1 * 1
f.x2.1 = s[45, , drop=F] * our.experiment$x2
## f(plate = 7)
# - the same plate as before
f.plate.7 = s[28, , drop=F]
## The intercept
int = s[43, , drop=F]
predictor.our.experiment = drop(f.x1.0 + f.x2.1 + f.plate.7 + int) # see below for questionsamples.link = inla.link.invlogit(predictor.our.experiment
2.0
To get data values, by transforming the predictor sample, you use:
"We now need to transform through the link function and the data sampling. We know we use the logit transform..."
samples.link7 = inla.link.invlogit(samples.pred7)
res1$.args$control.family$control.link$modelcontrol.family1 = list(control.link=list(model="logit") == control.family1 = list(control.link=list(model="log")To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsubscr...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsubscr...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsubscr...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-discussion-group@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsub...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
--
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-group+unsub...@googlegroups.com.