cgeneric_pc_correl: Build an 'cgeneric' for a correlation matrix PC-prior.

View source: R/cgeneric_pc_correl.R

cgeneric_pc_correlR Documentation

Build an cgeneric for a correlation matrix PC-prior.

Description

Build an cgeneric for a correlation matrix PC-prior.

Usage

cgeneric_pc_correl(n, base, iLtheta, iparams, ...)

## S3 method for class 'basecor'
cgeneric(
  model,
  lambda,
  sigma.prior.reference,
  sigma.prior.probability,
  iparams,
  cfixed,
  ...
)

Arguments

n

integer to define the size of the matrix, same as p in basecor().

base

numeric vector, matrix or basecor to define the base correlation model. See basecor() for details. If the output of a basecor() is provided, iLtheta and iparams (for the correlation parameters) will be considered from this.

iLtheta

integer vector to specify the (vectorized) position where 'theta' will be placed in the (lower triangle) Cholesky factorization of the correlation matrix.

iparams

integer vector with length equal n+m, where m is the number of correlation parameters, to identify (possible) common parameters in the model. Default is 1:(n+m). Note: c(1,2,1) is allowed, but c(2,1,2) is not.

...

additional arguments passed on to INLAtools::cgeneric(), such as debug, shlib and useINLAprecomp.

model

a basecor object.

lambda

the parameter for the exponential prior on the radius of the sphere, see details in the PC-multivariate vignette.

sigma.prior.reference

numeric vector to set the reference for each standard deviation parameter for its PC-prior. If missing, the model will be assumed as for a correlation. Note: iparams will be applied here as sigma.prior.reference[iparams[1:n]].

sigma.prior.probability

numeric vector with to set the probability statement of the PC prior for each marginal variance parameters. The probability statement is P(sigma < sigma.prior.reference) = p. If missing, all the marginal variances are considered as known. If a vector is given and a probability is NA, 0 or 1, the corresponding sigma.prior.reference will be used as fixed. Note: iparams will be applied here as sigma.prior.probability[iparams[1:n]].

cfixed

integer vector to specify which correlation parameters are treated as known and fixed. By default all correlation parameters are treated as unknown. Example: if cfixed = c(1,3), the first and third correlation parameters will be treated as fixed and the Hessian will be computed for the second correlation parameter. Please see the examples in basepcor(). Note: consider iparams[n+1:m]-iparams[n].

Details

The parametrization is set as in basecor() and the base is used to define an informative prior, as derived in the pcmultivariate vignette.

Value

a cgeneric object, see INLAtools::cgeneric() for details.

Functions

  • cgeneric(basecor): Build a cgeneric for a basecor.

References

Daniel Simpson, H\aa vard Rue, Andrea Riebler, Thiago G. Martins and Sigrunn H. S\o rbye (2017). Penalising Model Component Complexity: A Principled, Practical Approach to Constructing Priors. Statistical Science 2017, Vol. 32, No. 1, 1–28. <doi 10.1214/16-STS576>


graphpcor documentation built on March 23, 2026, 9:07 a.m.