shape1, shape2, meanlog, sdlog: Shapes, mean and variance of the Double-Pareto Lognormal distribution respectively, defaults to shape1=1.5, shape2=1.5, meanlog=-0.5, sdlog=0.5.
log, log.p: logical; if TRUE, probabilities p are given as log(p).
lower.tail: logical; if TRUE (default), probabilities (moments) are P[X≤x](E[xr∣X≤y]), otherwise, P[X>x](E[xr∣X>y])
p: vector of probabilities
r: rth raw moment of the Pareto distribution
truncation: lower truncation parameter, defaults to xmin
n: number of observations
Returns
ddoubleparetolognormal returns the density, pdoubleparetolognormal the distribution function, qdoubleparetolognormal the quantile function, mdoubleparetolognormal the rth moment of the distribution and rdoubleparetolognormal generates random deviates.
The length of the result is determined by n for rdoubleparetolognormal, and is the maximum of the lengths of the numerical arguments for the other functions.
Details
Probability and Cumulative Distribution Function as provided by if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_citeOnly(keys="reed2004double",package="distributionsrd",cached_env=.Rdpack.currefs) :
## Double-Pareto Lognormal densityplot(x = seq(0,5, length.out =100), y = ddoubleparetolognormal(x = seq(0,5, length.out =100)))plot(x = seq(0,5, length.out =100), y = ddoubleparetolognormal(x = seq(0,5, length.out =100), shape2 =1))## Double-Pareto Lognormal relates to the right-pareto Lognormal distribution if#shape1 goes to infinitypdoubleparetolognormal(q =6, shape1 =1e20, shape2 =1.5, meanlog =-0.5, sdlog =0.5)prightparetolognormal(q =6, shape2 =1.5, meanlog =-0.5, sdlog =0.5)## Double-Pareto Lognormal relates to the left-pareto Lognormal distribution if# shape2 goes to infinitypdoubleparetolognormal(q =6, shape1 =1.5, shape2 =1e20, meanlog =-0.5, sdlog =0.5)pleftparetolognormal(q =6, shape1 =1.5, meanlog =-0.5, sdlog =0.5)## Double-Pareto Lognormal relates to the Lognormal if both shape parameters go to infinitypdoubleparetolognormal(q =6, shape1 =1e20, shape2 =1e20, meanlog =-0.5, sdlog =0.5)plnorm(q =6, meanlog =-0.5, sdlog =0.5)## Demonstration of log functionality for probability and quantile functionqdoubleparetolognormal(pdoubleparetolognormal(2, log.p =TRUE), log.p =TRUE)## The zeroth truncated moment is equivalent to the probability functionpdoubleparetolognormal(2)mdoubleparetolognormal(truncation =2)## The (truncated) first moment is equivalent to the mean of a (truncated) random sample,#for large enough samples.x <- rdoubleparetolognormal(1e5, shape2 =3)mean(x)mdoubleparetolognormal(r =1, shape2 =3, lower.tail =FALSE)sum(x[x > quantile(x,0.1)])/ length(x)mdoubleparetolognormal(r =1, shape2 =3, truncation = quantile(x,0.1), lower.tail =FALSE)