emp_cdf: Corrected Empirical CDF

View source: R/tools.R

emp_cdfR Documentation

Corrected Empirical CDF

Description

The empirical CDF with tail correction, ensuring that its output is never 0 or 1.

Usage

emp_cdf(x)

Arguments

x

numeric vector of observations

Details

The corrected empirical CDF is defined as

F_n(x) = \frac{1}{n + 1} \min\biggl\{1, ∑_{i = 1}^n 1(X_i ≤ x)\biggr\}

Value

A function with signature function(x) that returns F_n(x).

Examples

# fit ECDF on simulated data
x <- rnorm(100)
cdf <- emp_cdf(x)

# output is bounded away from 0 and 1
cdf(-50)
cdf(50)

rvinecopulib documentation built on March 7, 2023, 6:20 p.m.