becarioprecario / INLAMSM

Multivariate spatial models for lattice data with INLA
18 stars 4 forks source link

Error with inla.rgeneric.define + inla.rgeneric.indep.IMCAR.model #1

Closed agila5 closed 4 years ago

agila5 commented 4 years ago

Dear Prof. Gómez-Rubio, I found a minor error running the code in the JSS paper. I installed the INLAMSM package from github while the R code is the same as in the document that you sent me.

#Load SIDS data
library("rgdal")
nc.sids <- readOGR(system.file("shapes/sids.shp", package = "spData")[1],
                   verbose = FALSE)
proj4string(nc.sids) <- CRS("+proj=longlat +ellps=clrk66")

#Compute adjacency matrix, as nb object 'adj' and sparse matrix 'W'
library("spdep")
adj <- poly2nb(nc.sids)
W <- as(nb2mat(adj, style = "B"), "Matrix")

# First time period
r74 <- sum(nc.sids$SID74) / sum(nc.sids$BIR74)
nc.sids$EXP74 <- r74 * nc.sids$BIR74
nc.sids$SMR74 <- nc.sids$SID74 / nc.sids$EXP74
nc.sids$NWPROP74 <- nc.sids$NWBIR74 / nc.sids$BIR74

# Second time period
r79 <- sum(nc.sids$SID79) / sum(nc.sids$BIR79)
nc.sids$EXP79 <- r79 * nc.sids$BIR79
nc.sids$SMR79 <- nc.sids$SID79 / nc.sids$EXP79
nc.sids$NWPROP79 <- nc.sids$NWBIR79 / nc.sids$BIR79

d <- data.frame(OBS = c(nc.sids$SID74, nc.sids$SID79),
                PERIOD = c(rep("74", 100), rep("79", 100)), 
                NWPROP = c(nc.sids$NWPROP74, nc.sids$NWPROP79),
                EXP = c(nc.sids$EXP74, nc.sids$EXP79))
# County-period index
d$idx <- 1:length(d$OBS)

library("INLAMSM")
#> Loading required package: Matrix
#> Loading required package: MCMCpack
#> Loading required package: coda
#> Loading required package: MASS
#> ##
#> ## Markov Chain Monte Carlo Package (MCMCpack)
#> ## Copyright (C) 2003-2020 Andrew D. Martin, Kevin M. Quinn, and Jong Hee Park
#> ##
#> ## Support provided by the U.S. National Science Foundation
#> ## (Grants SES-0350646 and SES-0350613)
#> ##
library("INLA")
#> Loading required package: parallel
#> Loading required package: foreach
#> This is INLA_20.03.09 built 2020-03-09 09:12:35 UTC.
#> See www.r-inla.org/contact-us for how to get help.
packageVersion("INLAMSM")
#> [1] '0.2'

# Number of variables (i.e., periods)
k <- 2
# Define bivariate latent effect
model.indimcar <- inla.rgeneric.define(inla.rgeneric.indep.IMCAR.model,
                                       list(k = k, W = W))
A <- kronecker(Diagonal(k, 1), Matrix(1, ncol = nrow(W), nrow = 1))
e  = rep(0, k)

IIMCAR <- inla(OBS ~ 0 + PERIOD + f(idx, model = model.indimcar,
                                    extraconstr = list(A = as.matrix(A), e = e)),
               data = d,
               E = EXP, family = "poisson", control.predictor = list(compute = TRUE),
               control.compute = list(dic = TRUE, waic = TRUE))
#> Warning in inla.model.properties.generic(inla.trim.family(model), mm[names(mm) == : Model 'rgeneric' in section 'latent' is marked as 'experimental'; changes may appear at any time.
#>   Use this model with extra care!!! Further warnings are disabled.
#> 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 <help@r-inla.org>.

Created on 2020-05-06 by the reprex package (v0.3.0)

The same code runs without any issue if I specify model.indimcar <- inla.INDIMCAR.model(k = k, W = W) instead of the inla.rgeneric.define code.

becarioprecario commented 4 years ago

Hi,

Thanks for checking. The code should run fine on R 3.6.3 and the latest version of INLA. The error message that you provide is not very informative... Can you provide your sessionInfo()?

Best,

Virgilio

agila5 commented 4 years ago

