estimateCondCDF_vec {CondCopulas} | R Documentation |
Compute kernel-based conditional marginal (univariate) cdfs
Description
This function computes an estimate of the conditional (marginal) cdf
of X1 given a conditioning variable X3.
This function is supposed to be used with computeKernelMatrix
.
Assume that we observe a sample .
We want to estimate the conditional cdf of
given
at point
using the following kernel-based estimator
for every couple where
in
newX1
and in
newX3
.
The matrixK3
should be a matrix of the values
such as the one produced by
computeKernelMatrix(observedX3, newX3, kernel, h)
.
Usage
estimateCondCDF_vec(observedX1, newX1, matrixK3)
Arguments
observedX1 |
a sample of observations of X1 of size n |
newX1 |
a sample of new points for the variable X1, of size p1 |
matrixK3 |
a matrix of kernel values of dimension (p2 , n)
|
Value
It returns a vector of length newX1
of estimators
for every couple
.
Examples
Y = MASS::mvrnorm(n = 100, mu = c(0,0), Sigma = cbind(c(1, 0.9), c(0.9, 1)))
newY1 = seq(-1, 1, by = 0.5)
newY2 = newY1
matrixK = computeKernelMatrix(observedX = Y[,2], newX = newY2,
kernel = "Gaussian", h = 0.8)
vecCondCDF = estimateCondCDF_vec(observedX1 = Y[,1],
newX1 = newY1, matrixK)
vecCondCDF
[Package CondCopulas version 0.1.3 Index]