Learn R Programming

gmat

An R package for simulating correlation matrices possibly constrained by acyclic directed and undirected graphs.

Installation

The package is available on CRAN, to get the latest stable version use:

install.packages("gmat")

Alternatively, using the R package devtools one may install the development version:

# install.packages("devtools")
devtools::install_github("irenecrsn/gmat")

The other R packages required for gmat are igraph and gRbase, which can be installed from CRAN and Bioconductor.

Overview

The package mostly implements methods described in the following papers:

  • Córdoba I., Varando G., Bielza C., Larrañaga P. A fast Metropolis-Hastings method for generating random correlation matrices. Lecture Notes in Computer Science (IDEAL 2018), vol 11314, pp. 117-124, 2018.
  • Córdoba I., Varando G., Bielza C., Larrañaga P. A partial orthogonalization method for simulating covariance and concentration graph matrices. Proceedings of Machine Learning Research (PGM 2018), vol 72, pp. 61-72, 2018.
  • Córdoba I., Varando G., Bielza C., Larrañaga P. On generating random Gaussian graphical models. International Journal of Approximate Reasoning, vol 125, pp. 240-250, 2020.

See examples of use and more at package's manual.

Copy Link

Version

Install

install.packages('gmat')

Monthly Downloads

71

Version

0.2.2

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Gherardo Varando

Last Published

August 30th, 2020

Functions in gmat (0.2.2)

ug-constrained correlation matrices

Simulation of correlation matrices.
gmat

gmat
uchol

Get the upper factor of the upper Cholesky decomposition of a symmetric positive definite matrix.
vectorize

Vectorize a sample of covariance/correlation matrices
dag-constrained correlation matrices

Simulation of correlation matrices
ug_to_dag

Moral DAG from non chordal UG
set_cond_number

Set the condition number of the matrices in a sample of covariance/correlation matrices
rgraph

Random generation of acyclic digraphs and undirected graphs
metropolis-hastings sampling

Upper Cholesky factor sampling using Metropolis-Hastings