ecdfHT.fit: Fit heavy tailed data with a semi-parameteric model

Description Usage Arguments Value Examples

View source: R/ecdfHT.R

Description

Compute an interpolation of the transformed cdf in the middle with parametric power law decay on the tails.

Usage

1
2
3
4
ecdfHT.fit(p, transform.info, x.min = NA, x.max = NA, add.to.plot = TRUE,
  weights = "var", ...)

ecdfHT.fit.tails(p, transform.info, weights, add.to.plot = TRUE, ...)

Arguments

p

Vector of 2 probabilities that identify the quantile where data is cut to fit power decay on lower/upper tail. Set tail.p[1]=0 to exclude lower tail fit; tail.p[2]=1 to exclude upper tail fit.

transform.info

List containing transformation information, returned from ecdfHT

x.min

Number describing cut-off of lower tail

x.max

Number describing cut-off of upper tail

add.to.plot

Boolean indicating whether or not the interpolation is plotted

weights

'none' to do unweighted regression or 'var' to use weighted regression on tail with weights proportional to variance of quantile

...

Optional parameters passed to plot routines, e.g. col='red'

Value

An object of class 'ecdfHT.fit' specifying the interpolation. The fields in the value are:

scale.q

vector of length 3, copied from the input argument

scale.x

vector of length 3, the quantiles from the data corresponding to scale.q

xsort

vector of the sorted, unique data values

ecdf

nonstandard empirical cdf, see details

xx

transformed x values: xx[i]=h(xsort[i])

yy

transformed p values: yy[i]=g(ecdf[i])

cdf.spline

monotonic spline function used to compute the cdf

inf.cdf.spline

monotonic spline function used to compute the inverse of the cdf

tail.p

vector of length 2; probabilities saying where the lower and upper tails begin. Note these are generally not the exact values of input variable p, rather they are the closest values to those found in ecdf

tail.x

vector of length 2; x values where the lower and upper tails begin

tail.c

vector of length 2; tail constants for lower and upper powerlaw fit

tails.slope

vector of length 2; slope of tails on transformed plot

tail.alpha

vector of length 2; exponents for lower and upper power law fit

tail.m

integer vector of length 2; indices in xsort where tails begin

weights

copy of input variable weights

Examples

1
2
3
4
x <- rcauchy( 1000 )
a <- ecdfHT( x )
fit <- ecdfHT.fit( c(.1,.9), a, col='red' )
str(fit)

ecdfHT documentation built on May 2, 2019, 1:09 p.m.