internal-utils: Internal functions.

internal-utilsR Documentation

Internal functions.

Description

Internal functions.

Usage

p_iLtheta_fncheck(p, iLtheta)

m_iparams_fncheck(m, iparams)

KLD10(C1, C0, L1, L0)

pcSigmasCheck(nsigmas, sigma.prior.reference, sigma.prior.probability)

Arguments

p

integer (needed if base is vector): the dimension.

iLtheta

integer vector or 'graphpcor' to specify the (vectorized) position where 'theta' is placed in the initial (before the fill-in) Cholesky (lower triangle) factor. If missing, default, assumes the dense case as iLtheta = which(lower.tri(...)), giving length(theta)=p(p-1)/2.

m

integer to specify the number of parameters

iparams

integer ordered vector with length equal the number of parameters used to specify common parameter values. Default is 1:m, m=length(theta). Example: By setting iparams = c(1,1,2,3), m=3, the first and second parameters are considered to be the same. NOTE: c(1,2,1) is allowed, but c(2,1,2) is not.

C1

is a correlation matrix.

C0

is a correlation matrix of the base model.

L1

is the Cholesky of C1.

L0

is the Cholesky of C0.

nsigmas

number of parameters.

sigma.prior.reference

numeric vector to set the reference for each standard deviation parameter for its PC-prior.

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.

Details

By assuming equal mean vector we have

KLD = 0.5( tr(C0^{-1}C1) -p - log(|C1|) + log(|C0|) )

Functions

  • p_iLtheta_fncheck(): Function to deal with p and iLtheta

  • m_iparams_fncheck(): Function to deal with m and iparams

  • KLD10(): Compute the KLD between two multivariate Gaussian distributions, assuming equal mean vector

  • pcSigmasCheck(): Check the PC-prior arguments for sigma.


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