Description Usage Arguments Details Value Author(s) References Examples
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$.
1 |
x |
A 2-columns data.frame with numeric observations (x1,y1),...,(xn,yn). |
x[i+1,j+1]
is equivalent to Cn(i/n,j/n). Deheuvels, 1979 or Nelsen, 2006.
An integer (n+1)x(n+1)-matrix with the values of the empirical copula multiplied by $n$.
Francisco Mendoza-Torres (mentofran@gmail.com) and Arturo Erdely (arturo.erdely@comunidad.unam.mx)
Equation (3) of Erdely, A. and Diaz-Viera, M. 2010.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.