pc-cor1: Utility functions for the PC prior for correlation in AR(1)

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 correlation in the Gaussian AR(1) model where the base-model is correlation one.

Usage

1
2
3
4
5
 inla.pc.rcor1(n, u, alpha, lambda)
 inla.pc.dcor1(cor, u, alpha, lambda, log = FALSE)
 inla.pc.qcor1(p, u, alpha, lambda)
 inla.pc.pcor1(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)

cor

Vector of correlations

log

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

p

Vector of probabilities

q

Vector of quantiles

Details

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

Value

inla.pc.dcor1 gives the density, inla.pc.pcor1 gives the distribution function, inla.pc.qcor1 gives the quantile function, and inla.pc.rcor1 generates random deviates.

Author(s)

Havard Rue hrue@r-inla.org

See Also

inla.doc("pc.rho1")

Examples

1
2
3
4
5
 cor = inla.pc.rcor1(100,  lambda = 1)
 d = inla.pc.dcor1(cor, lambda = 1)
 cor = inla.pc.qcor1(c(0.3, 0.7), u = 0.5, alpha=0.75)
 inla.pc.pcor1(cor, u = 0.5, alpha=0.75)
 

inbo/INLA documentation built on Dec. 6, 2019, 9:51 a.m.

Related to pc-cor1 in inbo/INLA...