Say I have Gaussian data where the independent noise parameter differs by (assumed known) groups but with the same latent field. My data is spatial but to illustrate it visually see the first plot in 1D.
ie assume we have
Y_g1 ~ U + N(0,(sigma_g1)^2)
Y_g2 ~ U + N(0,(sigma_g2)^2)
eg in this example sigma_g1 = 0.05 and sigma_g2 = 0.3
In essence I have a spatial process that may be measured in two ways, each with an associated error. (Or potentially up to say 3/4 groups). Can such a model be fit with inla , assume the general structure of my code is as follows (Taken from a worked example in E. T. Krainski et al. (2019)).
spde <- inla.spde2.pcmatern( ... ) # mesh/priors for range/ std dev
formula <- response ~ -1 + beta0 + f(i, model = spde) # may also include covaraites
data_stack<- inla.stack(
data = list(response =
df$response),
A = list(A5, 1),
effects = list(i = 1:spde$n.spde,
beta0 = rep(1, nrow(df))),
tag = 'est')
res5 <- inla(formula,
data = inla.stack.data(data_stack),
control.predictor = list(A = inla.stack.A(
data_stack )))
and assume some df contains the data: X ,Y , Group , response.
Additionally if the above is possible, can I then assume priors could be placed on them (ie if prior knowledge is that g1 should have high precision and g2 should have low precision)