empiricalCDF2Dcounts: Computes the empirical bivariate distribution and store the...

Description Usage Arguments Details Value Author(s) References Examples

Description

Computes the matrix of counts for the empirical distribution. To get the real empirical distribution values divede the result by $n$. This function considers that there are no duplicated values both in $x$ and in $y$.

Usage

1

Arguments

x

A 2-columns data.frame with numeric observations (x1,y1),...,(xn,yn).

Details

x[i+1,j+1] is equivalent to Cn(i/n,j/n). Deheuvels, 1979 or Nelsen, 2006.

Value

An integer (n+1)x(n+1)-matrix with the values of the empirical copula multiplied by $n$.

Author(s)

Francisco Mendoza-Torres (mentofran@gmail.com) and Arturo Erdely (arturo.erdely@comunidad.unam.mx)

References

Equation (3) of Erdely, A. and Diaz-Viera, M. 2010.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Example 1
library(squash)
exy <- cbind(1:5, c(2, 4, 3, 6, 7)); print(exy)
set.seed(1); exy <- exy[sample(1:5), ]
print(empiricalCDF2Dcounts(exy))
# to compute the empirical distribution values divide by n
(1/5)* empiricalCDF2Dcounts(exy)

# Example 2
x <- cbind(1:5, c(4, 2, 1, 5, 3))
print(empiricalCDF2Dcounts(x))
# to compute the empirical distribution values divide by n
(1/5)* empiricalCDF2Dcounts(x)

# Example 3 (Error catch):
exy <- cbind(x=c(1:3,2),y=c(1,2,3,2))
# empiricalCDF2Dcounts(exy)

mathphysmx/empiricalDistribution documentation built on May 7, 2019, 10:55 p.m.