compute_etahat {ElliptCopulas} | R Documentation |
\hat{\eta}_k
\hat{\eta}_k
is a quantity that is useful
for estimating the k
-th derivative of the generator
of an elliptical distribution.
It is defined in Section 3 of (Ryan and Derumigny, 2024).
compute_etahat(
X,
mu = 0,
Sigma_m1 = diag(d),
grid,
h,
Kernel = "gaussian",
a = 1,
k,
mpfr = FALSE,
precBits = 100,
dopb = TRUE
)
X |
a matrix of size |
mu |
mean of X. This can be the true value or an estimate. It must be
a vector of dimension |
Sigma_m1 |
inverse of the covariance matrix of X.
This can be the true value or an estimate. It must be
a matrix of dimension |
grid |
grid of values on which to estimate the density generator. |
h |
bandwidth of the kernel. Can be either a number or a vector of the
size |
Kernel |
name of the kernel. Possible choices are
|
a |
tuning parameter to improve the performance at 0. |
k |
order of the derivative |
mpfr |
if |
precBits |
number of precBits used for floating point precision
(only used if |
dopb |
a Boolean value.
If |
a vector of size n1 = length(grid)
.
Each component of this vector is \hat{\eta}_k(x[i])
where x[i]
is the i
-th element of the grid.
Victor Ryan, Alexis Derumigny
if (FALSE){
# Comparison between the estimated and true generator of the Gaussian distribution
n = 500000
d = 3
X = matrix(rnorm(n * d), ncol = d)
grid = seq(0, 5, by = 0.1)
a = 0.7
etahat = compute_etahat(X = X, grid = grid, a = a, h = 0.04, k = 1)
plot(grid, etahat, type = "l", ylim = c(-0.02, 0.02))
# Computation of true values
g = exp(-grid/2)/(2*pi)^{3/2}
gprime = (-1/2) *exp(-grid/2)/(2*pi)^{3/2}
A = a^(d/2)
psia = -a + (A + grid^(d/2))^(2/d)
psiaprime = grid^(d/2 - 1) * (A + grid^(d/2))^(2/d - 1)
psiasecond = psiaprime * ( (d-2)/2 ) * grid^{-1} * A *
( grid^(d/2) + A )^(-1)
rhoprimexi = ((d-2) * grid^((d-4)/2) * psiaprime
- 2 * grid^((d-2)/2) * psiasecond) / (2 * psiaprime^3) * g +
grid^((d-2)/2) / (psiaprime^2) * gprime
lines(grid, rhoprimexi, col = "red")
}