rmvnorm_reflectionmax: Reflection-Maximal coupling of two multivariate Normal...

View source: R/mvnorm_couplings.R

rmvnorm_reflectionmaxR Documentation

Reflection-Maximal coupling of two multivariate Normal distributions

Description

Sample from reflection-maximal coupling of two multivariate Normal distributions, specified through their means, with the same covariance matrix, specified through its Cholesky factor and inverse of Cholesky factor.

The idea is that a multivariate Normal is drawn around the first mean (mu1), and then reflected with respect to a hyperplane orthogonal to the direction between mu1 and mu2.

For univariate Normal distribution, see rnorm_reflectionmax.

Usage

rmvnorm_reflectionmax(mu1, mu2, Cholesky, Cholesky_inverse)

Arguments

mu1

First mean

mu2

First mean

Cholesky

Cholesky factor, e.g. obtained with chol

Cholesky_inverse

Inverse of Cholesky factor, e.g. obtained with solve(chol(Sigma))

Value

A list containing 'xy', a matrix with 2 columns (one for each draw), and a boolean indicator 'identical' indicating whether the two draws are identical.

Examples

p <- 3
mu1 <- rep(0, p)
mu2 <- rep(1, p)
Sigma <- diag(0.4, p, p)
Sigma[1,2] <- Sigma[2,1] <- 0.2
Sigma_chol <- chol(Sigma)
Sigma_chol_inv <- solve(Sigma_chol)
rmvnorm_reflectionmax(mu1, mu2, Sigma_chol, Sigma_chol_inv)

pierrejacob/debiasedmcmc documentation built on Aug. 22, 2022, 12:41 a.m.