Questions tagged [r-inla]

R-INLA is a package in R that do approximate Bayesian inference for Latent Gaussian Models. This site is dedicated to that package and methodological developments that goes along with it.

What is INLA?

The integrated nested Laplace approximation (INLA) is a method for approximate Bayesian inference. In the last years it has established itself as an alternative to other methods such as Markov chain Monte Carlo because of its speed and ease of use via the R-INLA package. Although the INLA methodology focuses on models that can be expressed as latent Gaussian Markov random fields (GMRF), this encompasses a large family of models that are used in practice.

This manual describes the INLA program, a new instrument which allows the user to easily perform approximate Bayesian inference using integrated nested Laplace approximation (INLA). We describe the set of models which can be solved by the inla program and provide a series of worked out examples illustrating its usage in details. Appendix A contains a reference manual for the inla program.

https://www.r-inla.org/home

32 questions
1
vote
1 answer

Error message when running mixed effect models using R-INLA

I am using R-INLA to run the following model (Treatment, Animal.1 and Animal.2 are factors and Encounter.Length is continuous): formula <- Encounter.Length ~ Treatment +f(Animal.1, model = "iid", n = n.animal) + f(Animal.2, copy =…
alex
  • 153
  • 1
  • 10
1
vote
1 answer

Using INLA with raster in R

I've used INLA before with a SpatialPolygonsDataFrame before, but I have never used it with raster. I have been scouring the internet for many hours, reading vignettes and everything I can find, but still can't figure out how to use INLA with a…
user2221184
  • 133
  • 1
  • 8
0
votes
1 answer

When trying to use INLA on a LGM I get "Error: length(covariate[[r]]) == NPredictor is not TRUE"

For a project I'm doing a need to create a LGM from points on a [0, 1]^2 grid. I'd really appreciate any help you all can give me > set.seed(2000) > # Define number of points and locations > par(mfrow=c(1,1))#Ensure 1 graph on screen at a time > n…
0
votes
0 answers

Analysis of replicated spatial point patterns (bayesian way)

Lately, I have been interested in spatial Point Patterns analysis. I have been using spatstat and other packages. However, the resources (tutorials and vignettes) regarding replicated point patterns are very limited. My question is, do you know of…
0
votes
1 answer

hi all . i am trying to run the bym2 model . at this stage, i have a problem.are you help me?

library(“rstan”) library(“rstudioapi”) library(“parallel”) library(“brms”) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectgores()) library(pkgbuild) # load packAge find_rtools() # should be TRUE, assuming you have Rtools…
shal
  • 1
  • 1
0
votes
0 answers

Graph file on R-INLA package

I have some areal data (disease mapping) to model. I want to predict the number of cases of a disease, considering spatio-temporal effects using R-INLA. My data has these columns: city code; year; month; latitude; longitude; number of cases. I know…
0
votes
0 answers

Linear Combination of Standard Deviation of iid Random Effects in INLA

Given a model with two iid random effects, I'd like to take a linear combination of the standard deviation of the random effects, rather than levels of the random effects, in INLA. Here an example, although the inla.make.lincomb is obviously…
SushiChef
  • 588
  • 3
  • 12
0
votes
0 answers

Error in FUN(X[[i]], ...) : object 'val' not found

i'm facing the following errorand i don't know how to fix it.... and , the desired map is drown , but i connot specify the dangerous points on the map ... library(rgdal) library(spdep) #shapefile address TWN <-…
shal
  • 1
  • 1
0
votes
0 answers

calculate area of each pixel in SpatialPixelsDataFrame

I'm fitting Poisson counts models in inlabru and require the total area of the SpatialPixelsDataFrame to use for the abundance estimates of the model. Is there a way for me to get the overall area? I have tried using…
nnn
  • 1
0
votes
0 answers

How do I combine the posterior distribution of the parameters with new data to get predictions in R-INLA?

I fit a model using R-INLA, with a mix of linear and non-linear effects (but no spatial), and I understand I can generate samples of the posterior distribution of the parameters by the inla.posterior.sample() function, but I can't work out how to…
Erin
  • 1
  • 1
0
votes
0 answers

INLA package coop <- dp[, c("long", "lat")]

I'm using the toturial of Paula Moragada: https://www.paulamoraga.com/tutorial-geostatistical-data/#1_data to build a marine isoscape. I am using a csv file with carbon isotope data of zooplankton with their respective latitude/longitude data, and I…
0
votes
1 answer

How to create a graph file for INLA using region names

i.e. use the region.id of class nb from the spdep package rather than ignoring it as spdep::nb2INLA does? I've been trying to link a column in my data containing these regions as a factor, to an INLA model with a graph describing their spatial…
JCran
  • 375
  • 2
  • 14
0
votes
1 answer

How can I capture the verbose output of an INLA model in R?

Hopefully, this example illustrates what I'm trying to do. I run a comparison of the same simple example toggling verbose TRUE and FALSE. library("INLA") test <- capture.output( { inla(speed ~ dist, data = datasets::cars, verbose = F) } …
JCran
  • 375
  • 2
  • 14
0
votes
0 answers

Logistic Gaussian process regression model with R-INLA

Does anyone know if it is possible to fit a "logistic Gaussian process regression model" with INLA? The model can be found in the below link: https://mc-stan.org/docs/2_19/stan-users-guide/fit-gp-section.html It simply works by replacing predictors…
Amin Shn
  • 532
  • 2
  • 11
0
votes
0 answers

R Version Issue

When executing the code: N <- 100 # 500, 5000, 25000, 100000 x <- rnorm(N, mean = 6, sd = 2) y <- rnorm(N, mean = x, sd = 1) data <- list(x = x, y = y, N = N) inla(y ~ x, family = "gaussian", data = data, control.predictor = list(link = 1), …