edf: Empirical Distribution Function

Description Usage Arguments Value Examples

View source: R/Utility.R

Description

This function calculates the empirical distribution function at each element of a vector of observations.

Usage

1
edf(v, adjust = FALSE)

Arguments

v

vector, observations of length n.

adjust

logical, adjustment of denominator to be (n + 1).

Value

vector

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(smi)
data(ftse100)
s1 <- window(ftse100, "1990-11-09", "2004-03-25")
s1a <- alignDailySeries(s1)
s2a <- alignDailySeries(smi)
idx <- merge(s1a, s2a)
r <-returns(idx)
rp <- series(window(r, "1994-01-01", "2003-12-31"))
rp <- rp[(rp[, 1] != 0) & (rp[, 2] !=0), ]
Udata <- apply(rp, 2, edf, adjust = 1)
plot(Udata)

Example output

Loading required package: gsl
Loading required package: Matrix
Loading required package: mvtnorm
Loading required package: numDeriv
Loading required package: timeSeries
Loading required package: timeDate

Attaching package: 'QRM'

The following object is masked from 'package:base':

    lbeta

QRM documentation built on April 14, 2020, 6:49 p.m.