This is a copy-paste of the error message I obtain in interactive version of Rstudio:

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 <help@r-inla.org>.
In addition: Warning message:
In inla.model.properties.generic(inla.trim.family(model), mm[names(mm) ==  :
  Model 'rgeneric' in section 'latent' is marked as 'experimental'; changes may appear at any time.
  Use this model with extra care!!! Further warnings are disabled.

and this is the sessionInfo:

Session info ``` r devtools::session_info() #> - Session info ------------------------------------------------------------------------------------------------------- #> setting value #> version R version 3.6.3 (2020-02-29) #> os Windows 10 x64 #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate Italian_Italy.1252 #> ctype Italian_Italy.1252 #> tz Europe/Berlin #> date 2020-05-06 #> #> - Packages ----------------------------------------------------------------------------------------------------------- #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0) #> backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.1) #> boot 1.3-24 2019-12-20 [2] CRAN (R 3.6.3) #> callr 3.4.2 2020-02-12 [1] CRAN (R 3.6.2) #> class 7.3-15 2019-01-01 [2] CRAN (R 3.6.3) #> classInt 0.4-2 2019-10-17 [1] CRAN (R 3.6.1) #> cli 2.0.2 2020-02-28 [1] CRAN (R 3.6.3) #> coda * 0.19-3 2019-07-05 [1] CRAN (R 3.6.1) #> codetools 0.2-16 2018-12-24 [2] CRAN (R 3.6.3) #> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0) #> DBI 1.1.0 2019-12-15 [1] CRAN (R 3.6.3) #> deldir 0.1-25 2020-02-03 [1] CRAN (R 3.6.2) #> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.0) #> devtools 2.2.2 2020-02-17 [1] CRAN (R 3.6.2) #> digest 0.6.25 2020-02-23 [1] CRAN (R 3.6.3) #> e1071 1.7-3 2019-11-26 [1] CRAN (R 3.6.1) #> ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.6.1) #> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0) #> expm 0.999-4 2019-03-21 [1] CRAN (R 3.6.1) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.2) #> foreach * 1.4.8 2020-02-09 [1] CRAN (R 3.6.2) #> fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.3) #> gdata 2.18.0 2017-06-06 [1] CRAN (R 3.6.0) #> glue 1.3.2 2020-03-12 [1] CRAN (R 3.6.3) #> gmodels 2.18.1 2018-06-25 [1] CRAN (R 3.6.1) #> gtools 3.8.1 2018-06-26 [1] CRAN (R 3.6.0) #> highr 0.8 2019-03-20 [1] CRAN (R 3.6.0) #> htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.1) #> INLA * 20.03.09 2020-03-09 [1] local #> INLAMSM * 0.2 2020-05-06 [1] Github (becarioprecario/INLAMSM@1ac70d8) #> iterators 1.0.12 2019-07-26 [1] CRAN (R 3.6.1) #> KernSmooth 2.23-16 2019-10-15 [2] CRAN (R 3.6.3) #> knitr 1.28 2020-02-06 [1] CRAN (R 3.6.2) #> lattice 0.20-38 2018-11-04 [2] CRAN (R 3.6.3) #> LearnBayes 2.15.1 2018-03-18 [1] CRAN (R 3.6.0) #> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0) #> MASS * 7.3-51.5 2019-12-20 [2] CRAN (R 3.6.3) #> Matrix * 1.2-18 2019-11-27 [2] CRAN (R 3.6.3) #> MatrixModels 0.4-1 2015-08-22 [1] CRAN (R 3.6.1) #> mcmc 0.9-7 2020-03-21 [1] CRAN (R 3.6.3) #> MCMCpack * 1.4-6 2020-02-13 [1] CRAN (R 3.6.2) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.0) #> nlme 3.1-144 2020-02-06 [2] CRAN (R 3.6.3) #> pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 3.6.1) #> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.0) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2) #> processx 3.4.2 2020-02-09 [1] CRAN (R 3.6.2) #> ps 1.3.2 2020-02-13 [1] CRAN (R 3.6.2) #> quantreg 5.55 2020-04-01 [1] CRAN (R 3.6.3) #> R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.1) #> raster 3.0-12 2020-01-30 [1] CRAN (R 3.6.2) #> Rcpp 1.0.4 2020-03-17 [1] CRAN (R 3.6.3) #> remotes 2.1.1 2020-02-15 [1] CRAN (R 3.6.2) #> rgdal * 1.4-8 2019-11-27 [1] CRAN (R 3.6.1) #> rlang 0.4.5 2020-03-01 [1] CRAN (R 3.6.3) #> rmarkdown 2.1 2020-01-20 [1] CRAN (R 3.6.2) #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0) #> sf * 0.9-2 2020-04-14 [1] CRAN (R 3.6.3) #> sp * 1.4-1 2020-02-28 [1] CRAN (R 3.6.3) #> SparseM 1.78 2019-12-13 [1] CRAN (R 3.6.2) #> spData * 0.3.3 2020-02-11 [1] CRAN (R 3.6.2) #> spDataLarge 0.3.1 2019-06-30 [1] Github (Nowosad/spDataLarge@012fe53) #> spdep * 1.1-3 2019-09-18 [1] CRAN (R 3.6.1) #> stringi 1.4.6 2020-02-17 [1] CRAN (R 3.6.2) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.0) #> testthat 2.3.2 2020-03-02 [1] CRAN (R 3.6.3) #> units 0.6-5 2019-10-08 [1] CRAN (R 3.6.3) #> usethis 1.5.1 2019-07-04 [1] CRAN (R 3.6.2) #> withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0) #> xfun 0.12 2020-01-13 [1] CRAN (R 3.6.2) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.2) #> #> [1] C:/Users/Utente/Documents/R/win-library/3.6 #> [2] C:/Program Files/R/R-3.6.3/library ```
becarioprecario commented 4 years ago

I’ll try to reproduce the error and go back to you.

Best,

Virgilio

El 6 may 2020, a las 21:07, Andrea Gilardi notifications@github.com<mailto:notifications@github.com> escribió:

This is a copy-paste of the error message I obtain in interactive version of Rstudio:

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 help@r-inla.org<mailto:help@r-inla.org>. In addition: Warning message: In inla.model.properties.generic(inla.trim.family(model), mm[names(mm) == : Model 'rgeneric' in section 'latent' is marked as 'experimental'; changes may appear at any time. Use this model with extra care!!! Further warnings are disabled.

and this is the sessionInfo:

Session info

devtools::session_info()

> - Session info -------------------------------------------------------------------------------------------------------

> setting value

> version R version 3.6.3 (2020-02-29)

> os Windows 10 x64

> system x86_64, mingw32

> ui RTerm

> language (EN)

> collate Italian_Italy.1252

> ctype Italian_Italy.1252

> tz Europe/Berlin

> date 2020-05-06

>

> - Packages -----------------------------------------------------------------------------------------------------------

> package * version date lib source

> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0)

> backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.1)

> boot 1.3-24 2019-12-20 [2] CRAN (R 3.6.3)

> callr 3.4.2 2020-02-12 [1] CRAN (R 3.6.2)

> class 7.3-15 2019-01-01 [2] CRAN (R 3.6.3)

> classInt 0.4-2 2019-10-17 [1] CRAN (R 3.6.1)

> cli 2.0.2 2020-02-28 [1] CRAN (R 3.6.3)

> coda * 0.19-3 2019-07-05 [1] CRAN (R 3.6.1)

> codetools 0.2-16 2018-12-24 [2] CRAN (R 3.6.3)

> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0)

> DBI 1.1.0 2019-12-15 [1] CRAN (R 3.6.3)

> deldir 0.1-25 2020-02-03 [1] CRAN (R 3.6.2)

> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.0)

