Functions to evaluate, sample, compute quantiles and percentiles of the PC prior for Gamma(1/a, 1/a)

inla.pc.rgamma(n, lambda = 1)

inla.pc.dgamma(x, lambda = 1, log = FALSE)

inla.pc.qgamma(p, lambda = 1)

inla.pc.pgamma(q, lambda = 1)

Arguments

n

Number of observations

lambda

The rate parameter (see Details)

x

Evaluation points

log

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

p

Vector of probabilities

q

Vector of quantiles

Value

inla.pc.dgamma gives the density, inla.pc.pgamma gives the distribution function, inla.pc.qgamma gives the quantile function, and inla.pc.rgamma generates random deviates.

Details

This gives the PC prior for the Gamma(1/a, 1/a) case, where a=0 is the base model.

See also

inla.doc("pc.gamma")

Author

Havard Rue hrue@r-inla.org

Examples


 x = inla.pc.rgamma(100,  lambda = 1)
 d = inla.pc.dgamma(x, lambda = 1)
 x = inla.pc.qgamma(0.5, lambda = 1)
 inla.pc.pgamma(x, lambda = 1)
#> [1] 0.5