SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.probdist.InverseGammaDist Class Reference

Extends the class ContinuousDistribution for the inverse gamma distribution with shape parameter \(\alpha> 0\) and scale parameter. More...

Inheritance diagram for umontreal.ssj.probdist.InverseGammaDist:
umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution

Public Member Functions

 InverseGammaDist (double alpha, double beta)
 Constructs an InverseGammaDist object with parameters.
double density (double x)
 Returns \(f(x)\), the density evaluated at \(x\).
double cdf (double x)
 Returns the distribution function \(F(x)\).
double barF (double x)
 Returns the complementary distribution function.
double inverseF (double u)
 Returns the inverse distribution function \(x = F^{-1}(u)\).
double getMean ()
 Returns the mean.
double getVariance ()
 Returns the variance.
double getStandardDeviation ()
 Returns the standard deviation.
double getAlpha ()
 Returns the \(\alpha\) parameter of this object.
double getBeta ()
 Returns the \(\beta\) parameter of this object.
void setParam (double alpha, double beta)
 Sets the parameters \(\alpha\) and \(\beta\) of this object.
double[] getParams ()
 Returns a table containing the parameters of the current distribution.
String toString ()
 Returns a String containing information about the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.ContinuousDistribution
double inverseBrent (double a, double b, double u, double tol)
 Computes the inverse distribution function \(x = F^{-1}(u)\), using the Brent-Dekker method.
double inverseBisection (double u)
 Computes and returns the inverse distribution function \(x = F^{-1}(u)\), using bisection.
double getXinf ()
 Returns \(x_a\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
double getXsup ()
 Returns \(x_b\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
void setXinf (double xa)
 Sets the value \(x_a=\) xa, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
void setXsup (double xb)
 Sets the value \(x_b=\) xb, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).

Static Public Member Functions

static double density (double alpha, double beta, double x)
 Computes the density function of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).
static double cdf (double alpha, double beta, double x)
 Computes the cumulative probability function of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).
static double barF (double alpha, double beta, double x)
 Computes the complementary distribution function of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).
static double inverseF (double alpha, double beta, double u)
 Computes the inverse distribution function of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).
static double[] getMLE (double[] x, int n)
 Estimates the parameters \((\alpha,\beta)\) of the inverse gamma distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1,…, n-1\).
static InverseGammaDist getInstanceFromMLE (double[] x, int n)
 Creates a new instance of the inverse gamma distribution with parameters \(\alpha\) and \(\beta\) estimated using the maximum likelihood method based on the \(n\) observations.
static double getMean (double alpha, double beta)
 Returns the mean \(E[X] = \beta/ (\alpha- 1)\) of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).
static double getVariance (double alpha, double beta)
 Returns the variance \(\mbox{Var}[X] = \beta^2 / ((\alpha- 1)^2(\alpha- 2))\) of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).
static double getStandardDeviation (double alpha, double beta)
 Returns the standard deviation of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).

Detailed Description

Extends the class ContinuousDistribution for the inverse gamma distribution with shape parameter \(\alpha> 0\) and scale parameter.

\(\beta> 0\), also known as the Pearson type V distribution. The density function is given by

\[ f(x) = \left\{\begin{array}{ll} \displaystyle\frac{\beta^{\alpha}e^{-\beta/ x}}{x^{\alpha+ 1} \Gamma(\alpha)} & \quad\mbox{for } x > 0 \\ 0 & \quad\mbox{otherwise,} \end{array} \right. \tag{dinvgam} \]

where \(\Gamma\) is the gamma function. The distribution function is given by

\[ F(x) = 1 - F_G\left(\frac{1}{x}\right) \qquad\mbox{for } x > 0, \tag{Finvgam} \]

and \(F(x) = 0\) otherwise, where \(F_G(x)\) is the distribution function of a gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).

Definition at line 51 of file InverseGammaDist.java.

Constructor & Destructor Documentation

◆ InverseGammaDist()

umontreal.ssj.probdist.InverseGammaDist.InverseGammaDist ( double alpha,
double beta )

Constructs an InverseGammaDist object with parameters.

\(\alpha\) = alpha and \(\beta\) = beta.

Definition at line 61 of file InverseGammaDist.java.

Member Function Documentation

◆ barF() [1/2]

double umontreal.ssj.probdist.InverseGammaDist.barF ( double alpha,
double beta,
double x )
static

Computes the complementary distribution function of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).

Definition at line 131 of file InverseGammaDist.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.InverseGammaDist.barF ( double x)

Returns the complementary distribution function.

The default implementation computes \(\bar{F}(x) = 1 - F(x)\).

Parameters
xvalue at which the complementary distribution function is evaluated
Returns
complementary distribution function evaluated at x

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 75 of file InverseGammaDist.java.

◆ cdf() [1/2]

double umontreal.ssj.probdist.InverseGammaDist.cdf ( double alpha,
double beta,
double x )
static

Computes the cumulative probability function of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).

Definition at line 115 of file InverseGammaDist.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.InverseGammaDist.cdf ( double x)

Returns the distribution function \(F(x)\).

Parameters
xvalue at which the distribution function is evaluated
Returns
distribution function evaluated at x

