mh: Upper Cholesky factor sampling using Metropolis-Hastings

Description Usage Arguments Details Author(s) References Examples

Description

Metropolis-Hasting algorithms to sample the upper Cholesky factor, using positive hemispheres of different dimensions. A zero pattern may be specified using an acyclic digraph.

Usage

1
2
3
mh_u(N = 1, p = 3, dag = NULL, ...)

mh_sphere(N = 1, k, i = 1, h = 100, eps = 0.01)

Arguments

N

Number of samples.

p

Dimension of the upper Cholesky factor.

dag

An igraph acyclic digraph specifying the zero pattern in the upper Cholesky factor of the sampled matrices. Nodes must be in ancestral order, with the first one having no parents.

...

Additional parameters for mh_sphere().

k

Dimension of the hemisphere from which the sample is taken.

i

Integer, power of the first coordinate in the density.

h

Heating phase size.

eps

Perturbation variance.

Details

Function mh_u() returns a sample of N upper Cholesky factors whose rows have been generated using mh_sphere(). The dimensions of the hemispheres used to sample vary depending both on the row number of the Cholesky factor, and whether there is a zero pattern specified by dag.

The details of the algorithm implemented by mh_sphere() can be found in the paper Córdoba et al. (2018), including a discussion on theoretical convergence and numerical experiments for choosing its hyper parameters h and eps.

Author(s)

Gherardo Varando gherardo.varando@math.ku.dk

References

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Upper Cholesky factor sampling
# Generate a random acyclic digraph
dag <- rgraph(p = 3, d = 0.5, dag = TRUE)
igraph::print.igraph(dag)

# Generate an upper Cholesky factor complying with such zero pattern
mh_u(dag = dag)
# We may also generate it with no zero pattern (full upper triangular)
mh_u()
## Hemisphere sampling
# 3D hemisphere from a density proportional to the square of the first coordinate
mh_sphere(N = 4, k = 3, i = 2)

gmat documentation built on Aug. 30, 2020, 9:07 a.m.

Related to mh in gmat...