gaussian_tv | R Documentation |
Computes the total variation (TV) between two multivariate Gaussian
distributions f_1,f_2
:
\mathrm{TV}(f_1, f_2) = \tfrac{1}{2}
\int_{\mathbb{R}^p} \lvert f_1(x) - f_2(x) \rvert \, dx.
The value ranges from 0 (identical distributions) to 1 (no overlap).
gaussian_tv(
mean1,
mean2,
Sigma1,
Sigma2,
method = c("auto", "mc", "cubature"),
n = 10000,
tol_equal = 1e-06,
eps = 1e-06
)
mean1 , mean2 |
[ |
Sigma1 , Sigma2 |
[ |
method |
[
|
n |
[ |
tol_equal |
[ |
eps |
[ |
The total variation in [0, 1].
Other simulation helpers:
Simulator
,
correlated_regressors()
,
ddirichlet_cpp()
,
dmixnorm_cpp()
,
dmvnorm_cpp()
,
dtnorm_cpp()
,
dwishart_cpp()
,
simulate_markov_chain()
### univariate case
mean1 <- 0
mean2 <- 1
Sigma1 <- Sigma2 <- matrix(1)
gaussian_tv(mean1, mean2, Sigma1, Sigma2)
### bivariate case
mean1 <- c(0, 0)
mean2 <- c(1, 1)
Sigma1 <- matrix(c(1, 0.2, 0.2, 1), ncol = 2)
Sigma2 <- matrix(c(1.5, -0.3, -0.3, 1), ncol = 2)
gaussian_tv(mean1, mean2, Sigma1, Sigma2, method = "mc", n = 1e3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.