> devtools 2.2.2 2020-02-17 [1] CRAN (R 3.6.2)

> digest 0.6.25 2020-02-23 [1] CRAN (R 3.6.3)

> e1071 1.7-3 2019-11-26 [1] CRAN (R 3.6.1)

> ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.6.1)

> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0)

> expm 0.999-4 2019-03-21 [1] CRAN (R 3.6.1)

> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.2)

> foreach * 1.4.8 2020-02-09 [1] CRAN (R 3.6.2)

> fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.3)

> gdata 2.18.0 2017-06-06 [1] CRAN (R 3.6.0)

> glue 1.3.2 2020-03-12 [1] CRAN (R 3.6.3)

> gmodels 2.18.1 2018-06-25 [1] CRAN (R 3.6.1)

> gtools 3.8.1 2018-06-26 [1] CRAN (R 3.6.0)

> highr 0.8 2019-03-20 [1] CRAN (R 3.6.0)

> htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.1)

> INLA * 20.03.09 2020-03-09 [1] local

> INLAMSM * 0.2 2020-05-06 [1] Github (becarioprecario/INLAMSM@1ac70d8)

> iterators 1.0.12 2019-07-26 [1] CRAN (R 3.6.1)

> KernSmooth 2.23-16 2019-10-15 [2] CRAN (R 3.6.3)

