Description Usage Arguments Details Author(s) References Examples
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.
1 2 3 |
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 |
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. |
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
.
Gherardo Varando gherardo.varando@math.ku.dk
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.