Learn R Programming

ptsuite (version 1.0.0)

pareto_qq_test: Q-Q Plot to test for Pareto Distribution

Description

This function can be used as a first step to identify whether the data is Pareto distributed before estimating the tail index. If most of the data points appear to be distributed along a line, it is possible that the data may be Pareto. Conversely, if most of the data are distributed non-linearly, then the data is most probably not Pareto distributed.

Usage

pareto_qq_test(dat)

Arguments

dat

Data to be tested for Pareto distribution

Value

A Q-Q plot either using plotly if package is available or else a standard R plot.

Details

This function plots the quantiles of the standard exponential distribution on the x-axis and the log values of the provided data on the y-axis. If Pareto data was supplied, a log transformation of this data would result in an exponential distribution with mean \(\alpha\). These data points would then show up on the QQ-plot as a line with slope \(1/\alpha\).

The function makes use of the plotly package if available and installed or if not, defaults to the standard R plot.

Examples

Run this code
# NOT RUN {
x <- generate_pareto(10000, 5, 2)
pareto_qq_test(x)

# }

Run the code above in your browser using DataLab