> knitr 1.28 2020-02-06 [1] CRAN (R 3.6.2)

> lattice 0.20-38 2018-11-04 [2] CRAN (R 3.6.3)

> LearnBayes 2.15.1 2018-03-18 [1] CRAN (R 3.6.0)

> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0)

> MASS * 7.3-51.5 2019-12-20 [2] CRAN (R 3.6.3)

> Matrix * 1.2-18 2019-11-27 [2] CRAN (R 3.6.3)

> MatrixModels 0.4-1 2015-08-22 [1] CRAN (R 3.6.1)

> mcmc 0.9-7 2020-03-21 [1] CRAN (R 3.6.3)

> MCMCpack * 1.4-6 2020-02-13 [1] CRAN (R 3.6.2)

> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.0)

> nlme 3.1-144 2020-02-06 [2] CRAN (R 3.6.3)

> pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 3.6.1)

> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.0)

> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2)

> processx 3.4.2 2020-02-09 [1] CRAN (R 3.6.2)

> ps 1.3.2 2020-02-13 [1] CRAN (R 3.6.2)

> quantreg 5.55 2020-04-01 [1] CRAN (R 3.6.3)

> R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.1)

> raster 3.0-12 2020-01-30 [1] CRAN (R 3.6.2)

> Rcpp 1.0.4 2020-03-17 [1] CRAN (R 3.6.3)

> remotes 2.1.1 2020-02-15 [1] CRAN (R 3.6.2)

> rgdal * 1.4-8 2019-11-27 [1] CRAN (R 3.6.1)

> rlang 0.4.5 2020-03-01 [1] CRAN (R 3.6.3)

> rmarkdown 2.1 2020-01-20 [1] CRAN (R 3.6.2)

> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0)

> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0)

> sf * 0.9-2 2020-04-14 [1] CRAN (R 3.6.3)

> sp * 1.4-1 2020-02-28 [1] CRAN (R 3.6.3)

> SparseM 1.78 2019-12-13 [1] CRAN (R 3.6.2)

> spData * 0.3.3 2020-02-11 [1] CRAN (R 3.6.2)

> spDataLarge 0.3.1 2019-06-30 [1] Github (Nowosad/spDataLarge@012fe53)

> spdep * 1.1-3 2019-09-18 [1] CRAN (R 3.6.1)

> stringi 1.4.6 2020-02-17 [1] CRAN (R 3.6.2)

> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.0)

> testthat 2.3.2 2020-03-02 [1] CRAN (R 3.6.3)

> units 0.6-5 2019-10-08 [1] CRAN (R 3.6.3)

> usethis 1.5.1 2019-07-04 [1] CRAN (R 3.6.2)

> withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0)

> xfun 0.12 2020-01-13 [1] CRAN (R 3.6.2)

> yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.2)

>

> [1] C:/Users/Utente/Documents/R/win-library/3.6

> [2] C:/Program Files/R/R-3.6.3/library

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/becarioprecario/INLAMSM/issues/1#issuecomment-624834145, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABYD6WVSP6RORD7CZWPKNSDRQGYO3ANCNFSM4M2SNFGQ.

agila5 commented 4 years ago

I had an epiphany a few minutes ago and I think I get it know. The problem is that the second argument to the inla.rgeneric.define function is an unnamed argument, i.e. list(k = k, W = W), which implies that it's passed to the debug parameter:

# packages
options(width = 120)
library(INLA)
library(INLAMSM)

# The k and W parameters are never passed to the inla.rgeneric.indep.IMCAR.model
# but the are assigned to the debug parameter.

