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
5
votes
0 answers

sampling from posterior predictive distribution (stan vs inla)

I'm trying to implement functions from bayesplot package on a INLA object and a little unsure of how to draw from the posterior predictive distribution. I think I almost have it but rstan draws are more variable than the INLA ones. In rstan, using…
user63230
  • 4,095
  • 21
  • 43
4
votes
1 answer

Error in inla.call.builtin() : INLA installation error; no such file

I have recently updated INLA using the inla.update on my machine. Now everytime I try to run a function from the package, such as inla.mesh.2d I obtain the following error: Error in inla.call.builtin() : INLA installation error; no such file I tried…
Samuele
  • 41
  • 3
2
votes
1 answer

R-INLA installation fails on R 4.1.1

I need to install R-INLA on R 4.1.1 (Windows 10). I cannot update the R version due to compatibility issues of the newer R installations with other tools I that use. I tried the line: remotes::install_version("INLA",…
somros
  • 21
  • 2
2
votes
0 answers

Error in validObject(.Object) : invalid class “dsparseModelMatrix” object: superclass "Mnumeric"

I am running a Bayesian model with INLA. Few months ago it was running fine. Today I run again with this error: Error in validObject(.Object) : invalid class “dsparseModelMatrix” object: superclass "Mnumeric" not defined in the environment of the…
Alfredo
  • 31
  • 3
2
votes
1 answer

Creating a inla.graph object with correct index labels from sf linestring object

I have a shapefile containing linestrings that describes connection between cities in Brazil. I would like to convert these connections into a neighbourhood object with the cities' code set as the row name, making it compatible with my data frame: >…
2
votes
1 answer

How can I create a SpatialPolygons object from SpatialPolygonsDataFrame object in R?

I am working on creating a species distribution model using R-INLA, and I want to use a shapefile(.shp) that I have created in ArcPro as a barrier in the spatial mesh. In order to do so, I think the shapefile must be in the 'SpatialPolygons'…
Sinophy
  • 21
  • 1
2
votes
1 answer

Using R INLA hyperparameter to.theta and from.theta functions

R-INLA model hyperparameters have to.theta and from.theta functions that appear to be for converting between different parameterisations. It would be convenient to use those conversion functions but how does one do so? Example with ar1 From the ar1…
andycraig
  • 710
  • 5
  • 18
1
vote
0 answers

Setting coastline as a boundries for INLA mesh in R

I am creating an INLA mesh using the coastline as my boundry. I am getting some extra spaces or triangles on the right side of my mesh. I want to setup the coastline as my boundry of the mesh, so I don't have any triangles on the land. In the second…
Usman YousafZai
  • 1,088
  • 4
  • 18
  • 44
1
vote
0 answers

Fit a spatial model in spaMM, glmmTMB, or R-INLA

I have a dataset that contains two sites (i.e., sites 1 and 2). The data in each site is arranged in a row-column layout (e.g., 3 rows by 4 columns). Below is an example for my dataset, where trt is the main factor of interest, and row, column, and…
nhavt
  • 349
  • 2
  • 10
1
vote
0 answers

How to obtain prediction from an INLA model in R without fitting it?

Let's imagine I want to fit an INLA model with a large dataset and want to do some prediction using the fitted model. One solution is to include into the date the covariates used to predict the outcome, assigning NA values to the outcome. In my…
Anthony
  • 377
  • 2
  • 6
  • 13
1
vote
0 answers

Error message "version `CXXABI_1.3.8' not found" appears when running an INLA model in R

In order to use the INLA R package in a HPC cluster, I followed this tutorial. However, when trying to launch the test model, the following message…
Anthony
  • 377
  • 2
  • 6
  • 13
1
vote
1 answer

Attempt to redefine node p[1,1] When adding covariates to beta-binomial mixture model

I keep getting the above error when I try adding detection covariates on a beta-binomial N-mixture model in rags. According to Royle(2004). A binomial N mixture model can be used to model abundance data arising from repeat count surveys. The number…
1
vote
1 answer

Installation of non-CRAN package requires CRAN mirror

I'm trying to install the INLA package of the R-INLA project on a Linux based computing cluster. The package is not on CRAN. According to their tutorial, it suffices to…
yrx1702
  • 1,619
  • 15
  • 27
1
vote
1 answer

Problems installing the INLA package

When I run '''install.packages("INLA", repos=c(getOption("repos"), INLA="https://inla.r-inla-download.org/R/testing"), dep=TRUE)''' keeps me giving this error: Warning in install.packages : cannot open URL…
1
vote
0 answers

Error: `dim<-.haven_labelled()` not supported

I am relatively new to R. I am trying to fit a CAR model in R using a dta file from Stata. I am using INLA package (I also tried with BayesX). This is my code: model_linear <- inla(form_fit,family="gaussian",data=zim_child_model, …
1
2 3