CKT.kendallReg.fit {CondCopulas} | R Documentation |
Fit Kendall's regression, a GLM-type model for conditional Kendall's tau
Description
The function CKT.kendallReg.fit
fits a regression-type model for the
conditional Kendall's tau between two variables X_1
and X_2
conditionally to some predictors Z.
More precisely, it fits the model
\Lambda(\tau_{X_1, X_2 | Z = z}) = \sum_{j=1}^{p'} \beta_j \psi_j(z),
where \tau_{X_1, X_2 | Z = z}
is the conditional Kendall's tau
between X_1
and X_2
conditionally to Z=z
,
\Lambda
is a function from ]-1, 1]
to R
,
(\beta_1, \dots, \beta_p)
are unknown coefficients to be estimated
and \psi_1, \dots, \psi_{p'})
are a dictionary of functions.
To estimate beta
, we used the penalized estimator which is defined
as the minimizer of the following criteria
\frac{1}{2n'} \sum_{i=1}^{n'} [\Lambda(\hat\tau_{X_1, X_2 | Z = z_i})
- \sum_{j=1}^{p'} \beta_j \psi_j(z_i)]^2 + \lambda * |\beta|_1,
where the z_i
are a second sample (here denoted by ZToEstimate
).
The function CKT.kendallReg.predict
predicts
the conditional Kendall's tau between two variables
X_1
and X_2
given Z=z
for some new
values of z
.
Usage
CKT.kendallReg.fit(
observedX1,
observedX2,
observedZ,
ZToEstimate,
designMatrixZ = cbind(ZToEstimate, ZToEstimate^2, ZToEstimate^3),
newZ = designMatrixZ,
h_kernel,
Lambda = identity,
Lambda_inv = identity,
lambda = NULL,
Kfolds_lambda = 10,
l_norm = 1,
h_lambda = h_kernel,
...
)
CKT.kendallReg.predict(fit, newZ, lambda = NULL, Lambda_inv = identity)
Arguments
observedX1 |
a vector of |
observedX2 |
a vector of |
observedZ |
a vector of |
ZToEstimate |
the intermediary dataset of observations of |
designMatrixZ |
the transformation of the |
newZ |
the new observations of the conditioning variable. |
h_kernel |
bandwidth used for the first step of kernel smoothing. |
Lambda |
the function to be applied on conditional Kendall's tau. By default, the identity function is used. |
Lambda_inv |
the functional inverse of |
lambda |
the regularization parameter. If |
Kfolds_lambda |
the number of folds used in the cross-validation
procedure to choose |
l_norm |
type of norm used for selection of the optimal lambda by cross-validation.
|
h_lambda |
the smoothing bandwidth used in the cross-validation
procedure to choose |
... |
other arguments to be passed to |
fit |
the fitted model, obtained by a call
to |
Value
The function CKT.kendallReg.fit
returns
a list with the following components:
-
estimatedCKT
: the estimated CKT at the new data pointsnewZ
. -
fit
: the fitted model, of S3 class glmnet (seeglmnet::glmnet
for more details). -
lambda
: the value of the penalized parameter used. (i.e. either the one supplied by the user or the one determined by cross-validation)
CKT.kendallReg.predict
returns
the predicted values of conditional Kendall's tau.
References
Derumigny, A., & Fermanian, J. D. (2020). On Kendall’s regression. Journal of Multivariate Analysis, 178, 104610. doi:10.1016/j.jmva.2020.104610
See Also
See also other estimators of conditional Kendall's tau:
CKT.fit.tree
, CKT.fit.randomForest
,
CKT.fit.nNets
, CKT.predict.kNN
,
CKT.kernel
, CKT.fit.GLM
,
and the more general wrapper CKT.estimate
.
See also the test of the simplifying assumption that a
conditional copula does not depend on the value of the
conditioning variable using the nullity of Kendall's regression
coefficients: simpA.kendallReg
.
Examples
# We simulate from a conditional copula
set.seed(1)
N = 400
Z = rnorm(n = N, mean = 5, sd = 2)
conditionalTau = -0.9 + 1.8 * pnorm(Z, mean = 5, sd = 2)
simCopula = VineCopula::BiCopSim(N=N , family = 1,
par = VineCopula::BiCopTau2Par(1 , conditionalTau ))
X1 = qnorm(simCopula[,1])
X2 = qnorm(simCopula[,2])
newZ = seq(2, 10, by = 0.1)
estimatedCKT_kendallReg <- CKT.kendallReg.fit(
observedX1 = X1, observedX2 = X2, observedZ = Z,
ZToEstimate = newZ, h_kernel = 0.07)
coef(estimatedCKT_kendallReg$fit,
s = estimatedCKT_kendallReg$lambda)
# Comparison between true Kendall's tau (in black)
# and estimated Kendall's tau (in red)
trueConditionalTau = -0.9 + 1.8 * pnorm(newZ, mean = 5, sd = 2)
plot(newZ, trueConditionalTau , col="black",
type = "l", ylim = c(-1, 1))
lines(newZ, estimatedCKT_kendallReg$estimatedCKT, col = "red")