Learn R Programming

graphpcor (version 0.1.12)

Models for Correlation Matrices Based on Graphs

Description

Implement some models for correlation/covariance matrices including two approaches to model correlation matrices from a graphical structure. One use latent parent variables as proposed in Sterrantino et. al. (2024) . The other uses a graph to specify conditional relations between the variables. The graphical structure makes correlation matrices interpretable and avoids the quadratic increase of parameters as a function of the dimension. In the first approach a natural sequence of simpler models along with a complexity penalization is used. The second penalizes deviations from a base model. These can be used as prior for model parameters, considering C code through the 'cgeneric' interface for the 'INLA' package (). This allows one to use these models as building blocks combined and to other latent Gaussian models in order to build complex data models.

Copy Link

Version

Install

install.packages('graphpcor')

Monthly Downloads

137

Version

0.1.12

License

GPL (>= 2)

Maintainer

Elias Teixeira Krainski

Last Published

April 27th, 2025

Functions in graphpcor (0.1.12)

graphpcor-class

Set a graph whose nodes and edges represent variables and conditional distributions, respectively.
prec

The prec method
inla.rgeneric-class

inla.rgeneric class, short rgeneric, to define a INLA::rgeneric() latent model
dLKJ

The LKJ density for a correlation matrix
Lprec

Precision matrix parametrization helper functions.
graphpcor

The graphpcor generic method for graphpcor
hessian.graphpcor

Evaluate the hessian of the KLD for a graphpcor correlation model around a base model.
rphi2x

Functions for the mapping between spherical and Euclidean coordinates.
is.zero

Define the is.zero method
treepcor-class

Set a tree whose nodes represent the two kind of variables: children and parent.
treepcor

Define a tree used to model correlation matrices using a shared latent variables method represented by a tree, whose nodes represent the two kind of variables: children and parent. See treepcor.
cgeneric_treepcor

Build an cgeneric for treepcor())
cgeneric_LKJ

Build an inla.cgeneric object to implement the LKG prior for the correlation matrix.
theta2correl

Build the correlation matrix parametrized from the hypershere decomposition, see details.
cgeneric_Wishart

Build an inla.cgeneric to implement the Wishart prior for a precision matrix.
cgeneric_generic0

Build an inla.cgeneric to implement a model whose precision has a conditional precision parameter. See details. This uses the cgeneric interface that can be used as a model in a INLA f() model component.
cgeneric_graphpcor

Build an inla.cgeneric for a graph, see graphpcor()
Laplacian

The Laplacian of a graph
inla.cgeneric-class

inla.cgeneric class, short cgeneric, to define a INLA::cgeneric() latent model
cgeneric_pc_prec_correl

Build an inla.cgeneric to implement the PC-prior of a precision matrix as inverse of a correlation matrix.
cgeneric_pc_correl

Build an inla.cgeneric to implement the PC prior, proposed on Simpson et. al. (2007), for the correlation matrix parametrized from the hypershere decomposition, see details.