Code Monkey home page Code Monkey logo

r-inla's Introduction

README

This respository contains the source code for the R-INLA project; see www.r-inla.org

Precompiled version of the R-INLA package can be downloaded from inla.r-inla-download.org

Håvard Rue

r-inla's People

Contributors

albafuster avatar andrerie avatar ariebler avatar cristian92 avatar denisrustand avatar dpsimpson avatar eliaskrainski avatar esmail-abdulfattah avatar esoterydactyl avatar fbachl avatar finnlindgren avatar gafuglstad avatar haakonbakkagit avatar hrue avatar jmartinez-minaya avatar martinmodrak avatar mca91 avatar mikemc avatar smar-git avatar zhedongliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

r-inla's Issues

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

Hi, I'm having the same problem and when I try installing the testing version I got this error:

  • installing binary package 'INLA' ...
    cp: unknown option -- )
    Try '/usr/bin/cp --help' for more information.
    ERROR: installing binary package failed
  • removing 'H:/R/R-4.1.2/library/INLA'
  • restoring previous 'H:/R/R-4.1.2/library/INLA'
    Warning in install.packages :
    installation of package ‘INLA’ had non-zero exit status

Could you help with this?

Thanks

inla.spde.make.A error with single loc

Hello!

When submitting a single loc in inla.spde.make.A, this error message is returned:

library(INLA)

loc <- matrix(runif(10000 * 2) * 1000, 10000, 2)
mesh <- inla.mesh.2d(
  loc = loc,
  cutoff = 50,
  max.edge = c(50, 500)
)
A <- inla.spde.make.A(mesh, loc = loc[1,])

## Error in h(simpleError(msg, call)) : 
##  error in evaluating the argument 'x' in selecting a method for function 'which': error in evaluating 
##  the argument 'x' in selecting a method for function 'rowSums': non-numeric matrix extent

Maybe a forgotten drop = FALSE somewhere?

Thanks!
François

Problems running INLA on a mac

I am operating from a Mac OS (darwin 17.0) and I am running R version 4.2.2. For reasons I do not know, INLA seems not to be working properly on my computer so much that even simple functions are not giving results. For example, I used the code on INLA's website https://www.r-inla.org/download-install and to be specific I used the example below:

n = 100; a = 1; b = 1; tau = 100
z = rnorm(n)
eta = a + b*z

scale = exp(rnorm(n))
prec = scale*tau
y = rnorm(n, mean = eta, sd = 1/sqrt(prec))

data = list(y=y, z=z)
formula = y ~ 1+z
result = inla(formula, family = "gaussian", data = data)

summary(result)

Here is the error that I am encountering:

result = inla(formula, family = "gaussian", data = data)
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla.run: line 132: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla: No such file or directory
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla.run: line 138: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla: No such file or directory
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla.run: line 138: exec: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla: cannot execute: No such file or directory
Error in inla.inlaprogram.has.crashed() :
The inla-program exited with an error. Unless you interrupted it yourself, please rerun with verbose=TRUE and check the output carefully.
If this does not help, please contact the developers at [email protected].

*** inla.core.safe: inla.program has crashed: rerun to get better initial values. try=1/2
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla.run: line 132: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla: No such file or directory
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla.run: line 138: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla: No such file or directory
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla.run: line 138: exec: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla: cannot execute: No such file or directory
Error in inla.inlaprogram.has.crashed() :
The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
If this does not help, please contact the developers at [email protected].

*** inla.core.safe: inla.program has crashed: rerun to get better initial values. try=2/2
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla.run: line 132: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla: No such file or directory
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla.run: line 138: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla: No such file or directory
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla.run: line 138: exec: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/INLA/bin/mac/64bit/inla: cannot execute: No such file or directory
Error in inla.inlaprogram.has.crashed() :
The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
If this does not help, please contact the developers at [email protected].
Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts, :
*** Fail to get good enough initial values. Maybe it is due to something else.

I need guidance on how I can resolve the issue

INLA installation error; no such file

hi there,

Wondering if I can have some guidance on this error message. Thank you very much.

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

Got the error when I tried to run the example code.

Below is my session information.

sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_New Zealand.1252  LC_CTYPE=English_New Zealand.1252    LC_MONETARY=English_New Zealand.1252 LC_NUMERIC=C                         LC_TIME=English_New Zealand.1252    

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] INLA_99.99.9999 sp_1.4-5        foreach_1.5.2   Matrix_1.4-0   

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7          here_1.0.1          lattice_0.20-41     tidyr_1.1.2         png_0.1-7           class_7.3-17        zoo_1.8-8           assertthat_0.2.1    rprojroot_2.0.2    
[10] digest_0.6.27       R6_2.5.0            plyr_1.8.6          evaluate_0.14       e1071_1.7-4         httr_1.4.2          ggplot2_3.3.4       pillar_1.4.7        RgoogleMaps_1.4.5.3
[19] rlang_0.4.10        curl_4.3            rstudioapi_0.13     rmarkdown_2.6       splines_4.0.2       webshot_0.5.2       stringr_1.4.0       foreign_0.8-80      munsell_0.5.0      
[28] compiler_4.0.2      xfun_0.24           pkgconfig_2.0.3     htmltools_0.5.1.1   tidyselect_1.1.0    tibble_3.0.5        gridExtra_2.3       codetools_0.2-16    viridisLite_0.3.0  
[37] crayon_1.3.4        dplyr_1.0.3         sf_0.9-7            bitops_1.0-7        grid_4.0.2          gtable_0.3.0        lifecycle_1.0.1     DBI_1.1.1           magrittr_2.0.1     
[46] units_0.7-1         scales_1.1.1        KernSmooth_2.23-17  stringi_1.5.3       ggsn_0.5.0          remotes_2.3.0       xml2_1.3.2          ellipsis_0.3.1      generics_0.1.0     
[55] vctrs_0.3.6         kableExtra_1.3.2    rjson_0.2.20        iterators_1.0.14    tools_4.0.2         ggmap_3.0.0         glue_1.4.2          purrr_0.3.4         jpeg_0.1-8.1       
[64] yaml_2.2.1          colorspace_2.0-0    maptools_1.0-2      classInt_0.4-3      rvest_0.3.6         knitr_1.33

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

Before I reinstall my laptop, it ran just fine for the INLA package. Unfortunately, now I can't use the package. I tried several version of R (4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.4.0) but still doesn't work. The latest attempt I tried, I install the package from github. I don't know why I can't install it from the r-inla website. Here is the outcome when I use inla() for my model

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

And here is the session information
Session info ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.3.3 (2024-02-29 ucrt)
os Windows 11 x64 (build 22631)
system x86_64, mingw32
ui RStudio
language (EN)
collate English_Indonesia.utf8
ctype English_Indonesia.utf8
tz Asia/Jakarta
date 2024-05-11
rstudio 2024.04.0+735 Chocolate Cosmos (desktop)
pandoc NA

─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.3)
class 7.3-22 2023-05-03 [2] CRAN (R 4.3.3)
classInt 0.4-10 2023-09-05 [1] CRAN (R 4.3.3)
cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.3)
coda * 0.19-4.1 2024-01-31 [1] CRAN (R 4.3.3)
curl 5.2.1 2024-03-01 [1] CRAN (R 4.3.3)
DBI 1.2.2 2024-02-16 [1] CRAN (R 4.3.3)
devtools * 2.4.5 2022-10-11 [1] CRAN (R 4.3.3)
digest 0.6.35 2024-03-11 [1] CRAN (R 4.3.3)
e1071 1.7-14 2023-12-06 [1] CRAN (R 4.3.3)
ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.3)
fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.3)
fmesher 0.1.5 2023-12-20 [1] CRAN (R 4.3.3)
fs 1.6.4 2024-04-25 [1] CRAN (R 4.3.3)
glue 1.7.0 2024-01-09 [1] CRAN (R 4.3.3)
htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.3.3)
htmlwidgets 1.6.4 2023-12-06 [1] CRAN (R 4.3.3)
httpuv 1.6.15 2024-03-26 [1] CRAN (R 4.3.3)
INLA * 99.99.9999 2024-05-11 [1] Github (b762014)
jagsUI * 1.6.2 2024-01-30 [1] CRAN (R 4.3.3)
KernSmooth 2.23-22 2023-07-10 [2] CRAN (R 4.3.3)
later 1.3.2 2023-12-06 [1] CRAN (R 4.3.3)
lattice 0.22-5 2023-10-24 [2] CRAN (R 4.3.3)
lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.3)
magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.3)
Matrix * 1.6-5 2024-01-11 [2] CRAN (R 4.3.3)
memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.3)
mime 0.12 2021-09-28 [1] CRAN (R 4.3.1)
miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.3.3)
pkgbuild 1.4.4 2024-03-17 [1] CRAN (R 4.3.3)
pkgload 1.3.4 2024-01-16 [1] CRAN (R 4.3.3)
profvis 0.3.8 2023-05-02 [1] CRAN (R 4.3.3)
promises 1.3.0 2024-04-05 [1] CRAN (R 4.3.3)
proxy 0.4-27 2022-06-09 [1] CRAN (R 4.3.3)
purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.3)
R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.3)
Rcpp 1.0.12 2024-01-09 [1] CRAN (R 4.3.3)
remotes 2.5.0 2024-03-17 [1] CRAN (R 4.3.3)
rjags * 4-15 2023-11-30 [1] CRAN (R 4.3.3)
rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.3)
rstudioapi 0.16.0 2024-03-24 [1] CRAN (R 4.3.3)
sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.3)
sf 1.0-16 2024-03-24 [1] CRAN (R 4.3.3)
shiny 1.8.1.1 2024-04-02 [1] CRAN (R 4.3.3)
sp * 2.1-4 2024-04-30 [1] CRAN (R 4.3.3)
stringi 1.8.4 2024-05-06 [1] CRAN (R 4.3.3)
stringr 1.5.1 2023-11-14 [1] CRAN (R 4.3.3)
units 0.8-5 2023-11-28 [1] CRAN (R 4.3.3)
urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.3.3)
usethis * 2.2.3 2024-02-19 [1] CRAN (R 4.3.3)
vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.3)
withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.3)
xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.3)