k <- 1
W <- diag(2)
inla.rgeneric.define(
    inla.rgeneric.indep.IMCAR.model, 
    list(k = k, W = W)
)
#> $f
#> $f$model
#> [1] "rgeneric"
#> 
#> $f$n
#> [1] 2
#> 
#> $f$rgeneric
#> $definition
#> function (cmd = c("graph", "Q", "mu", "initial", "log.norm.const", 
#>     "log.prior", "quit"), theta = NULL) 
#> {
#>     interpret.theta = function() {
#>         param <- sapply(theta[as.integer(1:k)], function(x) {
#>             exp(x)
#>         })
#>         PREC <- diag(param, k)
#>         return(list(param = param, PREC = PREC))
#>     }
#>     graph = function() {
#>         PREC <- diag(1, k)
#>         G <- kronecker(PREC, Matrix::Diagonal(nrow(W), 1) + W)
#>         return(G)
#>     }
#>     Q = function() {
#>         param <- interpret.theta()
#>         Q <- kronecker(param$PREC, Matrix::Diagonal(nrow(W), 
#>             apply(W, 1, sum)) - W)
#>         return(Q)
#>     }
#>     mu = function() {
#>         return(numeric(0))
#>     }
#>     log.norm.const = function() {
#>         val <- numeric(0)
#>         return(val)
#>     }
#>     log.prior = function() {
#>         param = interpret.theta()
#>         val <- -sum(theta)/2 - k * log(2)
#>         return(val)
#>     }
#>     initial = function() {
#>         return(c(rep(log(1), k)))
#>     }
#>     quit = function() {
#>         return(invisible())
#>     }
#>     val = do.call(match.arg(cmd), args = list())
#>     return(val)
#> }
#> <environment: 0x000000001cbfa888>
#> 
#> $debug
#> $debug$k
#> [1] 1
#> 
#> $debug$W
#>      [,1] [,2]
#> [1,]    1    0
#> [2,]    0    1
#> 
#> 
#> attr(,"class")
#> [1] "inla.rgeneric"
#> 
#> 
#> attr(,"class")
#> [1] "inla.rgeneric"

# debug = FALSE as it should be
inla.rgeneric.define(
    inla.rgeneric.indep.IMCAR.model, 
    k = k, 
    W = W
)
#> $f
#> $f$model
#> [1] "rgeneric"
#> 
#> $f$n
#> [1] 2
#> 
#> $f$rgeneric
#> $definition
#> function (cmd = c("graph", "Q", "mu", "initial", "log.norm.const", 
#>     "log.prior", "quit"), theta = NULL) 
#> {
#>     interpret.theta = function() {
#>         param <- sapply(theta[as.integer(1:k)], function(x) {
#>             exp(x)
#>         })
#>         PREC <- diag(param, k)
#>         return(list(param = param, PREC = PREC))
#>     }
#>     graph = function() {
#>         PREC <- diag(1, k)
#>         G <- kronecker(PREC, Matrix::Diagonal(nrow(W), 1) + W)
#>         return(G)
#>     }
#>     Q = function() {
#>         param <- interpret.theta()
#>         Q <- kronecker(param$PREC, Matrix::Diagonal(nrow(W), 
#>             apply(W, 1, sum)) - W)
#>         return(Q)
#>     }
#>     mu = function() {
#>         return(numeric(0))
#>     }
#>     log.norm.const = function() {
#>         val <- numeric(0)
#>         return(val)
#>     }
#>     log.prior = function() {
#>         param = interpret.theta()
#>         val <- -sum(theta)/2 - k * log(2)
#>         return(val)
#>     }
#>     initial = function() {
#>         return(c(rep(log(1), k)))
#>     }
#>     quit = function() {
#>         return(invisible())
#>     }
#>     val = do.call(match.arg(cmd), args = list())
#>     return(val)
#> }
#> <environment: 0x000000001d8b2610>
#> 
#> $debug
#> [1] FALSE
#> 
#> attr(,"class")
#> [1] "inla.rgeneric"
#> 
#> 
#> attr(,"class")
#> [1] "inla.rgeneric"

Created on 2020-05-06 by the reprex package (v0.3.0)

