Dear Haavard, and rest of the INLA community,
I have had a look into the ggaussian family of INLA, and it does what I have in mind. However, I believe that the number of predictors for the noise variance is limited to 10. Is there a way to loosen that requirement ? Ans subsidiarily, is it possible to pass matrices to inla.mdata() instead of individual vectors ?
Again, as usual : thank you all for your amazing work and your help with the software.
Kind regards
Seb
n <- 1000
x <- rnorm(n)
xx <- rnorm(n)
eta <- 0.1 + 1.1 * x + 2.2 * xx
s <- rep(1, n)
z <- rnorm(n)
zz <- rnorm(n)
# try with 9 +1 predictors for the noise
X_noise = matrix(rnorm(n * 9), n)
beta_noise = rnorm(ncol(X_noise))
eta.prec <- -3 + X_noise %*% beta_noise
y <- eta + 1/sqrt(s * exp(eta.prec)) * rnorm(n)
Y <- inla.mdata(y, s, 1,
X_noise[,1],
X_noise[,2],
X_noise[,3],
X_noise[,4],
X_noise[,5],
X_noise[,6],
X_noise[,7],
X_noise[,8],
X_noise[,9]
)
r <- inla(Y ~ 1 + x + xx,
data = list(Y = Y, x = x, xx = xx, z = z, zz = zz, s = s),
family = "ggaussian")
summa = summary(r)
plot(
summa$hyperpar[-1,1],
beta_noise
)
abline(a=0, b=1)
# try with 10 +1 predictors for the noise
X_noise = matrix(rnorm(n * 10), n)
beta_noise = rnorm(ncol(X_noise))
eta.prec <- -3 + X_noise %*% beta_noise
y <- eta + 1/sqrt(s * exp(eta.prec)) * rnorm(n)
Y <- inla.mdata(y, s, 1,
X_noise[,1],
X_noise[,2],
X_noise[,3],
X_noise[,4],
X_noise[,5],
X_noise[,6],
X_noise[,7],
X_noise[,8],
X_noise[,9],
X_noise[,10])
r <- inla(Y ~ 1 + x + xx,
data = list(Y = Y, x = x, xx = xx, z = z, zz = zz, s = s),
family = "ggaussian")
summa = summary(r)
plot(
summa$hyperpar[-1,1],
beta_noise
)
abline(a=0, b=1)