dpareto {PtProcess} | R Documentation |
Pareto and Tapered Pareto Distributions
Description
Density, cumulative probability, quantiles and random number generation for the Pareto and tapered Pareto distributions with shape parameter , tapering parameter
and range
; and log-likelihood of the tapered Pareto distribution.
Usage
dpareto(x, lambda, a, log=FALSE)
ppareto(q, lambda, a, lower.tail=TRUE, log.p=FALSE)
qpareto(p, lambda, a, lower.tail=TRUE, log.p=FALSE)
rpareto(n, lambda, a)
dtappareto(x, lambda, theta, a, log=FALSE)
ltappareto(data, lambda, theta, a)
ptappareto(q, lambda, theta, a, lower.tail=TRUE, log.p=FALSE)
qtappareto(p, lambda, theta, a, lower.tail=TRUE, log.p=FALSE,
tol=1e-8)
rtappareto(n, lambda, theta, a)
ltappareto(data, lambda, theta, a)
Arguments
x , q |
vector of quantiles. |
p |
vector of probabilities. |
data |
vector of sample data. |
n |
number of observations to simulate. |
lambda |
shape parameter, see Details below. |
theta |
tapering parameter, see Details below.. |
a |
the random variable takes values on the interval |
log , log.p |
logical; if |
lower.tail |
logical; if |
tol |
convergence criteria for the Newton Raphson algorithm for solving the quantiles of the tapered Pareto distribution. |
Details
For all functions except ltappareto
, arguments lambda
and theta
can either be scalars or vectors of the same length as x
, p
, or q
. If a scalar, then this value is assumed to hold over all cases. If a vector, then the values are assumed to have a one to one relationship with the values in x
, p
, or q
. The argument a
is a scalar.
In the case of ltappareto
, all data
are assumed to be drawn from the same distribution and hence lambda
, theta
and a
are all scalars.
Let be an exponential random variable with parameter
. Then the distribution function of
is
and the density function is
Further, the mean and variance of the distribution of is
and
, respectively.
Now transform as
where . Then
is a Pareto random variable with shape parameter
and distribution function
where , and density function
We simulate the Pareto deviates by generating exponential deviates, and then transforming as described above.
As above, let be Pareto with shape parameter
, and define
to be exponential with parameter
, i.e.
and
where . Say we sample one independent value from each of the distributions
and
, then
We say that has a tapered Pareto distribution if it has the above distribution, i.e.
The above relationship shows that a tapered Pareto deviate can be simulated by generating independent values of and
, and then letting
. This minimum has the effect of “tapering” the tail of the Pareto distribution.
The tapered Pareto variable has density
Given a sample of data , we write the log-likelihood as
Hence the gradients are calculated as
and
Further, the Hessian is calculated using
and
See the section “Seismological Context” (below), which outlines its application in Seismology.
Value
dpareto
and dtappareto
give the densities; ppareto
and ptappareto
give the distribution functions; qpareto
and qtappareto
give the quantile functions; and rpareto
and rtappareto
generate random deviates.
ltappareto
returns the log-likelihood of a sample using the tapered Pareto distribution. It also calculates, using analytic expressions (see “Details”), the derivatives and Hessian which are attached to the log-likelihood value as the attributes "gradient"
and "hessian"
, respectively.
Seismological Context
The Gutenberg-Richter (GR) Law says that if we plot the base 10 logarithm of the number of events with magnitude greater than (vertical axis) against
(horizontal axis), there should be a straight line. This is equivalent to magnitudes having an exponential distribution.
Assume that the magnitude cutoff is , and let
. Given that
has an exponential distribution with parameter
, it follows that
The coefficient is often referred to as the
-value, and its negative value is the slope of the line in the GR plot.
Now define as
When ,
is the “stress”; and when
,
is the “seismic moment”. Still assuming that
is exponential with parameter
, then
is also exponential with parameter
. Hence, by noting that
can be rewritten as
it is seen that is Pareto with parameter
, and
.
While the empirical distribution of magnitudes appears to follow an exponential distribution for smaller events, it provides a poor approximation for larger events. This is because it is not physically possible to have events with magnitudes much greater than about 9.5. Consequently, the tail of the Pareto distribution will also be too long. Hence the tapered Pareto distribution provides a more realistic description.
See Also
See dexp
for the exponential distribution. Generalisations of the exponential distribution are the gamma distribution dgamma
and the Weibull distribution dweibull
.
See the topic distribution
for examples of estimating parameters.
Examples
# Simulate and plot histogram with density for Pareto Distribution
a0 <- 2
lambda0 <- 2
x <- rpareto(1000, lambda=lambda0, a=a0)
x0 <- seq(a0, max(x)+0.1, length=100)
hist(x, freq=FALSE, breaks=x0, xlim=range(x0),
main="Pareto Distribution")
points(x0, dpareto(x0, lambda0, a0), type="l", col="red")
#-----------------------------------------------
# Calculate probabilities and quantiles for Pareto Distribution
a0 <- 2
lambda0 <- 2
prob <- ppareto(seq(a0, 8), lambda0, a0)
quan <- qpareto(prob, lambda0, a0)
print(quan)
#-----------------------------------------------
# Simulate and plot histogram with density for tapered Pareto Distribution
a0 <- 2
lambda0 <- 2
theta0 <- 3
x <- rtappareto(1000, lambda=lambda0, theta=theta0, a=a0)
x0 <- seq(a0, max(x)+0.1, length=100)
hist(x, freq=FALSE, breaks=x0, xlim=range(x0),
main="Tapered Pareto Distribution")
points(x0, dtappareto(x0, lambda0, theta0, a0), type="l", col="red")
#-----------------------------------------------
# Calculate probabilities and quantiles for tapered Pareto Distribution
a0 <- 2
lambda0 <- 2
theta0 <- 3
prob <- ptappareto(seq(a0, 8), lambda0, theta0, a0)
quan <- qtappareto(prob, lambda0, theta0, a0)
print(quan)
#-----------------------------------------------
# Calculate log-likelihood for tapered Pareto Distribution
# note the Hessian and gradient attributes
a0 <- 2
lambda0 <- 2
theta0 <- 3
x <- rtappareto(1000, lambda=lambda0, theta=theta0, a=a0)
LL <- ltappareto(x, lambda=lambda0, theta=theta0, a=a0)
print(LL)