Produce samples from the approximated joint posterior for the hyperparameters

inla.hyperpar.sample(n, result, intern=FALSE, improve.marginals = FALSE)

Arguments

n

Integer. Number of samples required.

result

An inla-object, f.ex the output from an inla-call.

intern

Logical. If TRUE then produce samples in the internal scale for the hyperparmater, if FALSE then produce samples in the user-scale. (For example log-precision (intern) and precision (user-scale))

improve.marginals

Logical. If TRUE, then improve the samples taking into account possible better marginal estimates for the hyperparameters in result.

Value

A matrix where each sample is a row. The contents of the column is described in the rownames.

Author

Havard Rue hrue@r-inla.org

Examples

n = 100
r = inla(y ~ 1 + f(idx), data = data.frame(y=rnorm(n), idx = 1:n))
#> Warning: error in running command
#> 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>.
ns = 500
x = inla.hyperpar.sample(ns, r)
#> Error: object 'r' not found

rr = inla.hyperpar(r)
#> Error: object 'r' not found
xx = inla.hyperpar.sample(ns, rr, improve.marginals=TRUE)
#> Error: object 'rr' not found