betakernelestimator: betakernelestimator

View source: R/betakernelestimator.R

betakernelestimatorR Documentation

betakernelestimator

Description

This function computes the non-parametric beta kernel copula density estimator.

Usage

betakernelestimator(input, h, pseudos)

Arguments

input

The copula argument at which the density estimate is to be computed.

h

The bandwidth to be used in the beta kernel.

pseudos

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

Details

Given a q-dimensional random vector \mathbf{X} = (\mathbf{X}_{1}, \dots, \mathbf{X}_{k}) with \mathbf{X}_{i} = (X_{i1}, \dots, X_{id_{i}}), and samples X_{ij}^{(1)}, \dots, X_{ij}^{(n)} from X_{ij} for i = 1, \dots, k and j = 1, \dots, d_{i}, the beta kernel estimator for the copula density of \mathbf{X} equals, at \mathbf{u} = (u_{11}, \dots, u_{kd_{k}}) \in \mathbb{R}^{q},

\widehat{c}_{\text{B}}(\mathbf{u}) = \frac{1}{n} \sum_{\ell = 1}^{n} \prod_{i = 1}^{k} \prod_{j = 1}^{d_{i}} k_{\text{B}} \left (\widehat{U}_{ij}^{(\ell)},\frac{u_{ij}}{h_{n}} + 1, \frac{1-u_{ij}}{h_{n}} + 1 \right ),

where h_{n} > 0 is a bandwidth parameter, \widehat{U}_{ij}^{(\ell)} = \widehat{F}_{ij} (X_{ij}^{(\ell)}) with

\widehat{F}_{ij}(x_{ij}) = \frac{1}{n+1} \sum_{\ell = 1}^{n} 1 \left (X_{ij}^{(\ell)} \leq x_{ij} \right )

the (rescaled) empirical cdf of X_{ij}, and

k_{\text{B}}(u,\alpha,\beta) = \frac{u^{\alpha - 1} (1-u)^{\beta-1}}{B(\alpha,\beta)},

with B the beta function.

Value

The beta kernel copula density estimator evaluated at the input.

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.

See Also

transformationestimator for the computation of the Gaussian transformation kernel copula density estimator, hamse for local bandwidth selection for the beta kernel or Gaussian transformation kernel copula density estimator, phinp for fully non-parametric estimation of the \Phi-dependence between k random vectors.

Examples

q = 3
n = 100

# Sample from multivariate normal distribution with identity covariance matrix
sample = mvtnorm::rmvnorm(n,rep(0,q),diag(3),method = "chol")

# Copula pseudo-observations
pseudos = matrix(0,n,q)
for(j in 1:q){pseudos[,j] = (n/(n+1)) * ecdf(sample[,j])(sample[,j])}

# Argument at which to estimate the density
input = rep(0.5,q)

# Local bandwidth selection
h = hamse(input,pseudos = pseudos,n = n,estimator = "beta",bw_method = 1)

# Beta kernel estimator
est_dens = betakernelestimator(input,h,pseudos)

# True density
true = copula::dCopula(input, copula::normalCopula(0, dim = q))


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