1
// ParetoDistribution.java
3
// (c) 1999-2001 PAL Development Core Team
5
// This package may be distributed under the
6
// terms of the Lesser GNU General Public License (LGPL)
9
package pal.statistics;
16
* (scale-free distribution without characteristic length scale).
18
* Parameters: shape parameter k>0, scale parameter m>0 ("minimum income")
20
* @version $Id: ParetoDistribution.java,v 1.2 2001/07/13 14:39:13 korbinian Exp $
22
* @author Korbinian Strimmer
24
public class ParetoDistribution
31
* probability density function of the Pareto distribution
33
* @param x argument (>=m)
34
* @param k shape parameter (>0)
35
* @param m scale parameter (>0, "minimum income")
39
public static double pdf(double x, double k, double m)
41
return k*Math.pow(m,k)*Math.pow(x,-(k+1));
45
* cumulative density function of the Pareto distribution
47
* @param x argument (>=m)
48
* @param k shape parameter (>0)
49
* @param m scale parameter (>0, "minimum income")
53
public static double cdf(double x, double k, double m)
55
return 1.0-Math.pow(m/x, k);
60
* quantile (inverse cumulative density function) of the Pareto distribution
62
* @param p argument (0 < p < 1)
63
* @param k shape parameter (>0)
64
* @param m scale parameter (>0, "minimum income")
68
public static double quantile(double p, double k, double m)
70
return m/Math.pow(1.0-p,1.0/k);
74
* mean of the Pareto distribution
76
* @param k shape parameter (>0)
77
* @param m scale parameter (>0, "minimum income")
81
public static double mean(double k, double m)
86
return Double.POSITIVE_INFINITY;
90
* variance of the Pareto distribution
92
* @param k shape parameter (>0)
93
* @param m scale parameter (>0, "minimum income")
97
public static double variance(double k, double m)
100
return m*m*k/((k-1.0)*(k-1.0)*(k-2.0));
102
return Double.POSITIVE_INFINITY;
106
* moments E(X^n) of the Pareto distribution
109
* @param k shape parameter (>0)
110
* @param m scale parameter (>0, "minimum income")
114
public static double moment(int n, double k, double m)
117
return Math.pow(m,n)*k/(k-n);
119
return Double.POSITIVE_INFINITY;