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

Extends the class ContinuousDistribution for the Cauchy distribution [95]  (page 299) with location parameter. More...

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

Public Member Functions

 CauchyDist ()
 Constructs a CauchyDist object with parameters \(\alpha=0\) and \(\beta=1\).
 CauchyDist (double alpha, double beta)
 Constructs a CauchyDist object with parameters \(\alpha=\) alpha and \(\beta=\) beta.
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 value of \(\alpha\) for this object.
double getBeta ()
 Returns the value of \(\beta\) for this object.
void setParams (double alpha, double beta)
 Sets the value of the parameters \(\alpha\) and \(\beta\) for this object.
double[] getParams ()
 Return a table containing 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.
static double cdf (double alpha, double beta, double x)
 Computes the distribution function.
static double barF (double alpha, double beta, double x)
 Computes the complementary distribution.
static double inverseF (double alpha, double beta, double u)
 Computes the inverse of the distribution.
static double[] getMLE (double[] x, int n)
 Estimates the parameters \((\alpha,\beta)\) of the Cauchy distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1,…, n-1\).
static CauchyDist getInstanceFromMLE (double[] x, int n)
 Creates a new instance of a Cauchy distribution with parameters.
static double getMean (double alpha, double beta)
 Throws an exception since the mean does not exist.
static double getVariance (double alpha, double beta)
 Returns \(\infty\) since the variance does not exist.
static double getStandardDeviation (double alpha, double beta)
 Returns \(\infty\) since the standard deviation does not exist.

Detailed Description

Extends the class ContinuousDistribution for the Cauchy distribution [95]  (page 299) with location parameter.

\(\alpha\) and scale parameter \(\beta> 0\). The density function is given by

\[ f (x) = \frac{\beta}{\pi[(x-\alpha)^2 + \beta^2]}, \qquad\qquad\mbox{for } -\infty< x < \infty. \tag{fcuachy} \]

The distribution function is

\[ F (x) = \frac{1}{2} + \frac{\arctan((x - \alpha)/\beta)}{\pi}, \qquad\qquad\mbox{for } -\infty< x < \infty, \]

and its inverse is

\[ F^{-1} (u) = \alpha+ \beta\tan(\pi(u - 1/2)). \qquad\mbox{for } 0 < u < 1. \]

Definition at line 47 of file CauchyDist.java.

Constructor & Destructor Documentation

◆ CauchyDist() [1/2]

umontreal.ssj.probdist.CauchyDist.CauchyDist ( )

Constructs a CauchyDist object with parameters \(\alpha=0\) and \(\beta=1\).

Definition at line 84 of file CauchyDist.java.

◆ CauchyDist() [2/2]

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

Constructs a CauchyDist object with parameters \(\alpha=\) alpha and \(\beta=\) beta.

Definition at line 92 of file CauchyDist.java.

Member Function Documentation

◆ barF() [1/2]

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

Computes the complementary distribution.

Definition at line 149 of file CauchyDist.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.CauchyDist.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 104 of file CauchyDist.java.

◆ cdf() [1/2]

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

Computes the distribution function.

Definition at line 137 of file CauchyDist.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.CauchyDist.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 100 of file CauchyDist.java.

◆ density() [1/2]

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

Computes the density function.

Definition at line 127 of file CauchyDist.java.

◆ density() [2/2]

double umontreal.ssj.probdist.CauchyDist.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 96 of file CauchyDist.java.

◆ getAlpha()

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

Returns the value of \(\alpha\) for this object.

Definition at line 272 of file CauchyDist.java.

◆ getBeta()

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

Returns the value of \(\beta\) for this object.

Definition at line 279 of file CauchyDist.java.

◆ getInstanceFromMLE()

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

Creates a new instance of a Cauchy 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 230 of file CauchyDist.java.

◆ getMean() [1/2]

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

Returns the mean.

Returns
the mean

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 112 of file CauchyDist.java.

◆ getMean() [2/2]

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

Throws an exception since the mean does not exist.

Exceptions
UnsupportedOperationExceptionthe mean of the Cauchy distribution is undefined.

Definition at line 241 of file CauchyDist.java.

◆ getMLE()

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

Estimates the parameters \((\alpha,\beta)\) of the Cauchy 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 estimates of the parameters are given by maximizing numerically the log-likelihood function, using the Uncmin package [203], [224] .

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 189 of file CauchyDist.java.

◆ getParams()

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

Return a table containing parameters of the current distribution.

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

Implements umontreal.ssj.probdist.Distribution.

Definition at line 298 of file CauchyDist.java.

◆ getStandardDeviation() [1/2]

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

Returns the standard deviation.

Returns
the standard deviation

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 120 of file CauchyDist.java.

◆ getStandardDeviation() [2/2]

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

Returns \(\infty\) since the standard deviation does not exist.

Returns
\(\infty\)

Definition at line 265 of file CauchyDist.java.

◆ getVariance() [1/2]

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

Returns the variance.

Returns
the variance

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 116 of file CauchyDist.java.

◆ getVariance() [2/2]

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

Returns \(\infty\) since the variance does not exist.

Returns
\(\infty\).

Definition at line 253 of file CauchyDist.java.

◆ inverseF() [1/2]

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

Computes the inverse of the distribution.

Definition at line 161 of file CauchyDist.java.

◆ inverseF() [2/2]

double umontreal.ssj.probdist.CauchyDist.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 108 of file CauchyDist.java.

◆ setParams()

void umontreal.ssj.probdist.CauchyDist.setParams ( double alpha,
double beta )

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

Definition at line 287 of file CauchyDist.java.

◆ toString()

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

Returns a String containing information about the current distribution.

Definition at line 306 of file CauchyDist.java.


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