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

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.

See also

inla.doc("pc.prec")

Author

Havard Rue hrue@r-inla.org

Examples

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)
#> [1] 0.5