ecdf2D: Bidimensional Empirical Cumulative Distribution Function

Description Usage Arguments Details Value Note See Also Examples

View source: R/ecdf2D.R

Description

Compute the empirical cumulative distribution function for a bivariate continuous distribution.

Usage

1
ecdf2D(x, y)

Arguments

x, y

the two continuous variables. Must be of same length.

Details

The bidimensional e.c.d.f. (empirical cumulative distribution function) Fn is a step function with jumps i/n at observation values, where i is the number of tied observations at that value.

For observations (x1,y1), ..., (x_n,y_n), Fn is defined as

Fn(t1,t2) = #{xi<=t1,yi<=t2}/n = 1/n sum_{i=1}^n Indicator(xi<=t1,yi<=t2)

Value

The result is returned as a matrix of dimension (n*n) where the entry (i,j) corresponds to Fn(xi,yj), i=1, ...,n, j=1, ...,n.

Note

Missing values are removed such that if a value of x (resp. y) is missing then the corresponding values of both x and y are removed. The bidimensional e.c.d.f. is then computed on the remaining elements.

See Also

indeptest; the bivariate package also provides plots for the bidimensional e.c.d.f.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#Simulated data #1
x<-c(0.2, 0.3, 0.1, 0.4)
y<-c(0.5, 0.4, 0.05, 0.2)
ecdf2D(x,y)

#Simulated data #2
n<-40
x<-rnorm(n)
y<-x^2+0.3*rnorm(n)
plot(x,y)
ecdf2D(x,y)

obouaziz/robusTest0 documentation built on Dec. 22, 2021, 4:13 a.m.