Learn R Programming

Renext (version 1.0-0)

spareto: Shifted Pareto dstribution

Description

Density function, distribution function, quantile function and random generation for the shifted Pareto distribution. distribution.

Usage

dspareto(x, delta = 1.0, shape = 4.0, log = FALSE)
   pspareto(q, delta = 1.0, shape = 4.0, lower.tail = FALSE)
   qspareto(p, delta = 1.0, shape = 4.0)
   rspareto(n, delta = 1.0, shape = 4.0)

Arguments

x, q
Vector of quantiles.
p
Vector of probabilities.
n
Number of observations.
delta, shape
Shift and shape parameters. Vectors of length > 1 are not accepted.
log
Logical; if TRUE, the log density is returned.
lower.tail
Logical; if TRUE (default), probabilities are $\textrm{Pr}[X <= x]$,="" otherwise,="" $\textrm{pr}[x=""> x]$

Value

  • dspareto gives the density function, pspareto gives the distribution function, qspareto gives the quantile function, and rspareto generates random deviates.

Details

The spareto distribution function with shape $\rho>0$ and shift $\delta>0$ has distribution function $$F(y) = 1- \left[\frac{\delta}{\delta+y}\right]^\rho \quad y>0$$ This distribution has increasing hazard and decreasing mean residual life (MRL). The coefficient of variation decreases with $\rho$ and tends to $1$ for large $\rho$. The default value $\rho=4$ corresponds to $CV = \sqrt{2}$. This distribution is sometimes called log-exponential. It is occasionally used in POT with the shift delta taken as the threshold.

Examples

Run this code
library(Renext)
shape <- 5; delta <- 10

xl <- qspareto(c(0.00, 0.99), delta = delta, shape = shape)
x <- seq(from = xl[1], to = xl[2], length.out = 200)
f <- dspareto(x, delta = delta, shape = shape)
plot(x, f, type = "l", main ="Shifted Pareto distribution density")

F <- pspareto(x, delta = delta, shape = shape)
plot(x, F, type ="l", main ="Shifted Pareto distribution function")

Run the code above in your browser using DataLab