posterior_summary_inla_one: Create one line summary for a given marginal

Description Usage Arguments Details Value Examples

View source: R/summaries.R

Description

Create one line summary for a given marginal.

Usage

1
posterior_summary_inla_one(marg, probs = c(0.025, 0.5, 0.975))

Arguments

marg

Marginal from an inla object.

probs

Percentiles returned by the summary. Default is c(0.025, 0.5, 0.975) which is the inla default.

Details

Create one line summary using the marginal functions from INLA such as inla.emarginal, inla.qmarginal, inla.mmarginal.

Value

vector of summary data.

Examples

1
2
3
4
5
6
7
8
df <- data.frame(
 x1 = rnorm(50, mean = 1, sd = 0.5),
 x2 = rnorm(50, mean = 2, sd = 1),
 sigma = rexp(50, rate = 1))
df$mu <- df$x1 + df$x2
df$y <- rnorm(nrow(df), mean = df$mu, sd = df$sigma)
the_fit <- INLA::inla(formula = y ~ x1 + x2, data = df)
posterior_summary_inla_one(the_fit$marginals.fixed[[1]])

FrankLef/eflINLA documentation built on Dec. 17, 2021, 8:30 p.m.