estimateCondCDF_matrix {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.
Usage
estimateCondCDF_matrix(observedX1, newX1, matrixK3)
Arguments
observedX1 |
a sample of observations of X1 of size |
newX1 |
a sample of new points for the variable X1, of size |
matrixK3 |
a matrix of kernel values of dimension |
Details
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 in
newX1
and every in
newX3
.
The matrixK3
should be a matrix of the values
such as the one produced by
computeKernelMatrix(observedX3, newX3, kernel, h)
.
Value
A matrix of dimensions (p1 = length(newX), p3 = length(matrixK3[,1]))
of estimators for every possible choices
of
.
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 = c(0, 1, 2)
matrixK = computeKernelMatrix(observedX = Y[,2], newX = newY2,
kernel = "Gaussian", h = 0.8)
# In this matrix, there are the estimated conditionl cdf at points given by newY1
# conditionally to the points given by newY2.
matrixCondCDF = estimateCondCDF_matrix(observedX1 = Y[,1],
newX1 = newY1, matrixK)
matrixCondCDF