estphi: estphi

View source: R/estphi.R

estphiR Documentation

estphi

Description

Given a q-dimensional random vector \mathbf{X} = (\mathbf{X}_{1},...,\mathbf{X}_{k}) with \mathbf{X}_{i} a d_{i}-dimensional random vector, i.e., q = d_{1} + ... + d_{k}, this function estimates the \Phi-dependence between \mathbf{X}_{1},...,\mathbf{X}_{k} by estimating the joint and marginal copula densities.

Usage

estphi(sample, dim, est_method, phi)

Arguments

sample

A sample from a q-dimensional random vector \mathbf{X} (n \times q matrix with observations in rows, variables in columns).

dim

The vector of dimensions (d_{1},...,d_{k}).

est_method

The method used for estimating the \Phi-dependence.

phi

The function \Phi.

Details

When \mathbf{X} has copula density c with marginal copula densities c_{i} of \mathbf{X}_{i} for i = 1, \dots, k, the \Phi-dependence between \mathbf{X}_{1}, \dots, \mathbf{X}_{k} equals

\mathcal{D}_{\Phi} \left (\mathbf{X}_{1}, \dots, \mathbf{X}_{k} \right ) = \mathbb{E} \left \{ \frac{\prod_{i = 1}^{k} c_{i}(\mathbf{U}_{i})}{c \left ( \mathbf{U} \right )} \Phi \left (\frac{c(\mathbf{U})}{\prod_{i = 1}^{k}c_{i}(\mathbf{U}_{i})} \right ) \right \},

for a certain continuous, convex function \Phi : (0,\infty) \rightarrow \mathbb{R}, and with \mathbf{U} = (\mathbf{U}_{1}, \dots, \mathbf{U}_{k}) \sim c.

This functions allows to estimate \mathcal{D}_{\Phi} in several ways (options for est_method)

  • list("hac", type = type, M = M) for parametric estimation by fitting a hierarchical Archimedean copula (hac) via pseudo-maximum likelihood estimation, using a generator of type = type and a simulated Monte Carlo sample of size M in order to approximate the expectation, see also the functions mlehac and phihac,

  • list("nphac", estimator = estimator, type = type) for fully non-parametric estimation using the beta kernel estimator or Gaussian transformation kernel estimator using a fitted hac (via pseudo-maximum likelihood estimation) of type = type to find locally optimal bandwidths, see also the function phinp,

  • list("np", estimator = estimator, bw_method = bw_method) for fully non-parametric estimation using the beta kernel estimator or Gaussian transformation kernel estimator, see phinp for different bw_method arguments (either 1 or 2, for performing local bandwidth selection),

  • list("ellip", grid = grid) for semi-parametric estimation through meta-elliptical copulas, with bandwidths determined by the elliptselect function, see also the function phiellip.

Value

The estimated \Phi-dependence between \mathbf{X}_{1}, \dots, \mathbf{X}_{k}.

References

De Keyser, S. & Gijbels, I. (2024). Hierarchical variable clustering via copula-based divergence measures between random vectors. International Journal of Approximate Reasoning 165:109090. doi: https://doi.org/10.1016/j.ijar.2023.109090.

De Keyser, S. & Gijbels, I. (2024). Parametric dependence between random vectors via copula-based divergence measures. Journal of Multivariate Analysis 203:105336.
doi: https://doi.org/10.1016/j.jmva.2024.105336.

See Also

phihac for computing the \Phi-dependence between all the child copulas of a hac object with two nesting levels, phinp for fully non-parametric estimation of the \Phi-dependence between k random vectors, phiellip for estimating the \Phi-dependence between k random vectors having a meta-elliptical copula.

Examples



# Hierarchical Archimedean copula setting
q = 4
dim = c(2,2)

# Sample size
n = 1000

# Four dimensional hierarchical Gumbel copula
# with parameters (theta_0,theta_1,theta_2) = (2,3,4)
hac = gethac(dim,c(2,3,4),type = 1)

# Sample
sample =  suppressWarnings(HAC::rHAC(n,hac))

# Several estimators for the mutual information between two random vectors of size 2

est_phi_1 = estphi(sample,dim,list("hac",type = 1,M = 10000),function(t){t * log(t)})
est_phi_2 = estphi(sample,dim,list("nphac",estimator = "beta",type = 1),
                                   function(t){t * log(t)})
est_phi_3 = estphi(sample,dim,list("nphac",estimator = "trans",type = 1),
                                   function(t){t * log(t)})
est_phi_4 = estphi(sample,dim,list("np",estimator = "beta",bw_method = 1),
                                   function(t){t * log(t)})
est_phi_5 = estphi(sample,dim,list("np",estimator = "trans",bw_method = 1),
                                   function(t){t * log(t)})
est_phi_6 = estphi(sample,dim,list("np",estimator = "beta",bw_method = 2),
                                   function(t){t * log(t)})
est_phi_7 = estphi(sample,dim,list("np",estimator = "trans",bw_method = 2),
                                   function(t){t * log(t)})

true_phi = phihac(hac,dim,10000,function(t){t * log(t)})

# Gaussian copula setting

q = 4
dim = c(2,2)

# Sample size
n = 1000

# AR(1) correlation matrix with correlation 0.5
R = 0.5^(abs(matrix(1:q-1,nrow = q, ncol = q, byrow = TRUE) - (1:q-1)))

# Sample from 4-dimensional normal distribution
sample = mvtnorm::rmvnorm(n,rep(0,q),R,method = "chol")

# Estimate mutual information via MECIP procedure
est_phi = estphi(sample,dim,list("ellip",grid = seq(0.005,100,by = 0.005)),
                                 function(t){t * log(t)})

true_phi = minormal(R,dim)



VecDep documentation built on April 4, 2025, 5:14 a.m.