What should I do? I need the package for my bachelor degree.
Thank you.

INLA keeps on crashing

I have been trying to fit a spatial-temporal data and I keep on facing the error below, is there any solution to this?

Error in inla.inlaprogram.has.crashed() :
The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
If this does not help, please contact the developers at [email protected].

*** inla.core.safe: inla.program has crashed: rerun to get better initial values. try=1/2
Error in inla.inlaprogram.has.crashed() :
The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
If this does not help, please contact the developers at [email protected].

*** inla.core.safe: inla.program has crashed: rerun to get better initial values. try=2/2
Error in inla.inlaprogram.has.crashed() :
The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
If this does not help, please contact the developers at [email protected].
Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts, :
*** Fail to get good enough initial values. Maybe it is due to something else.

different DIC for the same model and data using two computers

I'm using a workstation for parallel computing of multiple INLA models, but when I'm checking the DIC of the best model using my laptop, I find a small difference in DIC between the two computers for the same model and data.

Then I update the INLA and R to the same version (v22.9.2 and v4.2.1), but the question is still there (the 2 screenshots below), did anybody encounters the same issue?

image
image

dsparseModelMatrix in R -- INLA

Hi there!

I have a question about this simple example presented on the website:

Reproducible example

library(INLA)
n = 100
a = 1
b = 1
tau = 100
z = rnorm(n)
eta = a + b * z

scale = exp(rnorm(n))
prec = scale * tau
y = rnorm(n, mean = eta, sd = 1 / sqrt(prec))

data = list(y = y, z = z)
formula = y ~ 1 + z
result = inla(formula, family = "gaussian", data = data)
Error in validObject(.Object) : 
  invalid classdsparseModelMatrixobject: superclass "xMatrix" not defined in the environment of the object's class

Am I missing something (dependencies or otherwise?)

Thanks for your amazing work ! :)

Issues with construction of mesh in INLA

Hello,
I am trying to fit a spatial model for which I need to construct a mesh. using the "inla.mesh2d" function.
Over the past year and up to this January I was able to construct the mesh without any problem.
However, since last week I started to get an error message:

" Error: 'wkt' is not an exported object from 'namespace:sp' "
(this is the full error message that I get)

This error message comes out even though the code that I use is exactly the same code that I have been using in the past year. In addition, I went back to the code that I used when I learnt INLA and I still find the same error message.

Originally, I thought that the problem was related to an error message associated to the packages "sp" or "rgdal" that appeared when I was converting coordinates from latitude-longitude to UTM. Today I have solved that issue but I still get the same error message. I suspect that there must have been an update in a package that affects all the subsequent analyses.

Another potentially important point: if I use
Bound<-inla.nonconvex.hull(......)
and
mesh1 <- inla.mesh.2d(boundary = Bound, .....)
I do not have any problem even though I converted the coordinates of the sampling locations to utm with the same code used to convert map coordinates from lat-long to UTM.

The problem arises when I try to use the coordinates of the sampling locations associated to a spatial polygon demarcating a coastal area that I created by converting lat-long coordinates to utm

Below, I am adding again the full error message, the traceback and the sessionInfo

Any help will be greatly appreciated
Regards,
Luis

FULL ERROR MESSAGE

" Error: 'wkt' is not an exported object from 'namespace:sp' "

Traceback#################################

traceback()>
13: stop(gettextf("'%s' is not an exported object from 'namespace:%s'",
name, getNamespaceName(ns)), call. = FALSE, domain = NA)
12: getExportedValue(pkg, name)
11: sp::wkt
10: CRS(SRS_string = sp::wkt(x))
9: withCallingHandlers(expr, warning = function(w) if (inherits(w,
classes)) tryInvokeRestart("muffleWarning"))
8: suppressWarnings(crs <- CRS(SRS_string = sp::wkt(x)))
7: inla.sp_get_crs(sp)
6: as.inla.mesh.segment.SpatialPolygons(segm)
5: as.inla.mesh.segment(segm)
4: inla.spTransform(as.inla.mesh.segment(segm), crs, passthrough = TRUE)
3: unify.one.segm(segm, crs = crs)
2: unify.segm.coords(boundary[[k]], crs = crs)
1: inla.mesh.2d(boundary = sps, max.edge = c(MaxEdge, MaxEdge *
5), cutoff = MaxEdge/5)

########################

Session info##

SessionInfo()

R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] parallel grid stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] readr_1.3.1 readxl_1.3.1 rgeos_0.5-5 mapdata_2.3.0 maptools_1.0-2 maps_3.3.0
[7] INLA_21.01.18 foreach_1.5.0 Matrix_1.2-18 dismo_1.3-3 raster_3.4-5 reshape_0.8.8
[13] ggmap_3.0.0 gstat_2.0-6 fields_11.6 spam_2.5-1 dotCall64_1.0-0 rgdal_1.5-21
[19] sp_1.4-1 ggplot2_3.3.3 lattice_0.20-41 ggeffects_1.0.1 gridExtra_2.3 bbmle_1.0.23.1

loaded via a namespace (and not attached):
[1] httr_1.4.1 tidyr_1.0.2 splines_4.0.3 assertthat_0.2.1 cellranger_1.1.0
[6] yaml_2.2.1 numDeriv_2016.8-1.1 pillar_1.4.4 glue_1.4.0 digest_0.6.25
[11] colorspace_1.4-1 plyr_1.8.6 pkgconfig_2.0.3 purrr_0.3.4 mvtnorm_1.1-0
[16] scales_1.1.0 intervals_0.15.2 jpeg_0.1-8.1 tibble_3.0.1 generics_0.0.2
[21] farver_2.0.3 sjlabelled_1.1.4 ellipsis_0.3.0 withr_2.2.0 cli_2.0.2
[26] magrittr_1.5 crayon_1.3.4 fansi_0.4.1 MASS_7.3-53 xts_0.12-0
[31] foreign_0.8-80 FNN_1.1.3 tools_4.0.3 hms_0.5.3 RgoogleMaps_1.4.5.3
[36] lifecycle_0.2.0 stringr_1.4.0 munsell_0.5.0 compiler_4.0.3 spacetime_1.2-3
[41] rlang_0.4.10 iterators_1.0.12 rstudioapi_0.11 rjson_0.2.20 bitops_1.0-6
[46] labeling_0.3 gtable_0.3.0 codetools_0.2-16 R6_2.4.1 splancs_2.01-40
[51] zoo_1.8-8 dplyr_1.0.2 bdsmatrix_1.3-4 insight_0.12.0 stringi_1.4.6
[56] Rcpp_1.0.4.6 vctrs_0.3.6 png_0.1-7 tidyselect_1.1.0

#########################################################################

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

