pc-prec: Utility functions for the PC prior for the precision

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Functions to evaluate, sample, compute quantiles and percentiles of the PC prior for the precision in the Gaussian distribution.

Usage

1
2
3
4
5
 inla.pc.rprec(n, u, alpha, lambda)
 inla.pc.dprec(prec, u, alpha, lambda, log = FALSE)
 inla.pc.qprec(p, u, alpha, lambda)
 inla.pc.pprec(q, u, alpha, lambda)
 

Arguments

n

Number of observations

u

The upper limit (see Details)

alpha

The probability going above the upper limit (see Details)

lambda

The rate parameter (see Details)

prec

Vector of precisions

log

Logical. Return the density in natural or log-scale.

p

Vector of probabilities

q

Vector of quantiles

Details

The statement Prob(1/sqrt(prec) > u) = alpha is used to determine lambda unless lambda is given. Either lambda must be given, or u AND alpha.

Value

inla.pc.dprec gives the density, inla.pc.pprec gives the distribution function, inla.pc.qprec gives the quantile function, and inla.pc.rprec generates random deviates.

Author(s)

Havard Rue hrue@math.ntnu.no

See Also

inla.doc("pc.prec")

Examples

1
2
3
4
5
 prec = inla.pc.rprec(100,  lambda = 1)
 d = inla.pc.dprec(prec, lambda = 1)
 prec = inla.pc.qprec(0.5, u = 1, alpha=0.01)
 inla.pc.pprec(prec, u = 1, alpha=0.01)
 

andrewzm/INLA documentation built on May 10, 2019, 11:12 a.m.