Session info ``` r devtools::session_info() #> - Session info ------------------------------------------------------------------------------------------------------- #> setting value #> version R version 3.6.3 (2020-02-29) #> os Windows 10 x64 #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate Italian_Italy.1252 #> ctype Italian_Italy.1252 #> tz Europe/Berlin #> date 2020-05-06 #> #> - Packages ----------------------------------------------------------------------------------------------------------- #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0) #> backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.1) #> callr 3.4.2 2020-02-12 [1] CRAN (R 3.6.2) #> cli 2.0.2 2020-02-28 [1] CRAN (R 3.6.3) #> coda * 0.19-3 2019-07-05 [1] CRAN (R 3.6.1) #> codetools 0.2-16 2018-12-24 [2] CRAN (R 3.6.3) #> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0) #> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.0) #> devtools 2.2.2 2020-02-17 [1] CRAN (R 3.6.2) #> digest 0.6.25 2020-02-23 [1] CRAN (R 3.6.3) #> ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.6.1) #> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.2) #> foreach * 1.4.8 2020-02-09 [1] CRAN (R 3.6.2) #> fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.3) #> glue 1.3.2 2020-03-12 [1] CRAN (R 3.6.3) #> highr 0.8 2019-03-20 [1] CRAN (R 3.6.0) #> htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.1) #> INLA * 20.03.09 2020-03-09 [1] local #> INLAMSM * 0.2 2020-05-06 [1] Github (becarioprecario/INLAMSM@1ac70d8) #> iterators 1.0.12 2019-07-26 [1] CRAN (R 3.6.1) #> knitr 1.28 2020-02-06 [1] CRAN (R 3.6.2) #> lattice 0.20-38 2018-11-04 [2] CRAN (R 3.6.3) #> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0) #> MASS * 7.3-51.5 2019-12-20 [2] CRAN (R 3.6.3) #> Matrix * 1.2-18 2019-11-27 [2] CRAN (R 3.6.3) #> MatrixModels 0.4-1 2015-08-22 [1] CRAN (R 3.6.1) #> mcmc 0.9-7 2020-03-21 [1] CRAN (R 3.6.3) #> MCMCpack * 1.4-6 2020-02-13 [1] CRAN (R 3.6.2) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.0) #> pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 3.6.1) #> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.0) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2) #> processx 3.4.2 2020-02-09 [1] CRAN (R 3.6.2) #> ps 1.3.2 2020-02-13 [1] CRAN (R 3.6.2) #> quantreg 5.55 2020-04-01 [1] CRAN (R 3.6.3) #> R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.1) #> Rcpp 1.0.4 2020-03-17 [1] CRAN (R 3.6.3) #> remotes 2.1.1 2020-02-15 [1] CRAN (R 3.6.2) #> rlang 0.4.5 2020-03-01 [1] CRAN (R 3.6.3) #> rmarkdown 2.1 2020-01-20 [1] CRAN (R 3.6.2) #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0) #> sp * 1.4-1 2020-02-28 [1] CRAN (R 3.6.3) #> SparseM 1.78 2019-12-13 [1] CRAN (R 3.6.2) #> stringi 1.4.6 2020-02-17 [1] CRAN (R 3.6.2) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.0) #> testthat 2.3.2 2020-03-02 [1] CRAN (R 3.6.3) #> usethis 1.5.1 2019-07-04 [1] CRAN (R 3.6.2) #> withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0) #> xfun 0.12 2020-01-13 [1] CRAN (R 3.6.2) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.2) #> #> [1] C:/Users/Utente/Documents/R/win-library/3.6 #> [2] C:/Program Files/R/R-3.6.3/library ```
becarioprecario commented 4 years ago

Hi,

I had an epiphany a few minutes ago and I think I get it know. The problem is that the second argument to the inla.rgeneric.define function is an unnamed argument, i.e. list(k = k, W = W), which implies that it's passed to the debug parameter:

Thanks for this. I believe that we changed this because one of the reviewers of the paper suggested that the arguments needed to be in a list. You can simply pass the values of k and W without the list and it should work.

Best,

Virgilio

agila5 commented 4 years ago

Thanks for this. I believe that we changed this because one of the reviewers of the paper suggested that the arguments needed to be in a list. You can simply pass the values of k and W without the list and it should work.

Yes, it works. It was really a minor problem.

Kind regards Andrea

becarioprecario commented 4 years ago

Hi,

Yes, it works. It was really a minor problem.

A minor problem that makes the R code not to run on some platforms. We’ll like into this to make sure that it can also run smoothly on all platforms.

Best,

Virgilio

becarioprecario commented 4 years ago

We have changed the example in the paper so that arguments passed to define the structure of the latent GMRF are not in a list anymore. This should work. Thanks for reporting the error!

Virgilio

agila5 commented 4 years ago

You're welcome!