EmpCop: Computes the empirical distribution function from counts...

Description Usage Arguments Details Author(s) Examples

Description

Empirical copula (distribution function) from counts (densities).

Usage

1
EmpCop(uv = NULL, d)

Arguments

uv

2-column table (matrix or data.frame) of pseudo-observaritions in [0,1]X[0,1]. Default to NULL. If specified, d is computed using pj1j2Matrix.

d

Densities matrix from a bivariate histogram. Maybe a result from the function pj1j2Matrix.

Details

This function implements the empirical copula in agreement with formula (3) "Carnicero, 2013. Non-parametric copulas ...", and reproduce the same result as the function genmat.copem when k = n, and the Definition 5.6.1 of "Nelsen, 2006. Introduction to copulas"

Author(s)

Francisco Mendoza-Torres (mentofran@gmail.com)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Example 1
library(squash)
xye <- cbind(1:5, c(2, 4, 3, 6, 7))
uve <- cbind(u = ecdf(xye[,1])(xye[,1]), # Empirical CDF values
             v = ecdf(xye[,2])(xye[,2]))
Emp_cop_matrix <- EmpCop(uv = uve)

# Exapmle 2
xye <- cbind(1:5, c(2, 4, 3, 6, 7))
uve <- cbind(u = ecdf(xye[,1])(xye[,1]),
             v = ecdf(xye[,2])(xye[,2]))
ne <- nrow(xye)
DensMatrix <- pj1j2Matrix(uv = uve, k = ne)$dens
Emp_cop_matrix <- EmpCop(d = DensMatrix)

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