# NOT RUN {
# Generate some data
input.df <- data.frame(x=cos(1:10))
input.df <- within(input.df, y <- 5 + 2*cos(1:10) + rnorm(10, mean=0, sd=0.1))
# Fit a Gaussian likelihood model
formula = y ~ x
fit <- inla(formula, "gaussian", data = input.df, control.compute=list(config = TRUE))
# Add formula to inla object
fit$formula = y ~ x
Estimate posterior statistics of exp(x), where x is the random effect.
xpost = predict(fit, NULL, ~ exp(x))
xpost
plot(xpost)
# }
Run the code above in your browser using DataLab