pareto.fit: Estimate parameters of Pareto distribution

Description Usage Arguments Value Examples

View source: R/gsea.R

Description

A wrapper for functions implementing actual methods

Usage

1
pareto.fit(data, threshold)

Arguments

data

data vector, lower threshold (or 'find', indicating it should be found from the data), method (likelihood or regression, defaulting to former)

threshold

numeric value to define the start of the tail

Value

List indicating type of distribution ('pareto'), parameters, information about fit (depending on method), OR a warning and NA if method is not recognized

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Estimate the tail of a pospulation normally distributed
set.seed(1)
x<-rnorm(1000)
q95<-as.numeric(quantile(abs(x),0.95))
fit<-pareto.fit(abs(x),threshold=q95)
# We can infer the pvalue of a value very much right to the tail of the
# distribution
value<-5
pvalue<-ppareto(value, threshold=q95, exponent=fit$exponent,
lower.tail=FALSE)/20
plot(density(abs(x)),xlim=c(0,value+0.3),main='Pareto fit')
arrows(value,0.2,value,0)
text(value,0.2,labels=paste0('p=',signif(pvalue,2)))

vulcan documentation built on Nov. 8, 2020, 8:15 p.m.