pc.prec {INLA} | R Documentation

## Utility functions for the PC prior for the precision

### Description

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

### Usage

    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@r-inla.org

### See Also

inla.doc("pc.prec")

### 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)

[Package INLA version 26.08.22 Index]