Skip to content
eliaskrainskiPublic

About

Models for correlation matrices

Resources

Stars

1 star

Watchers

3 watching

Forks

Repository files navigation

Models for correlation matrices based on graphs

This package 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) doi:10.48550/arXiv.2312.06289. 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 (https://www.r-inla.org). This allows one to use these models as building blocks combined and to other latent Gaussian models in order to build complex data models.

It can be installed with

  1. local clone repository
    1. R CMD build then R CMD INSTALL
    2. within Rstudio: <Ctrl+Shift+B>
  2. from this source with the github
remotes::install_github(
repo = 'https://github.com/eliaskrainski/graphpcor',
ref = "main"
build = TRUE, ## to completely build the package
build_vignettes = TRUE, ## it will take a bit of time, but helps
build_opts = c("--no-resave-data"))

Installing dependencies

The ‘INLA’ package is a suggested one, but you will need it for actually fitting a model. You can install it with

install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/testing"), dep=TRUE) 

There are two suggested packages, ‘graph’ and ‘Rgraphviz’, that are on Bioconductor, and you can install those with:

if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(c("graph", "Rgraphviz"), dep=TRUE) 

About

Models for correlation matrices

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages