bernstein2DderivativeY: Partial derivative of the Bernstein-Bezier polynomial with...

Description Usage Arguments Value References Examples

View source: R/bernstein2DderivativeY.R

Description

Computes the partial derivative of the Bernstein-Bezier polynomial with respect to x. For copula theory, it is required for the conditional distribution method simulation algorithm in the book 'Mai et al., 2012. Simulating copulas'.

Usage

1
bernstein2DderivativeY(u, v, diffEC)

Arguments

u, v

numeric vector of values (pseudo-observartions) in the unit square [0,1]x[0,1]. For copulas, u=F(x), v=G(y).

diffEC

Forward difference integer matrix resulting from the empirical copula matrix. Maybe computed with forwardDifference of empiricalCDF2Dcounts.

Value

Numeric value, the partial derivative.

References

Section 5.3 of book 'Mai et al., 2012. Simulating copulas' computed by the derivative in Eq. 5.23 of the Book of "Goldman, 2002, Pyrimid algorithms..." (the same as eq 7.15 of "phillips, 2003, Interpolation and Approximation...") Notice that this partial derivative is a function of u, with v being treated as constant or an extra parameter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(empiricalDistribution)
exy <- cbind(1:5, c(2, 4, 3, 6, 7)); print(exy)
set.seed(1); exy <- exy[sample(1:5), ]
empCopulaCountsmatrix <- empiricalCDF2Dcounts(exy)
eu <- 0.5; ev <- 0.7
bernstein2DderivativeY(u = eu, v = ev,
                      diffEC = forwardDifference(empCopulaCountsmatrix, i =2))

# Example 2:
library(copBasic)
n <- 100
exy <- PLACKETTsim(n, para=20.3) # simulate strong positive Plackett
plotProbs(exy)
empCopulaCountsmatrix <- empiricalCDF2Dcounts(exy)
eu <- 0.5; ev <- 0.7
bernstein2DderivativeY(u = eu, v = ev,
                      diffEC = forwardDifference(empCopulaCountsmatrix, i =2))

mathphysmx/bernstein documentation built on Sept. 3, 2019, 12:57 p.m.