| Title: | Calculates the N-Fold Convolution of Two Pareto Distributions |
|---|---|
| Description: | Calculates the n-fold convolution of two Pareto distributions using the techniques devised by Colin Ramsay. |
| Authors: | Mark Padgham [aut, cre], Colin Gillespie [ctb, cph] (Author of included rplconv code) |
| Maintainer: | Mark Padgham <[email protected]> |
| License: | GPL-3 + file LICENSE |
| Version: | 0.0.1.001 |
| Built: | 2026-05-11 06:28:51 UTC |
| Source: | https://github.com/mpadge/paretoconv |
This function extends directly from the poweRlaw function of the same
name, and compares a discrete power law distribution from the poweRlaw
package with an equivalent convoluted distribution generated by
paretoconv.
compare_conv_distributions(d1, d2)compare_conv_distributions(d1, d2)
d1 |
Discrete power law distribution of class |
d2 |
Equivalent convoluted values for the probability density function
obtained from |
## Not run: data ('native_american', package = 'poweRlaw') m1 <- displ$new(native_american$Cas) m1$setXmin (3) m1$setPars (estimate_pars(m1)) x <- sort (unique (native_american$Cas)) y <- paretoconv (x = x, a = m1$getPars (), x0 = 3, n = 2, cdf = FALSE, quiet = FALSE) compare_conv_distributions (m1, y) ## End(Not run)## Not run: data ('native_american', package = 'poweRlaw') m1 <- displ$new(native_american$Cas) m1$setXmin (3) m1$setPars (estimate_pars(m1)) x <- sort (unique (native_american$Cas)) y <- paretoconv (x = x, a = m1$getPars (), x0 = 3, n = 2, cdf = FALSE, quiet = FALSE) compare_conv_distributions (m1, y) ## End(Not run)
Get limit of asymptotic convergence
get_asymp_limit(a, n, x0, tol = 0.05, quiet = FALSE)get_asymp_limit(a, n, x0, tol = 0.05, quiet = FALSE)
a |
The primary shape parameter of the Pareto distribution (single value only) |
n |
Number of convolutions (single value only) |
x0 |
Lower cut-off point of classical heavy-tailed distribution (generally obtained emprically with the poweRlaw package). |
tol |
Convergence tolerance (values around 0.05 are typically sufficient; values < 0.01 will generally not work). |
quiet |
If FALSE, issue progress messages |
Single integer value of limit beyond which PDF may be approximated by its asymptotic power law
Locally optimal fitting of convoluted Pareto distribution to observed data
pareto_optimise(m, x0 = 1, n = 1, check_non_conv = TRUE, quiet = TRUE)pareto_optimise(m, x0 = 1, n = 1, check_non_conv = TRUE, quiet = TRUE)
m |
A |
x0 |
Initial guess for lower limit of Pareto distribution |
n |
Initial guess for number of convolutions |
check_non_conv |
If TRUE first checks whether a non-convoluted model may be optimal |
quiet |
If FALSE, progress information is dumped to screen |
Position of the local optimum as quantified by x0 and
n, along with associated Kolmogorow-Smirnov statistic quantifying
maximal distance from convoluted Pareto Cumulative Distribution Function
(CDF) and empirical CDF of model m.
This function only finds local optima - it is up to the user to ensure
that the given start values are near the global optimum. Values of n = 0
are NOT searched.
Calculates the n-fold convolution of two Pareto distributions using the techniques devised by Colin Ramsay.
Convolutes multiple Pareto distributions following
For integer shape parameters: 'The Distribution of Sums of Certain I.I.D. Pareto Variates' by Colin Ramsay (Communications in Statistics - Theory and Methods 35:395-405, 2006);
For non-integer shape parameters: 'The Distribution of Sums of I.I.D. Pareto Random Variables with Arbitrary Shape Parameter' by Colin Ramsay (Communications in Statistics - Theory and Methods 37:2177-2184, 2008).
paretoconv(x, a, n, x0 = 1, cdf = FALSE, asymp = TRUE, quiet = TRUE)paretoconv(x, a, n, x0 = 1, cdf = FALSE, asymp = TRUE, quiet = TRUE)
x |
value of independent variable (may be a vector) |
a |
The primary shape parameter of the Pareto distribution (single value only) |
n |
Number of convolutions (single value only) |
x0 |
Lower cut-off point of classical heavy-tailed distribution (generally obtained emprically with the poweRlaw package). |
cdf |
If TRUE, returns the cumulative distribution function, otherwise returns the probability density function. |
asymp |
If TRUE and |
quiet |
If FALSE, issue progress messages |
Value for the CDF or PDF from the convolution of two Pareto distributions of shape a at the value x.
The Pareto distribution may be defined as f(x)=(a/b)(b/x)^(a-1), where
a and b are the primary and secondary shape parameters, respectively. It
presumed here without loss of generality that b=1 and thus f(x)=a x^(1-a).
Convolution of multiple distritions (that is, n>0) are NOT normalised,
so CDFs to not sum to unity, and PDFs do not integrate to unity.
Mark Padgham
Useful links:
paretoconv (x=1:10, a=2, n=0)paretoconv (x=1:10, a=2, n=0)
Calculates integral of probability density functions for convoluted Pareto distributions
pdf_integral(a, x0 = 1, n = 0, discrete = TRUE, xmin = 0, quiet = TRUE)pdf_integral(a, x0 = 1, n = 0, discrete = TRUE, xmin = 0, quiet = TRUE)
a |
Shape parameter of Pareto disitribution |
x0 |
Lower cut-off for classic Pareto distribution |
n |
Number of convolutions |
discrete |
Calculate integral for discrete (TRUE) or continuous (FALSE) probability density function |
xmin |
Lower limit of integral (generally 0, 1, or x0) |
quiet |
If FALSE, progress is displayed as screen output |
Values for discrete integrals differ from values from continuous integrals. This function can also take a long time to execute, particularly for continuous integrals.
pdf_integral (a = 2.1, x0 = 5, n = 0)pdf_integral (a = 2.1, x0 = 5, n = 0)
Estimate probability of observed KS statistic from synthetic models
pparetoconv(m, x0, n, neach = 10, quiet = TRUE)pparetoconv(m, x0, n, neach = 10, quiet = TRUE)
m |
A |
x0 |
Initial guess for lower limit of Pareto distribution |
n |
Initial guess for number of convolutions |
neach |
Number of test statistics to be generated for each different model |
quiet |
If FALSE, display progress messages on screen |
Single value representing probability of observing given value of
ks
Generate random deviates for power laws
rplconv(n, x0, alpha, discrete_max = 10000)rplconv(n, x0, alpha, discrete_max = 10000)
n |
Number of deviates |
x0 |
Traditional cutoff parameter of Pareto distribution |
alpha |
Primary shape parameter of Pareto distribution |
discrete_max |
Upper limit for generation (see |
Vector of n random deviates
This is directly cribbed from poweRlaw::rpldis, modified only to
generate random deviates for all values including 0<x<xmin.