Implements umontreal.ssj.probdist.Distribution.

Definition at line 71 of file InverseGammaDist.java.

◆ density() [1/2]

double umontreal.ssj.probdist.InverseGammaDist.density ( double alpha,
double beta,
double x )
static

Computes the density function of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).

Definition at line 99 of file InverseGammaDist.java.

◆ density() [2/2]

double umontreal.ssj.probdist.InverseGammaDist.density ( double x)

Returns \(f(x)\), the density evaluated at \(x\).

Parameters
xvalue at which the density is evaluated
Returns
density function evaluated at x

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 65 of file InverseGammaDist.java.

◆ getAlpha()

double umontreal.ssj.probdist.InverseGammaDist.getAlpha ( )

Returns the \(\alpha\) parameter of this object.

Definition at line 233 of file InverseGammaDist.java.

◆ getBeta()

double umontreal.ssj.probdist.InverseGammaDist.getBeta ( )

Returns the \(\beta\) parameter of this object.

Definition at line 240 of file InverseGammaDist.java.

◆ getInstanceFromMLE()

InverseGammaDist umontreal.ssj.probdist.InverseGammaDist.getInstanceFromMLE ( double[] x,
int n )
static

Creates a new instance of the inverse gamma distribution with parameters \(\alpha\) and \(\beta\) estimated using the maximum likelihood method based on the \(n\) observations.

\(x[i]\), \(i = 0, 1, …, n-1\).

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters

Definition at line 189 of file InverseGammaDist.java.

◆ getMean() [1/2]

double umontreal.ssj.probdist.InverseGammaDist.getMean ( )

Returns the mean.

Returns
the mean

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 83 of file InverseGammaDist.java.

◆ getMean() [2/2]

double umontreal.ssj.probdist.InverseGammaDist.getMean ( double alpha,
double beta )
static

Returns the mean \(E[X] = \beta/ (\alpha- 1)\) of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).

Definition at line 199 of file InverseGammaDist.java.

◆ getMLE()

double[] umontreal.ssj.probdist.InverseGammaDist.getMLE ( double[] x,
int n )
static

Estimates the parameters \((\alpha,\beta)\) of the inverse gamma distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1,…, n-1\).

The estimates are returned in a two-element array, in regular order: [ \(\alpha\), \(\beta\)]. The equations of the maximum likelihood are the same as the equations of the gamma distribution, with the sample \(y_i = 1/x_i\).

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters
Returns
returns the parameters [ \(\hat{\alpha}, \hat{\beta}\)]

Definition at line 167 of file InverseGammaDist.java.

◆ getParams()

double[] umontreal.ssj.probdist.InverseGammaDist.getParams ( )

Returns a table containing the parameters of the current distribution.

This table is put in regular order: [ \(\alpha\), \(\beta\)].

Implements umontreal.ssj.probdist.Distribution.

Definition at line 262 of file InverseGammaDist.java.

◆ getStandardDeviation() [1/2]

double umontreal.ssj.probdist.InverseGammaDist.getStandardDeviation ( )

Returns the standard deviation.

Returns
the standard deviation

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 91 of file InverseGammaDist.java.

◆ getStandardDeviation() [2/2]

double umontreal.ssj.probdist.InverseGammaDist.getStandardDeviation ( double alpha,
double beta )
static

Returns the standard deviation of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).

Definition at line 226 of file InverseGammaDist.java.

◆ getVariance() [1/2]

double umontreal.ssj.probdist.InverseGammaDist.getVariance ( )

Returns the variance.

Returns
the variance

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 87 of file InverseGammaDist.java.

◆ getVariance() [2/2]

double umontreal.ssj.probdist.InverseGammaDist.getVariance ( double alpha,
double beta )
static

Returns the variance \(\mbox{Var}[X] = \beta^2 / ((\alpha- 1)^2(\alpha- 2))\) of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).

Definition at line 213 of file InverseGammaDist.java.

◆ inverseF() [1/2]

double umontreal.ssj.probdist.InverseGammaDist.inverseF ( double alpha,
double beta,
double u )
static

Computes the inverse distribution function of the inverse gamma distribution with shape parameter \(\alpha\) and scale parameter \(\beta\).

Definition at line 146 of file InverseGammaDist.java.

◆ inverseF() [2/2]

double umontreal.ssj.probdist.InverseGammaDist.inverseF ( double u)

Returns the inverse distribution function \(x = F^{-1}(u)\).

Restrictions: \(u \in[0,1]\).

Parameters
uvalue at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
IllegalArgumentExceptionif \(u\) is not in the interval \([0,1]\)

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 79 of file InverseGammaDist.java.

◆ setParam()

void umontreal.ssj.probdist.InverseGammaDist.setParam ( double alpha,
double beta )

Sets the parameters \(\alpha\) and \(\beta\) of this object.

Definition at line 247 of file InverseGammaDist.java.

◆ toString()

String umontreal.ssj.probdist.InverseGammaDist.toString ( )

Returns a String containing information about the current distribution.

Definition at line 270 of file InverseGammaDist.java.


The documentation for this class was generated from the following file: