paretoPdf¶
Evaluates the Pareto probability density function.
Synopsis¶
paretoPdf (x, xm, k)
Required Arguments¶
- float
x
(Input) - Argument for which the function is to be evaluated.
- float
xm
(Input) - The scale parameter.
- float
k
(Input) - The shape parameter.
Return Value¶
The probability density at x
. NaN is returned on error.
Description¶
The probability density function of the Pareto distribution is:
\[f(x|x_m,k) = k \frac{x_m^k}{x^{k+1}}\]
where the scale parameter \(x_m>0\) and the shape parameter \(k>0\). The function is only defined for \(x\geq x_m\).
Example¶
In this example, we evaluate the Pareto PDF at \(x=0.5\), \(x_m=0.4\) and \(k=0.7\).
from __future__ import print_function
from numpy import *
from pyimsl.stat.paretoPdf import paretoPdf
x = 0.5
xm = 0.4
k = 0.7
pr = paretoPdf(x, xm, k)
print("The probability density of a Pareto random variable X with")
print("a scale parameter xm = %3.1f and a shape parameter k = %3.1f" % (xm, k))
print("and value x = %3.1f is %6.4f." % (x, pr))
Output¶
The probability density of a Pareto random variable X with
a scale parameter xm = 0.4 and a shape parameter k = 0.7
and value x = 0.5 is 1.1975.