Error when using INLA "parsing result not of length one, but 0"

Viewed 456

I am new using INLA. This is an exercise from Faraway's book. When I copy and paste the example code in the book, INLA works fine, but when I change a dataset, it keeps showing this error. The following is the code.

sdres <- sd(denim$waste)
pcprior <- list(prec = list(prior="pc.prec", param = c(3*sdres,0.01)))
formula2 <- waste ~ f(supplier, model="iid",, hyper = pcprior)
result <- inla(formula2, family="gaussian", data=denim)
result <- inla.hyperpar(result)
summary(result)
Error in str2lang(s) : parsing result not of length one, but 0

But another example works great.

sdres <- sd(pulp$bright)
pcprior <- list(prec = list(prior="pc.prec", param = c(3*sdres,0.01)))
formula <- bright ~ f(operator, model="iid", hyper = pcprior)
result <- inla(formula, family="gaussian", data=pulp)
result <- inla.hyperpar(result)
summary(result)

with result

   "inla(formula = formula, family = \"gaussian\", data = denim)" 
Time used:
    Pre = 1.82, Running = 3.46, Post = 0.0998, Total = 5.38 
Fixed effects:
             mean    sd 0.025quant 0.5quant 0.975quant  mode kld
(Intercept) 6.977 1.015       4.98    6.977      8.972 6.977   0

Random effects:
  Name    Model
    supplier IID model

Model hyperparameters:

Expected number of effective parameters(stdev): 1.00(0.002)
Number of equivalent replicates : 94.96 

Marginal log-Likelihood:  -366.67 

Any hints would be appreciated!

0 Answers
Related