sessionInfo()
R version 4.2.3 (2023-03-15 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_South Africa.utf8
[2] LC_CTYPE=English_South Africa.utf8
[3] LC_MONETARY=English_South Africa.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_South Africa.utf8

attached base packages:
[1] parallel stats graphics grDevices utils datasets
[7] methods base

other attached packages:
[1] INLA_99.99.9999 sp_1.6-0 foreach_1.5.2 Matrix_1.5-3
[5] devtools_2.4.5 usethis_2.1.6

loaded via a namespace (and not attached):
[1] Rcpp_1.0.10 compiler_4.2.3 later_1.3.0
[4] urlchecker_1.0.1 iterators_1.0.14 prettyunits_1.1.1
[7] profvis_0.3.7 remotes_2.4.2 tools_4.2.3
[10] digest_0.6.31 pkgbuild_1.4.0 pkgload_1.3.2
[13] lattice_0.20-45 memoise_2.0.1 lifecycle_1.0.3
[16] rlang_1.1.0 shiny_1.7.4 cli_3.6.1
[19] rstudioapi_0.14 curl_5.0.0 fastmap_1.1.1
[22] stringr_1.5.0 fs_1.6.1 vctrs_0.6.1
[25] htmlwidgets_1.6.2 grid_4.2.3 glue_1.6.2
[28] R6_2.5.1 processx_3.8.0 sessioninfo_1.2.2
[31] callr_3.7.3 purrr_1.0.1 magrittr_2.0.3
[34] splines_4.2.3 codetools_0.2-19 ps_1.7.4
[37] promises_1.2.0.1 ellipsis_0.3.2 htmltools_0.5.5
[40] mime_0.12 xtable_1.8-4 httpuv_1.6.9
[43] stringi_1.7.12 miniUI_0.1.1.1 cachem_1.0.7
[46] crayon_1.5.2

warning when saving inla object with saveRDS()

I'm getting the warning message 'package:stats' may not be available when loading.

I've narrowed the problem to be in three locations of the inla object.

Model[["all.hyper"]][["random"]][[1]][["hyper"]][["theta"]][["to.theta"]]
Model[["all.hyper"]][["random"]][[1]][["hyper"]][["theta"]][["from.theta"]]
Model[[".args"]][[".parent.frame"]]

suggestion use requireNamespace() directly instead of inla.require()

stopifnot(inla.require("sn"))

When the "sn" package is not available, this yields the puzzling error 'inla.require("sn") is not TRUE. I had to dive into the INLA source code to figure out what was going on.

Using stopifnot(requireNamespace("sn")) gives a more clear error message.

Loading required namespace: sn
Failed with error:  ‘there is no package called ‘sn’’
Error: requireNamespace("sn") is not TRUE

inla.set.hyper failure: length > 1 in coercion to logical

Running R with strict _R_CHECK_LENGTH_1_LOGIC2_=verbose, I get a

failure: length > 1 in coercion to logical

from the following line:

test.val = (!is.null(h) && !is.null(h[[key]]) && !(is.na(h[[key]])))

Debugging shows that in my example, h[["param"]] equals c(0, 0.001), so is a vector of length 2.
I guess the above code should thus be replaced by something like

test.val = !is.null(h) && !is.null(h[[key]]) && any(!is.na(h[[key]]))

INLA installation failed

Failed to install from "inla.r-inla-download.org", then try to install it from github with the code below:

devtools::install_github(repo = "https://github.com/hrue/r-inla", ref = "stable", subdir = "rinla", build = FALSE)

It failed as well:

* DONE (INLA)
Warning message:
In utils::untar(tarfile, ...) :
  ‘tar.exe -xf "C:\Users\xxxxx\AppData\Local\Temp\RtmpAdmrzK\file608cd765616.tar.gz" -C "C:/Users/xxxx/AppData/Local/Temp/RtmpAdmrzK/remotes608c3522867"’ returned error code 1

Any suggestions how to fix it?
Thanks!

How can I get the sd of a categorical factor in INLA model

Hi,

I'm computing the contributions of different factors in a model, so all continuous factors were normalized and the mean of the slope was used for the calculation of factor contribution.

To get the sd of one categorical factor (as the contribution), I put the categorical factor in "iid" model: y ~ X1 + f(X2, model = "iid"), then get the sd by bri.hyperpar.summary(model), is it the correct way to get the contribution of X2?

Best,
Xinru

executable permission setting preventing use by users on multi-user Linux system

We're installing INLA on a Linux cluster, via install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE), which installs the binary package.

When users try to use it, they get a permission denied error for inla.mkl.run and other INLA executables.

The permissions for the inla and fmesher executables in bin/linux/64bit in the installed package are set to 744 rather than being set to 755. I see that in r-inla/utils/R/updateBin line 10, you change to 755, but perhaps something is causing this not to be done when building the binary package?

Consider providing R Universe builds for INLA?

Hi there,

I was wondering if you might be interested in providing R Universe builds for INLA?

The R Universe (https://ropensci.org/r-universe/) would provide CRAN-like binaries of INLA for windows + mac, and linux from source.

Obviously you've already got a setup at https://inla.r-inla-download.org/R/stable, but I just thought this might be of use/interest. Jeroen, the maintainer of the r universe project gave a talk about this recently at an rOpenSci community call: https://ropensci.org/commcalls/may2021-r-universe/

Thanks again for creating and maintaining INLA!

INLA installation error; no such file redux

I've seen this error floating around, have tried a couple things I've seen from googling (installing from command line, making sure I have the latest version of R, etc), curious if there are any fixes.

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

Session info:

R version 4.1.2 (2021-11-01)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bigrquery_1.4.0 mgcv_1.8-40     nlme_3.1-159    INLA_22.08.24   sp_1.5-0        foreach_1.5.2   Matrix_1.4-1   

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9        pillar_1.8.1      compiler_4.1.2    dbplyr_2.2.1      prettyunits_1.1.1 progress_1.2.2    iterators_1.0.14  tools_4.1.2      
 [9] bit_4.0.4         jsonlite_1.8.0    lifecycle_1.0.1   tibble_3.1.8      gargle_1.2.0      lattice_0.20-45   pkgconfig_2.0.3   rlang_1.0.4      
[17] DBI_1.1.3         cli_3.3.0         rstudioapi_0.14   curl_4.3.2        withr_2.5.0       httr_1.4.4        dplyr_1.0.9       hms_1.1.2        
[25] askpass_1.1       rappdirs_0.3.3    generics_0.1.3    vctrs_0.4.1       fs_1.5.2          tidyselect_1.1.2  bit64_4.0.5       grid_4.1.2       
[33] glue_1.6.2        R6_2.5.1          fansi_1.0.3       tzdb_0.3.0        readr_2.1.2       purrr_0.3.4       magrittr_2.0.3    ellipsis_0.3.2   
[41] codetools_0.2-18  splines_4.1.2     assertthat_0.2.1  utf8_1.2.2        openssl_2.0.2     crayon_1.5.1     

INLA crashes across environments

Hiya, me again. Still having troubles. Pardon if it's user error. I would be happy to get INLA to run in any of these environments.

The Issue

Trying to run INLA across several operating systems, I fail to retrieve a model estimate even for just test code. I am running off of the INLA version 23.11.26 and have tried both stable and testing releases.

Minimal Working Example & Environments

Here is the code with which I can reliable create the INLA crashes:

library(INLA)

n = 100; a = 1; b = 1; tau = 100
z = rnorm(n)
eta = a + b*z

scale = exp(rnorm(n))
prec = scale*tau
y = rnorm(n, mean = eta, sd = 1/sqrt(prec))

data = list(y=y, z=z)
formula = y ~ 1+z
result = inla(formula, family = "gaussian", data = data, verbose = TRUE)

MacOS

I have already reported my issue on MacOS (issue #87). As far as I can tell, the fix promised there has been made as a commit, but not added to any new release yet.

In the meantime, I looked deeper into this issue and believe that even the new fix may not solve this issue as it seems Intel MKL is not available for M2 chips.

Trying to retrieve mkl from conda:

conda install -c conda-forge mkl

I am met with this error:

Channels:
 - conda-forge
 - defaults
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - mkl

Current channels:

  - https://conda.anaconda.org/conda-forge
  - defaults

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Windows

Switching to a windows server:

R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server 2019 x64 (build 17763)

INLA crashes without an informative output despite running with verbose = TRUE:

Error in inla.inlaprogram.has.crashed() : 
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does not help, please contact the developers at <[email protected]>.

HPC

Finally, in an HPC environment of these specifications:

Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-147-generic aarch64)
R/4.2.2-foss-2022b

and running inla.binary.install(), then selecting the following option:

Alternative 5  is  ./Ubuntu-22.04.3 LTS (Jammy Jellyfish)/Version_23.11.26/64bit.tgz
* Install file [https://inla.r-inla-download.org/Linux-builds/./Ubuntu-22.04.3 LTS (Jammy Jellyfish)/Version_23.11.26/64bit.tgz]
* INLA is installed in [/home/erikkus/R/aarch64-unknown-linux-gnu-library/4.2/INLA]
* Checking for write access...
* Download file, please wait...
* md5-checksum [fd45cc5a4785dcc9eb817e98b65c2aa6] OK.
* Rename old 64bit directory...
* Unpack file...
* Remove temporary file...
* Remove old 64bit directory...
* Done!

I receive a different error that I cannot parse or resolve, I am afraid:

ERROR: ld.so: object '/home/erikkus/R/aarch64-unknown-linux-gnu-library/4.2/INLA/bin/linux/64bit/first/libjemalloc.so.2' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
/home/erikkus/R/aarch64-unknown-linux-gnu-library/4.2/INLA/bin/linux/64bit/inla.mkl.run: line 64: /home/erikkus/R/aarch64-unknown-linux-gnu-library/4.2/INLA/bin/linux/64bit/inla.mkl: cannot execute binary file: Exec format error
/home/erikkus/R/aarch64-unknown-linux-gnu-library/4.2/INLA/bin/linux/64bit/inla.mkl.run: line 70: /home/erikkus/R/aarch64-unknown-linux-gnu-library/4.2/INLA/bin/linux/64bit/inla.mkl: cannot execute binary file: Exec format error
/home/erikkus/R/aarch64-unknown-linux-gnu-library/4.2/INLA/bin/linux/64bit/inla.mkl.run: line 70: /home/erikkus/R/aarch64-unknown-linux-gnu-library/4.2/INLA/bin/linux/64bit/inla.mkl: Success
Error in inla.inlaprogram.has.crashed() :
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does not help, please contact the developers at <[email protected]>.

[Improvement] Adding censored (cenpoisson2-like) negative binomial likelihood ?

Dear INLA Team,

First of all, thank you very much for your package and all your work to make it quite easy to use/understand.

There have been some work showing that for modelling infectious diseases, negative binomial might be better than poisson.

I'd like to use INLA in this context and therefore use this density function for the likelihood. However, I have censored data (each of the 100+ area having its own censorship).

I was thus wondering if it would be possible, despite the very peculiar demand, to append the package to provide as additional likelihood a censored version (cenpoisson2-like) for negative binomial (and maybe other zero-inflated likelihood, because I assume zeroinflatedcenpoisson0/1 are cenpoisson1-like) ?

That would be greatly appreciated and expand the use of R INLA to different data context.

Best,
Olivier

Example of a spatio-temporal model that continues to crash

I'm trying to fit a spatio-temporal model, but I keep getting the following error,
I added the code "verbose=TRUE" and the result is as follows.

### _*** inla.core.safe: inla.program has crashed: rerun to get better initial values. try=1/2
Read ntt 4 1 with max.threads 8
Found num.threads = 4:1 max_threads = 4

file: src/inla.c  eabef9f0c5191d7287b59145b03d23ae93e5728b - Sat May 7 11:06:00 2022 +0300

Report bugs to [email protected]
Set reordering to id=[0] and name=[default]
Process file[C:\Users\m'w'w\AppData\Local\Temp\RtmpesT6x5\file68d46955210f/Model.ini] threads[4] max.threads[8] blas_threads[1] nested[4:1]
inla_build...
number of sections=[13]
parse section=[0] name=[INLA.libR] type=[LIBR]
inla_parse_libR...
section[INLA.libR]
R_HOME=[E:/R-4.3.0]
parse section=[10] name=[INLA.Expert] type=[EXPERT]
inla_parse_expert...
section[INLA.Expert]
disable.gaussian.check=[0]
cpo.manual=[0]
jp.file=[(null)]
jp.model=[(null)]
parse section=[1] name=[INLA.Model] type=[PROBLEM]
inla_parse_problem...
name=[INLA.Model]
R-INLA version = [22.05.07]
R-INLA build date = [Sat May 7 12:43:31 PM +03 2022 (Version_22.05.07)]
Build tag = [Version_22.05.07]
System memory = [7.8Gb]
openmp.strategy=[default]
pardiso-library installed and working? = [no]
smtp = [taucs]
strategy = [default]
store results in directory=[C:\Users\m'w'w\AppData\Local\Temp\RtmpesT6x5\file68d46955210f/results.files]
output:
gcpo=[0]
gcpo.group.size=[-1]
gcpo.correct.hyperpar=[1]
gcpo.epsilon=[0.005]
cpo=[0]
po=[0]
dic=[0]
kld=[1]
mlik=[1]
q=[0]
graph=[0]
hyperparameters=[1]
summary=[1]
return.marginals=[0]
return.marginals.predictor=[0]
nquantiles=[3] [ 0.025 0.5 0.975 ]
ncdf=[0] [ ]
parse section=[3] name=[Predictor] type=[PREDICTOR]
inla_parse_predictor ...
section=[Predictor]
dir=[predictor]
PRIOR->name=[loggamma]
hyperid=[53001|Predictor]
PRIOR->from_theta=[function (x) <>exp(x)]
PRIOR->to_theta = [function (x) <>log(x)]
PRIOR->PARAMETERS=[1, 1e-05]
initialise log_precision[13.8155]
fixed=[1]
user.scale=[1]
vb.correct=[0]
n=[1793]
m=[0]
ndata=[1793]
compute=[0]
read offsets from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56]
read n=[3586] entries from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56]
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 0/1793 (idx,y) = (0, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 1/1793 (idx,y) = (1, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 2/1793 (idx,y) = (2, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 3/1793 (idx,y) = (3, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 4/1793 (idx,y) = (4, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 5/1793 (idx,y) = (5, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 6/1793 (idx,y) = (6, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 7/1793 (idx,y) = (7, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 8/1793 (idx,y) = (8, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d426ac7c56] 9/1793 (idx,y) = (9, 0)
A=[(null)]
Aext=[(null)]
AextPrecision=[1e+08]
output:
summary=[1]
return.marginals=[0]
return.marginals.predictor=[0]
nquantiles=[3] [ 0.025 0.5 0.975 ]
ncdf=[0] [ ]
parse section=[2] name=[INLA.Data1] type=[DATA]
inla_parse_data [section 1]...
tag=[INLA.Data1]
family=[POISSON]
likelihood=[POISSON]
file->name=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d43fa05125]
file->name=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d459983b24]
file->name=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d4604f4881]
file->name=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d450022653]
read n=[5379] entries from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d43fa05125]
mdata.nattributes = 0
0/1793 (idx,a,y,d) = (0, 16.4364, 13, 1)
1/1793 (idx,a,y,d) = (1, 8.26462, 2, 1)
2/1793 (idx,a,y,d) = (2, 21.1723, 19, 1)
3/1793 (idx,a,y,d) = (3, 53.0236, 37, 1)
4/1793 (idx,a,y,d) = (4, 162.042, 97, 1)
5/1793 (idx,a,y,d) = (5, 65.7455, 65, 1)
6/1793 (idx,a,y,d) = (6, 17.7364, 15, 1)
7/1793 (idx,a,y,d) = (7, 67.6028, 69, 1)
8/1793 (idx,a,y,d) = (8, 15.7864, 13, 1)
9/1793 (idx,a,y,d) = (9, 33.6157, 20, 1)
likelihood.variant=[0]
Link model [LOG]
Link order [-1]
Link variant [-1]
Link a [1]
Link ntheta [0]
mix.use[0]
parse section=[5] name=[ID.area] type=[FFIELD]
inla_parse_ffield...
section=[ID.area]
dir=[random.effect00000001]
model=[bym]
PRIOR0->name=[loggamma]
hyperid=[10001|ID.area]
PRIOR0->from_theta=[function (x) <>exp(x)]
PRIOR0->to_theta = [function (x) <>log(x)]
PRIOR0->PARAMETERS0=[1, 0.0005]
PRIOR1->name=[loggamma]
hyperid=[10002|ID.area]
PRIOR1->from_theta=[function (x) <>exp(x)]
PRIOR1->to_theta = [function (x) <>log(x)]
PRIOR1->PARAMETERS1=[1, 0.0005]
vb.correct=[-1]
correct=[-1]
constr=[0]
diagonal=[0.0001]
id.names=
compute=[1]
nrep=[1]
ngroup=[1]
read covariates from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0]
read n=[3586] entries from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0]
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 0/1793 (idx,y) = (0, 118)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 1/1793 (idx,y) = (1, 138)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 2/1793 (idx,y) = (2, 54)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 3/1793 (idx,y) = (3, 104)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 4/1793 (idx,y) = (4, 154)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 5/1793 (idx,y) = (5, 22)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 6/1793 (idx,y) = (6, 143)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 7/1793 (idx,y) = (7, 145)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 8/1793 (idx,y) = (8, 40)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d44d9bac0] 9/1793 (idx,y) = (9, 60)
read graph from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d443c02bb7]
file for locations=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d46737f78]
nlocations=[163]
locations[0]=[1]
locations[1]=[2]
locations[2]=[3]
locations[3]=[4]
locations[4]=[5]
locations[5]=[6]
locations[6]=[7]
locations[7]=[8]
locations[8]=[9]
locations[9]=[10]
initialise log_precision (iid component)[4]
fixed=[0]
initialise log_precision (spatial component)[4]
fixed=[0]
adjust.for.con.comp[1]
scale.model[0]
read extra constraint from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d43f271c5d]
Constraint[0]
A[163] = 1.000000
A[164] = 1.000000
A[165] = 1.000000
A[166] = 1.000000
A[167] = 1.000000
A[168] = 1.000000
A[169] = 1.000000
A[170] = 1.000000
A[171] = 1.000000
A[172] = 1.000000
A[173] = 1.000000
e[0] = 0.000000
rank-deficiency is defined [1]
output:
summary=[1]
return.marginals=[0]
return.marginals.predictor=[0]
nquantiles=[3] [ 0.025 0.5 0.975 ]
ncdf=[0] [ ]
parse section=[6] name=[ID.year] type=[FFIELD]
inla_parse_ffield...
section=[ID.year]
dir=[random.effect00000002]
model=[rw1]
PRIOR->name=[loggamma]
hyperid=[4001|ID.year]
PRIOR->from_theta=[function (x) <>exp(x)]
PRIOR->to_theta = [function (x) <>log(x)]
PRIOR->PARAMETERS=[1, 5e-05]
vb.correct=[-1]
correct=[-1]
constr=[1]
diagonal=[0.0001]
id.names=
compute=[1]
nrep=[1]
ngroup=[1]
read covariates from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49]
read n=[3586] entries from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49]
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 0/1793 (idx,y) = (0, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 1/1793 (idx,y) = (1, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 2/1793 (idx,y) = (2, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 3/1793 (idx,y) = (3, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 4/1793 (idx,y) = (4, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 5/1793 (idx,y) = (5, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 6/1793 (idx,y) = (6, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 7/1793 (idx,y) = (7, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 8/1793 (idx,y) = (8, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d427754e49] 9/1793 (idx,y) = (9, 0)
file for locations=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d4970fdc]
nlocations=[11]
locations[0]=[1]
locations[1]=[2]
locations[2]=[3]
locations[3]=[4]
locations[4]=[5]
locations[5]=[6]
locations[6]=[7]
locations[7]=[8]
locations[8]=[9]
locations[9]=[10]
cyclic=[0]
initialise log_precision[4]
fixed=[0]
scale.model[0]
computed/guessed rank-deficiency = [1]
output:
summary=[1]
return.marginals=[0]
return.marginals.predictor=[0]
nquantiles=[3] [ 0.025 0.5 0.975 ]
ncdf=[0] [ ]
parse section=[7] name=[ID.year1] type=[FFIELD]
inla_parse_ffield...
section=[ID.year1]
dir=[random.effect00000003]
model=[iid]
PRIOR->name=[loggamma]
hyperid=[1001|ID.year1]
PRIOR->from_theta=[function (x) <>exp(x)]
PRIOR->to_theta = [function (x) <>log(x)]
PRIOR->PARAMETERS=[1, 5e-05]
vb.correct=[-1]
correct=[-1]
constr=[0]
diagonal=[0]
id.names=
compute=[1]
nrep=[1]
ngroup=[1]
read covariates from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d435135e8f]
read n=[3586] entries from file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d435135e8f]
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d435135e8f] 0/1793 (idx,y) = (0, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d435135e8f] 1/1793 (idx,y) = (1, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d435135e8f] 2/1793 (idx,y) = (2, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d435135e8f] 3/1793 (idx,y) = (3, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d435135e8f] 4/1793 (idx,y) = (4, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/data.files/file68d435135e8f] 5/1793 (idx,y) = (5, 0)
file=[C:/Users/m'w'w/AppData/Local/Temp/RtmpesT6x5/file68d46955210f/dError in inla.inlaprogram.has.crashed() :
The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
If this does not help, please contact the developers at [email protected]._

Running crashed

Hi all,

I am a beginner with R-inla. I try to use an R package named gINLAnd which needs the R-inla installed.
I'm using R 4.1.0 in windows 10. The R-inla was installed following this website: https://www.r-inla.org/download-install. And the testing version was chosen.
Everything seems fine when installing and testing the two packages. But something was wrong when I tried to use the gINLAnd package.
The error message said: "*** ERROR *** Dimension of the MVNORM prior is not equal to number of used hyperparameters: 1 != 0". But I can't find a similar question in the group, so anyone could help me with this?

Thanks in advance!

Increase minimum version of Matrix to >= 1.6-2

I recently encountered test failures in abn, which is relying on INLA. These tests were functioning correctly a couple of weeks ago, indicating that the issue is relatively recent.

Apparently, other users seem to experience similar problems with INLA. The root cause appears to be a change in the ABI within the Matrix package, a dependency of INLA. This has been discussed in a SO answer, suggesting the solution to upgrade Matrix and MatrixModels.

Therefore, I suggest an update to the INLA package dependencies. Specifically, to increase the minimum version of the Matrix package to >= 1.6-2:

Matrix (>= 1.3-0),

I look forward to hearing your thoughts on this proposed solution.

spatio-temporal model - inla keeps crashing

Hi,
I have a spatio-temporal model that keeps crashing. I am using a grid of num [1:5293, 1:240]

The error I get is :

inla.mkl: src/inla.c:23905: inla_parse_ffield: Assertion `def->n > 1' failed.
Error in inla.inlaprogram.has.crashed() :
The inla-program exited with an error. Unless you interupted it yourself, ple$
If this does not help, please contact the developers at [email protected].
Calls: inla -> inla.inlaprogram.has.crashed
Execution halted

My code snippet is below:
df.st = data.frame(obs = as.vector(grid.data[,t]),
x = rep(grid.values$x, length(t)),
y = rep(grid.values$y, length(t)),
t = rep(t,each=(nrow(grid.values))),
dist_green = rep(dist_green_bycell, length(t)),
dist_mainroad = rep(dist_mainroad_bycell, length(t)),
dist_water=rep(dist_water_bycell,length(t)),
dist_playground=rep(dist_playground_bycell,length(t)),
dist_settlements=rep(dist_settlements_bycell,length(t)),
Population = rep(grid.values$Population, length(t)))

formula = obs ~ -1 + Intercept + f(spatial.field, model = spde) + f(t, model='ar1') + offset(log(Population)) + dist_green+dist_mainroad + dist_water + dist_playground + dist_settlements

#Stack creation and inla analysis
s.index <- inla.spde.make.index(name="spatial.field", n.spde=spde$n.spde)
A.est = inla.spde.make.A(mesh=mesh,
loc=as.matrix(df.st[,c("x","y")]))
stack.est = inla.stack(data=list(obs=df.st$obs),
A=list(A.est,
1),
effects=list(c(s.index, list(Intercept=1)),
list(df.st[,-1])),
tag='stdata')

output5 = inla(formula,
data=inla.stack.data(stack.est),
family="poisson",
control.predictor=list(A=inla.stack.A(stack.est), compute =FALSE),
control.fixed=list(expand.factor.strategy='inla'),
#control.compute=list(config = TRUE, dic = TRUE, waic = TRUE),
verbose=TRUE)

Poisson INLA model fails for large datasets

Hi,

A colleague and I are trying to build an INLA model with a dataset of ~3 million samples and 4 features. INLA fails with the error:

Error in inla.inlaprogram.has.crashed() : 
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does not help, please contact the developers at <[email protected]>.
Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts,  : 
  *** Fail to get good enough initial values. Maybe it is due to something else. 

After a bit of testing, we have found that a dataset of approx 100k samples will train okay, but 200k will not. I initially thought the issue was memory related, but it's not as the error persists over multiple machines with different amounts of memory up to 128Gb, and the upper limit of samples is always the same. I tried running the model with verbose=TRUE as suggested, but there are no errors shown in the resulting output. Curiously, if we generate a model with no predictors (ie run inla(y ~ 1, family = "poisson", ... ) there are no errors and everything works fine.

Is there some internal limit that we are running into? Thanks in advance.

R version: 4.2.2
INLA version: 22.4.16 sp_1.5-1

Minimal code to reproduce the error (mostly lifted from the tutorial):

library(INLA)

n = 200000
x = runif(n)
eta = 1 + x
lambda = exp(eta)
y = rpois(n, lambda = lambda)

r = inla(y ~ 1 + x,  family = "poisson",        
         data = data.frame(y, x),          
         control.predictor = list(link = 1), verbose = TRUE)

Problems with INLA installation

Hi

I have a problem installing the INLA package. I get the following error:

_* installing binary package 'INLA' ...
cp: unknown option -- )
Try '/usr/bin/cp --help' for more information.
ERROR: installing binary package failed

  • removing 'C:/Program Files/R/R-4.0.2/library/INLA'
    Warning in install.packages :
    installation of package ‘INLA’ had non-zero exit status
    The downloaded source packages are in
    ‘C:\Users\U80864263\AppData\Local\Temp\Rtmp69tlBB\downloaded_packages’_

I used the following command to try to install it:

install.packages("INLA", repos=c(getOption("repos"), INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)

In the given path (......\downloaded_packages), there is an INLA_21.11.22.tar.gz file (81.7 Mb).

Do you know how I could solve this problem?

Best wishes

Issues with running R-INLA on Redhat linux 8 Server

The servers that we were running an R script for INLA on were recently updated to Redhat Enterprise Linux 8, and now were having issues running the INLA package. We are able to run all the functions for running a model but when we run the inla function in R we get the following error.

results4 <- inla(formula4,

  •              family = 'binomial',
    
  •              control.family = list(link = 'logit'),
    
  •              data = inla.stack.data(stack),
    
  •              control.predictor = list(
    
  •                A = inla.stack.A(stack),
    
  •                compute = T, link = 1 # compute = T enables the fitted.values calculation, link = 1
    
  •              ),
    
  •              control.inla = list(int.strategy = 'eb'),
    
  •              verbose = T,
    
  •              control.compute = list(dic = T,cpo = T))
    

crypto/fips/fips.c:154: OpenSSL internal error: FATAL FIPS SELFTEST FAILURE
crypto/fips/fips.c:154: OpenSSL internal error: FATAL FIPS SELFTEST FAILURE

*** inla.core.safe: The inla program failed, but will rerun in case better initial values may help. try=1/1
crypto/fips/fips.c:154: OpenSSL internal error: FATAL FIPS SELFTEST FAILURE
crypto/fips/fips.c:154: OpenSSL internal error: FATAL FIPS SELFTEST FAILURE
Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts, :
The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
If this does not help, please contact the developers at [email protected].
The inla program failed and the maximum number of tries has been reached.
Calls: inla -> inla.core.safe
Execution halted

I am not sure if the issues stem from on of the other steps that we took when installing the INLA package. We installed INLA.
library (INLA)
inla.binary.install()

After that in the server we deleted some of the Lib files in 64bit since they were conflicts.

Any help would be appreciated.

inla.mode "twostage" log-posterior problem

The $misc$configs output appears to have incorrect values for log.posterior for each config for inla.mode="twostage", with the output being NaN when int.strategy="eb". There's also some interaction with the num.threads setting for int.strategy="ccd", where the result is either NaN or values that do not agree with the other two inla.mode settings.

The problem was initially detected by an error message (seen below) from inla.posterior.sample, and appears for all models I've tested, including the simple intercept-only model in the example below, so it appears to be a universal issue.
The hyperparameter and effect estimates appear to be consistent across theinla.mode settings for the test example, so it's possible the error is only in the output and not in the values used internally for computing the posterior.

data <- data.frame(y = rnorm(4))
for (num.threads in list(NULL, "1:1")) {
  for (int.strategy in c("eb", "ccd")) {
    cat("\n--------------------------------------------\n")
    cat("num.threads = ", ifelse(is.null(num.threads), "NULL", num.threads), "\n",
        sep = "")
    cat("int.strategy = ", int.strategy, "\n", sep = "")
    fit <- list()
    for (mode in c("classic", "twostage", "experimental")) {
      fit[[mode]] <-
        INLA::inla(y ~ 1, data = data, family = "normal",
                   control.compute = list(config = TRUE),
                   control.inla = list(int.strategy = int.strategy),
                   inla.mode = mode,
                   num.threads = num.threads)
      
      cat("inla.mode = ", mode, "\n", sep = "")
      try({samp <- INLA::inla.posterior.sample(1, fit[[mode]])})
    }
    
    cat("config log.posterior values for int.strategy = ", int.strategy,
        ":\n", sep = "")
    print(
      as.data.frame(
        lapply(fit,
               function(x) vapply(x$misc$configs$config,
                                  function(y) {
                                    y$log.posterior
                                  },
                                  0.0)
        )
      )
    )
    cat("config log.posterior.orig values for int.strategy = ", int.strategy,
        ":\n", sep = "")
    print(
      as.data.frame(
        lapply(fit,
               function(x) vapply(x$misc$configs$config,
                                  function(y) {
                                    y$log.posterior.orig
                                  },
                                  0.0)
        )
      )
    )
  }
}
#> 
#> --------------------------------------------
#> num.threads = NULL
#> int.strategy = eb
#> inla.mode = classic
#> inla.mode = twostage
#> Error in sample.int(x, size, replace, prob) : NA in probability vector
#> inla.mode = experimental
#> config log.posterior values for int.strategy = eb:
#>   classic twostage experimental
#> 1       0      NaN            0
#> config log.posterior.orig values for int.strategy = eb:
#>   classic twostage experimental
#> 1       0      NaN            0
#> 
#> --------------------------------------------
#> num.threads = NULL
#> int.strategy = ccd
#> inla.mode = classic
#> inla.mode = twostage
#> Error in sample.int(length(x), size, replace, prob) : 
#>   NA in probability vector
#> inla.mode = experimental
#> config log.posterior values for int.strategy = ccd:
#>      classic twostage experimental
#> 1  0.0000000      NaN    0.0000000
#> 2 -0.6810429      NaN   -0.6810417
#> 3 -0.4589137      NaN   -0.4589142
#> config log.posterior.orig values for int.strategy = ccd:
#>      classic twostage experimental
#> 1  0.0000000      NaN    0.0000000
#> 2 -0.6810429      NaN   -0.6810417
#> 3 -0.4589137      NaN   -0.4589142
#> 
#> --------------------------------------------
#> num.threads = 1:1
#> int.strategy = eb
#> inla.mode = classic
#> inla.mode = twostage
#> Error in sample.int(x, size, replace, prob) : NA in probability vector
#> inla.mode = experimental
#> config log.posterior values for int.strategy = eb:
#>   classic twostage experimental
#> 1       0      NaN            0
#> config log.posterior.orig values for int.strategy = eb:
#>   classic twostage experimental
#> 1       0      NaN            0
#> 
#> --------------------------------------------
#> num.threads = 1:1
#> int.strategy = ccd
#> inla.mode = classic
#> inla.mode = twostage
#> inla.mode = experimental
#> config log.posterior values for int.strategy = ccd:
#>      classic  twostage experimental
#> 1  0.0000000 -2.274211    0.0000000
#> 2 -0.6808295 -2.733444   -0.6807928
#> 3 -0.4591909 -2.955006   -0.4592375
#> config log.posterior.orig values for int.strategy = ccd:
#>      classic  twostage experimental
#> 1  0.0000000  0.000000    0.0000000
#> 2 -0.6808295 -1.931733   -0.6807928
#> 3 -0.4591909 -2.153295   -0.4592375

Created on 2021-08-26 by the reprex package (v2.0.1)

INLA not being installed properly on OSX when installing R from homebrew

Hello,

If I install INLA using the command:

install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/testing"), dep=TRUE)

from inside R that was installed from homebrew (default installation folder being /opt/homebrew/Cellar/r/4.3.1/lib/R), then INLA is not installed properly. Indeed, I get the same behavior that I have seen in the past in r-hub, etc., where that suggestion to use inla.prune() appears, together with the message "inla installation error".

By looking at INLA's installation folder, it seems the linux version was installed. Indeed, it seems to be corroborated by looking at the file it downloads when installing INLA by using an R installation from homebrew. Indeed, I get:

tentando a URL 'https://inla.r-inla-download.org/R/testing/src/contrib/INLA_23.11.01.tar.gz'
Content type 'application/x-gzip' length 76408272 bytes (72.9 MB)

whereas when I install INLA by using an R installation from CRAN's .pkg file, I get:

tentando a URL 'https://inla.r-inla-download.org/R/testing/bin/macosx/big-sur-arm64/contrib/4.3/INLA_23.11.01.tgz'
Content type 'application/x-tar' length 45415739 bytes (43.3 MB)

which seems to be the correct address to download it.

Thank you.

Best,
Alexandre

build R-INLA from source without binaries

Hi,
In the directory build-user/linux/Makefile I see that some dependencies are being downloaded as binaries.
I'd like to install R-INLA from source, separately, without any binaries stepping in, while taking care of extensions myself (building them from source as well).
Is there a way to skip downloading all these dependency binary files? Also, is there a file which lists all dependencies and their versions (just like there are typically in conda-recipe/meta.yaml for anaconda or requirements.txt for pip)?

fyi, the purpose of this is to include possibility to build R-INLA with EasyBuild - see https://github.com/easybuilders/easybuild,
where we try to build everything from source - including dependencies.

thank you very much!

new code uses `requireNamespace(package = INLAspacetime)` leads to Error

8dd7068 introduced the use of requireNamespace(package = INLAspacetime) instead of require(package = INLAspacetime). Where, requireNamespace does not allow non-character objects being passed to the package argument. I am getting the following error when using the development version of INLA:

Error in as.character(package) : 
  cannot coerce type 'closure' to vector of type 'character'
I am on a windows machine see `sessionInfo()` by expanding
sessionInfo() 
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

time zone: America/Los_Angeles
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
 [1] INLA_23.06.12          VAST_3.10.1            TMB_1.9.4
 [4] INLAspacetime_0.1.6    sp_1.6-1               Matrix_1.5-4.1
 [7] sablefish_0.0.0.9000   FishStatsUtils_2.12.1  marginaleffects_0.12.0
[10] units_0.8-2            testthat_3.1.8         devtools_2.4.5
[13] usethis_2.2.0

loaded via a namespace (and not attached):
 [1] DBI_1.1.3               remotes_2.4.2           rlang_1.1.1
 [4] magrittr_2.0.3          snakecase_0.11.0        e1071_1.7-13
 [7] compiler_4.3.0          systemfonts_1.0.4       callr_3.7.3
[10] vctrs_0.6.2             reshape2_1.4.4          stringr_1.5.0
[13] profvis_0.3.8           pkgconfig_2.0.3         crayon_1.5.2
[16] fastmap_1.1.1           ellipsis_0.3.2          labeling_0.4.2
[19] utf8_1.2.3              promises_1.2.0.1        sessioninfo_1.2.2
[22] ps_1.7.5                ragg_1.2.5              purrr_1.0.1
[25] cachem_1.0.8            jsonlite_1.8.5          pak_0.5.1
[28] later_1.3.1             parallel_4.3.0          prettyunits_1.1.1
[31] R6_2.5.1                stringi_1.7.12          pkgload_1.3.2
[34] brio_1.1.3              lubridate_1.9.2         Rcpp_1.0.10
[37] nwfscSurvey_2.1         httpuv_1.6.11           splines_4.3.0
[40] timechange_0.2.0        tidyselect_1.2.0        rnaturalearth_0.3.3
[43] rstudioapi_0.14         miniUI_0.1.1.1          curl_5.0.1
[46] processx_3.8.1          pkgbuild_1.4.0          lattice_0.21-8
[49] tibble_3.2.1            plyr_1.8.8              shiny_1.7.4
[52] withr_2.5.0             VASTWestCoast_1.1.6     splancs_2.01-43
[55] desc_1.4.2              sf_1.0-13               rnaturalearthdata_0.1.0
[58] proxy_0.4-27            urlchecker_1.0.1        pillar_1.9.0
[61] KernSmooth_2.23-21      generics_0.1.3          rprojroot_2.0.3
[64] ggplot2_3.4.2           munsell_0.5.0           scales_1.2.1
[67] rgdal_1.6-7             chron_2.3-61            xtable_1.8-4
[70] class_7.3-22            glue_1.6.2              janitor_2.2.0
[73] tools_4.3.0             data.table_1.14.8       RANN_2.6.1
[76] fs_1.6.2                cowplot_1.1.1           grid_4.3.0
[79] colorspace_2.1-0        cli_3.6.1               textshaping_0.3.6
[82] fansi_1.0.4             dplyr_1.1.2             gtable_0.3.3
[85] digest_0.6.31           classInt_0.4-9          htmlwidgets_1.6.2
[88] farver_2.1.1            memoise_2.0.1           htmltools_0.5.5
[91] lifecycle_1.0.3         httr_1.4.6              mime_0.12
And, I am using the development version because I have R 4.3 installed and there is no stable version for this version of R as of yet.

Latest testing version 22.10.05 crashes

The latest testing version seems to be broken.

library(INLA)

## Le chargement a nécessité le package : Matrix
## Le chargement a nécessité le package : foreach
## Le chargement a nécessité le package : parallel
## Le chargement a nécessité le package : sp
## This is INLA_22.10.05 built 2022-10-05 12:59:18 UTC.
## - See www.r-inla.org/contact-us for how to get help.

r = inla(y ~ 1 ,data = data.frame(y=rnorm(100)), control.compute = list(config=TRUE))

## Error in inla.inlaprogram.has.crashed() : 
##   The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output ##  carefully.
##    If this does not help, please contact the developers at <[email protected]>.

##   *** inla.core.safe:  inla.program has crashed: rerun to get better initial values. try=1/2 
##  Error in inla.inlaprogram.has.crashed() : 
##    The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output ##  carefully.
##    If this does not help, please contact the developers at <[email protected]>.

##   *** inla.core.safe:  inla.program has crashed: rerun to get better initial values. try=2/2 
##  Error in inla.inlaprogram.has.crashed() : 
##    The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output ##  carefully.
##    If this does not help, please contact the developers at <[email protected]>.
##  Erreur dans inla.core.safe(formula = formula, family = family, contrasts = contrasts,  : 
##    *** Fail to get good enough initial values. Maybe it is due to something else.

sessionInfo()

## R version 4.2.1 (2022-06-23 ucrt)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 17763)

##  Matrix products: default

##  locale:
##  [1] LC_COLLATE=French_Canada.1252  LC_CTYPE=French_Canada.1252    LC_MONETARY=French_Canada.1252 LC_NUMERIC=C                   ##  LC_TIME=French_Canada.1252    

##  attached base packages:
##  [1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

##  other attached packages:
##  [1] INLA_22.10.05 sp_1.5-0      foreach_1.5.2 Matrix_1.4-1 

##  loaded via a namespace (and not attached):
##  [1] compiler_4.2.1     tools_4.2.1        MatrixModels_0.5-0 splines_4.2.1      codetools_0.2-18   grid_4.2.1         iterators_1.0.14  
##  lattice_0.20-45    fortunes_1.5-4  

Poisson INLA model does not work

I have been trying to fit a spatial-temporal data and I keep on facing the error below, is there any solution to this?

*** inla.core.safe: The inla program failed, but will rerun in case better initial values may help. try=1/1
Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts, :
‘max’ not meaningful for factors
The inla program failed and the maximum number of tries has been reached.

Here is the code for my model:
When I remove this line “ f(year1, model="rw1", scale.model = TRUE,group = age2) ” from the model, the model works fine, I don't know what the problem is?

mod0 <- dn ~ 1 + offset(log(pop)) +  nl_mean + urb + worldpop_mean + dependency_ratio  + edu_year + thod_3doctor + 
  
  year +
  
  # Age/cohort terms
  f(age, model="rw1", scale.model = TRUE) +   ##gamma a

  f(age1, year, model = "rw1") +  ##gamma a  muti t

  f(year1, model="rw1", scale.model = TRUE,group = age2) +  ##gamma  at
  
  # Spatial terms
  f(j, model="bym", graph = g) + ## gamma j
  
  f(j2, year, model="bym", graph = g) +  ##gamma j muti t 
  
  f(year2, model="rw1", scale.model = TRUE, group = j3) +  ##gumma jt
  
  f(ja_ok, model="iid") +  ##gamma ja
  
  f(jta, model = "iid") ##gamma jta



model_res<- inla(mod0,
                 family = "poisson",
                 data = Dat_subNation,
                 E = Dat_subNation$pop,
                 verbose = TRUE,
                 control.compute = list(dic = TRUE, cpo=T,config = TRUE),
                 control.predictor = list(compute=T)
                 )

INLA Keeping on crashing

I am learning the process of fitting a spatiotemporal model using INLA. In my pursuit, I simulated some data for Malawi, and every time I tried to fit my model with random effects, my model keep on crashing. I do not understand why this is the case, but the error that pops up indicates non-numeric argument to binary operator. I have attached a reproducible example on my Git profile (https://github.com/Kalondepatrick/spatiotemporal). To those interested to help, you will find the script that I was using in the folder scripts.

Providing PARDISO support while building R-INLA from source.

As a continuation of this, I need to be able to build R-INLA with PARDISO support from source, as the binaries fail on RHEL8 due to its binary build targeting libraries not on the system:

If I try to use the binary version of INLA_22.05.07 (upgraded from 21.05.02) under R-4.0.4, I get:

> inla.pardiso.check()
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /tmp/terjekv/tmp-installs/R-INLA-21.05.02-
foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libcrypto.so.1.1: version `OPENSSL_1_1_1b' not found (required by /lib64/libk5crypto.so.3)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /tmp/terjekv/tmp-installs/R-INLA-21.05.02-
foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libcrypto.so.1.1: version `OPENSSL_1_1_1b' not found (required by /lib64/libk5crypto.so.3)
character(0)
attr(,"status")
[1] 1
Warning message:
In system(paste(shQuote(inla.call.no.remote()), "-m pardiso"), intern = TRUE) :
  running command ''/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl.run' -m pardiso' had status 1

If I try upgrade to the testing version INLA_22.12.12-2 I get:

> inla.pardiso.check()
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/first/libRmath.so.1)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/first/libR.so)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libgsl.so.23)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/first/libpardiso.so)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libgfortran.so.5)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libicuuc.so.66)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libicui18n.so.66)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libmvec.so.1)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/first/libRmath.so.1)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/first/libR.so)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libgsl.so.23)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/first/libpardiso.so)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libgfortran.so.5)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libicuuc.so.66)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libicui18n.so.66)
/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/libmvec.so.1)
character(0)
attr(,"status")
[1] 1
Warning message:
In system(paste(shQuote(inla.call.no.remote()), "-m pardiso"), intern = TRUE) :
  running command ''/tmp/terjekv/tmp-installs/R-INLA-21.05.02-foss-2020b-R-4.0.4.eb/software/R-INLA/21.05.02-foss-2020b-R-4.0.4/INLA/bin/linux/64bit/inla.mkl.run' -m pardiso' had status 1

Would it be possible to provide instructions for adding PARDISO to the building of R-INLA from source?

Support for multi-response modelling

Greetings,
I have been trying to fit a multi response model using R-INLA package, with the following data:

dd = data.frame(
  x1 = runif(100),
  x2 = runif(100)
) |>
  mutate(
    y1 = 2 - x1 + rnorm(100),
    y2 = 2 - .4*x1 + 1*x2 + rnorm(100)
  )

formula <- cbind(y1, y2) ~ x1 + x2
result <- inla(formula, family="gaussian", data=dd)

Is this currently supported by INLA, as I seem to have gotten the formula wrongly.

Best.

Intel MKL FATAL ERROR on MacOS

Hiya,

eager to run some INLA from within R, but I am unfortunately getting stuck even running example code. I believe this may be related to issues #84 and #67.

It'd be great if you could help me resolve this. Please let me know if there are any additional steps I can take or information you would like me to provide.

The Error Message

I have shortened the below console output to keep this issue readable:

inla_build: check for unused entries in[/private/var/folders/c9/5tlmp10s517_f5qmn120ctjc0000gp/T/RtmpvDHrQt/file924464a7a624/Model.ini]
inla_INLA_preopt_experimental...
	Strategy = [DEFAULT]
Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.
INTEL MKL ERROR: .
Intel MKL FATAL ERROR: Cannot load libmkl_mc3.2.dylib.
Error in inla.inlaprogram.has.crashed() : 
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does not help, please contact the developers at <[email protected]>.

The Code Producing the Error

library(INLA)

n = 100; a = 1; b = 1; tau = 100
z = rnorm(n)
eta = a + b*z

scale = exp(rnorm(n))
prec = scale*tau
y = rnorm(n, mean = eta, sd = 1/sqrt(prec))

data = list(y=y, z=z)
formula = y ~ 1+z
result = inla(formula, family = "gaussian", data = data, verbose = TRUE)

Steps Taken So Far

In attempting to resolve this issue I have:

  1. updated numpy and nomkl as suggested here
  2. ran install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/testing"), dep=TRUE) as suggested in #67
  3. ensured that pkgType == "both" before installation as suggested in #84

My SessionInfo

R version 4.3.2 (2023-10-31)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.1.2

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Oslo
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] INLA_23.11.26 sp_2.1-2      Matrix_1.6-3 

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5        cli_3.6.1          rlang_1.1.2        DBI_1.1.3          KernSmooth_2.23-22 MatrixModels_0.5-3 generics_0.1.3    
 [8] sf_1.0-14          glue_1.6.2         e1071_1.7-13       fansi_1.0.5        grid_4.3.2         classInt_0.4-10    tibble_3.2.1      
[15] lifecycle_1.0.4    compiler_4.3.2     fmesher_0.1.4.9002 dplyr_1.1.4        pkgconfig_2.0.3    Rcpp_1.0.11.6      rstudioapi_0.15.0 
[22] lattice_0.22-5     R6_2.5.1           tidyselect_1.2.0   class_7.3-22       utf8_1.2.4         parallel_4.3.2     pillar_1.9.0      
[29] splines_4.3.2      magrittr_2.0.3     withr_2.5.2        tools_4.3.2        proxy_0.4-27       units_0.8-5  

inla.mesh.2d error "Error in qr.coef(a, b)"

On a Windows PC with R 4.1.0 this gives me the error message "Error in qr.coef(a, b) : 'qr' and 'y' must have the same number of rows':

Mesh3 <- inla.mesh.2d(grid2, boundary = boundary, max.edge = c(25000, 250000), cutoff = 3000)
matern <- inla.spde2.pcmatern(Mesh3,
                                prior.sigma = c(3000, 0.01),
                                prior.range = c(10, 0.01))

(shapefiles here)
shapefiles.zip

....I got the same error when running in R4.0.3. So I tried the same code with the same shapefiles on my laptop running R4.0.3 with no error message...and upon updating the laptop to R 4.1.0, it still worked(!).

I'm on the same rgdal version (1.2-23) on both computers, spdep is 1.1-7 and rgeos 0.5-5. I get the same error on the desktop using both RStudio 1.3.1093 and 1.4.1106.

Best wiehs,
Michael

Facing issue in installing INLA on windows

Hi have tried all the ways to install INLA on windows but they all ends with an error (R version 4.3.1). They are given below

> remotes::install_version("INLA", version="23.05.30",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/testing"), dep=TRUE)
Trying https://cran.rstudio.com/
Trying https://inla.r-inla-download.org/R/testing
Error in download_version_url(package, version, repos, type) : 
  version '23.05.30' is invalid for package 'INLA'
> install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)
Installing package intoC:/Users/rohit_satyam/AppData/Local/R/win-library/4.3’
(aslibis unspecified)
Warning in install.packages :
  unable to access index for repository https://inla.r-inla-download.org/R/stable/bin/windows/contrib/4.3:
  cannot open URL 'https://inla.r-inla-download.org/R/stable/bin/windows/contrib/4.3/PACKAGES'
installing the source packageINLAtrying URL 'https://inla.r-inla-download.org/R/stable/src/contrib/INLA_23.04.24.tar.gz'
Content type 'application/x-gzip' length 91038966 bytes (86.8 MB)
downloaded 86.8 MB

* installing *binary* package 'INLA' ...
cp: unknown option -- )
Try '/usr/bin/cp --help' for more information.
ERROR: installing binary package failed
* removing 'C:/Users/rohit_satyam/AppData/Local/R/win-library/4.3/INLA'
Warning in install.packages :
  installation of packageINLAhad non-zero exit status

The downloaded source packages are inC:\Users\rohit_satyam\AppData\Local\Temp\RtmpMjBXnX\downloaded_packages

Hyperparameter sample name problem for experimental inla.mode

With the experimental inla.mode="experimental" setting, the hyperparameter names from inla.posterior.sample are incorrect, with -- unknown added to the internal name, instead of just the plain non-internal name.

inla.posterior.sample, where the "rfake" object that is created doesn't contain internal.summary.hyperpar and summary.hyperpar, but those are the places the function INLA::inla.transform.names() looks for the parameter names to use. The result of those missing objects is that " -- unknown" gets added to the names, breaking the generate and predict() calls for inlabru calls that reference hyperparameters (and presumably also for any inla.posterior.sample.eval that does that). The problematic line is

rfake <- list(mlik = result$mlik, misc = list(from.theta = result$misc$from.theta, 
      to.theta = result$misc$to.theta, configs = result$misc$configs))

that should probably pass on the hyperpar summaries as well; not just mlik and misc. A possible fix:

rfake <- list(mlik = result$mlik, misc = list(from.theta = result$misc$from.theta, 
      to.theta = result$misc$to.theta, configs = result$misc$configs),
    summary.hyperpar = result$summary.hyperpar,
    internal.summary.hyperpar = result$internal.summary.hyperpar
    )

Reproducible example:

library(INLA)
#> Loading required package: Matrix
#> Loading required package: foreach
#> Loading required package: parallel
#> Loading required package: sp
#> This is INLA_21.07.10-1 built 2021-07-10 12:04:41 UTC.
#>  - See www.r-inla.org/contact-us for how to get help.
#>  - To enable PARDISO sparse library; see inla.pardiso()

# Fit a model with random effect z
# and repeated measurements (for identifiability) with
# additive Gaussian noise

df <- data.frame(z = rep(c(1, 10), each = 5))
df <- within(df,
                   y <- 5 +
                     rnorm(10, mean = 0, sd = 1)[z] +
                     rnorm(10, mean = 0, sd = 0.1))

# Estimation is OK for all three modes:
fit <- list()
for (inla.mode in c("classic", "twostage", "experimental")) {
  fit[[inla.mode]] <-
    inla(y ~ f(z, model = "iid"),
         family = "gaussian",
         data = df,
         control.compute = list(config = TRUE),
         inla.mode = inla.mode)
}

# inla.posterior.sample names are wrong for experimental, non-internal scale:
cat("inla.posterior.sample:")
#> inla.posterior.sample:
for (intern in c(FALSE, TRUE)) {
  for (inla.mode in c("classic", "twostage", "experimental")) {
    samples <-
      inla.posterior.sample(n = 1, result = fit[[inla.mode]], intern = intern)

    cat("Names for inla.mode='", inla.mode, "', intern = ", intern, ":\n  ",
        paste0(names(samples[[1]]$hyperpar), collapse = "\n  "),
        "\n", sep = "")
  }
}
#> Names for inla.mode='classic', intern = FALSE:
#>   Precision for the Gaussian observations
#>   Precision for z
#> Names for inla.mode='twostage', intern = FALSE:
#>   Precision for the Gaussian observations
#>   Precision for z
#> Names for inla.mode='experimental', intern = FALSE:
#>   Log precision for the Gaussian observations -- unknown
#>   Log precision for z -- unknown
#> Names for inla.mode='classic', intern = TRUE:
#>   Log precision for the Gaussian observations
#>   Log precision for z
#> Names for inla.mode='twostage', intern = TRUE:
#>   Log precision for the Gaussian observations
#>   Log precision for z
#> Names for inla.mode='experimental', intern = TRUE:
#>   Log precision for the Gaussian observations
#>   Log precision for z

# inla.hyperpar.sample names are correct:
cat("inla.hyperpar.sample:")
#> inla.hyperpar.sample:
for (intern in c(FALSE, TRUE)) {
  for (inla.mode in c("classic", "twostage", "experimental")) {
    samples <-
      inla.hyperpar.sample(n = 1, result = fit[[inla.mode]], intern = intern)

    cat("Names for inla.mode='", inla.mode, "', intern = ", intern, ":\n  ",
        paste0(colnames(samples), collapse = "\n  "),
        "\n", sep = "")
  }
}
#> Names for inla.mode='classic', intern = FALSE:
#>   Precision for the Gaussian observations
#>   Precision for z
#> Names for inla.mode='twostage', intern = FALSE:
#>   Precision for the Gaussian observations
#>   Precision for z
#> Names for inla.mode='experimental', intern = FALSE:
#>   Precision for the Gaussian observations
#>   Precision for z
#> Names for inla.mode='classic', intern = TRUE:
#>   Log precision for the Gaussian observations
#>   Log precision for z
#> Names for inla.mode='twostage', intern = TRUE:
#>   Log precision for the Gaussian observations
#>   Log precision for z
#> Names for inla.mode='experimental', intern = TRUE:
#>   Log precision for the Gaussian observations
#>   Log precision for z

Created on 2021-07-14 by the reprex package (v2.0.0)

inla.mesh.2d never finishes

Hi @hrue et al,

I'm hoping you can help me with what seems to be an OS specific issue.

I'm trying to run the code from Opitz (2017) "Latent Gaussian modeling and INLA: A review with focus on space-time applications " (https://arxiv.org/abs/1708.02723). I have successfully run the code on a Mac, but I cannot get it to work properly on two different installations of Ubuntu Linux 20.04.3 (one native and one run through WSL on Windows). The failure occurs with the command:

mesh.sim=inla.mesh.2d(boundary=list(segm.bnd,segm.bnd.ext),
                      max.edge=c(.04,.2),
                      min.angle=21)

This completes in a minute or two on my Mac, but the command never completes on the Linux machines. I've waited up to a couple of hours to be sure. When I interrupt the command I receive the error: Error in fmesher.read(prefix, "manifold") : File '/tmp/RtmpQ5Naxy/fmesher10dd0a8fdc.manifold' does not exist

Listing the contents of this directory shows

$ ls /tmp/RtmpQ5Naxy/                           
fmesher10dd0a8fdc.input.s             fmesher10dd0a8fdc.input.segm.int.grp  libloc_174_173b0d0583319ed2.rds            fmesher10dd0a8fdc.input.segm.bnd.grp  fmesher10dd0a8fdc.input.segm.int.idx  libloc_198_6c6d31b77eb27d50.rds            fmesher10dd0a8fdc.input.segm.bnd.idx  libloc_169_8f48fc7d1db1bb3e.rds  

I noticed a previous issue concerning fmesher (#8), but it has been closed. I believe that all of my libraries and the INLA package are up-to-date. I have tried running

INLA:::inla.binary.install()

but the behaviour persists.

I've copied my sessionInfo() along with the MWE below.

Apologies if this issue has already been addressed.

Thanks!

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] INLA_22.01.25 sp_1.4-5      foreach_1.5.1 Matrix_1.4-0 

loaded via a namespace (and not attached):
[1] compiler_4.1.2   rgdal_1.5-28     tools_4.1.2      splines_4.1.2   
[5] codetools_0.2-18 grid_4.1.2       iterators_1.0.13 lattice_0.20-45 
> 

MWE adapted from

library(INLA)

nodes.bnd=matrix(c(0,0,1,0,1,1,0,1),ncol=2,byrow=T)
segm.bnd=inla.mesh.segment(nodes.bnd)

nodes.bnd.ext=matrix(c(-.5,-.5,1.5,-.5,1.5,1.5,-.5,1.5),ncol=2,byrow=T)
segm.bnd.ext=inla.mesh.segment(nodes.bnd.ext)

mesh.sim=inla.mesh.2d(boundary=list(segm.bnd,segm.bnd.ext),
                      max.edge=c(.04,.2),
                      min.angle=21)

Error when deploying a Shiny app with INLA

Hi !
I've made an rmarkdown projecte with output: html and runtime: shiny with some bayesian modelling using INLA. It works well locally, but when trying to publish it in to my account I get this error and the app is not able to be deployed:

Error: Unhandled Exception: Child Task 1156373091 failed: Error building image: Error fetching INLA (21.11.22) source. unable to satisfy package: INLA (21.11.22)

Any idea to solve this?

Pau

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.