View source: R/betakernelestimator.R
betakernelestimator | R Documentation |
This function computes the non-parametric beta kernel copula density estimator.
betakernelestimator(input, h, pseudos)
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 |
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.
The beta kernel copula density estimator evaluated at the input.
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.
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.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.