ecdf2: Calculate cumulative density

View source: R/ecdf2.R

ecdf2R Documentation

Calculate cumulative density

Description

Calculates the cumulative density of a set of numeric values.

Usage

ecdf2(x, y = NULL)

Arguments

x

A numeric vector of which the ECDF should be calculated

y

A numeric vector. See details for explanation

Details

This function extends the functionality of of the standard implementation of ECDF. Sometimes it is desireable to get the ECDF from pre-tabulated values. For this, elements in x and y have to be linked to each other.

Value

A list

See Also

ecdf for the standard implementation of ECDF

Examples

x <- rnorm(1000)
e <- ecdf2(x)
str(e)
plot(e)
plot(e$x, e$cs)

x <- sample(1:100, 1000, replace=TRUE)
plot(ecdf2(x))
tab <- table(x)
x <- unique(x)
lines(ecdf2(x, y=tab), col="green")

fitteR documentation built on March 18, 2022, 7:20 p.m.

Related to ecdf2 in fitteR...