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

Extends the class ContinuousDistribution2Dim for the bivariate normal distribution [94]  (page 84). More...

Inheritance diagram for umontreal.ssj.probdistmulti.BiNormalDist:
umontreal.ssj.probdistmulti.ContinuousDistribution2Dim umontreal.ssj.probdistmulti.ContinuousDistributionMulti umontreal.ssj.probdistmulti.BiNormalDonnellyDist umontreal.ssj.probdistmulti.BiNormalGenzDist

Public Member Functions

 BiNormalDist (double rho)
 Constructs a BiNormalDist object with default parameters \(\mu_1 = \mu_2 = 0\), \(\sigma_1 = \sigma_2 = 1\) and correlation.
 BiNormalDist (double mu1, double sigma1, double mu2, double sigma2, double rho)
 Constructs a BiNormalDist object with parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2, \(\sigma_1\) = sigma1,.
double density (double x, double y)
 Returns \(f(x, y)\), the density of \((X, Y)\) evaluated at \((x, y)\).
double cdf (double x, double y)
 Computes the distribution function \(F(x, y)\):
double barF (double x, double y)
 Computes the upper cumulative distribution function.
double[] getMean ()
 Returns the mean vector of the distribution, defined as \(\mu_i = E[X_i]\).
double[][] getCovariance ()
 Returns the variance-covariance matrix of the distribution, defined as
\(\sigma_{ij} = E[(X_i - \mu_i)(X_j - \mu_j)]\).
double[][] getCorrelation ()
 Returns the correlation matrix of the distribution, defined as.
double getMu1 ()
 Returns the parameter \(\mu_1\).
double getMu2 ()
 Returns the parameter \(\mu_2\).
double getSigma1 ()
 Returns the parameter \(\sigma_1\).
double getSigma2 ()
 Returns the parameter \(\sigma_2\).
Public Member Functions inherited from umontreal.ssj.probdistmulti.ContinuousDistribution2Dim
double density (double[] x)
 Simply calls density (x[0], x[1]).
double cdf (double a1, double a2, double b1, double b2)
 Computes the cumulative probability in the square region.
Public Member Functions inherited from umontreal.ssj.probdistmulti.ContinuousDistributionMulti
int getDimension ()
 Returns the dimension \(d\) of the distribution.

Static Public Member Functions

static double density (double x, double y, double rho)
 Computes the standard binormal density function ( f1binormal ) with \(\mu_1 = \mu_2 = 0\) and \(\sigma_1 = \sigma_2 = 1\).
static double density (double mu1, double sigma1, double x, double mu2, double sigma2, double y, double rho)
 Computes the binormal density function ( f1binormal ) with parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2, \(\sigma_1\) = sigma1, \(\sigma_2\) = sigma2 and.
static double cdf (double x, double y, double rho)
 Computes the standard binormal distribution ( cdf2binormal ) using the fast Drezner-Wesolowsky method described in.
static double cdf (double mu1, double sigma1, double x, double mu2, double sigma2, double y, double rho)
 Computes the binormal distribution function ( cdf1binormal ) with parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2, \(\sigma_1\) = sigma1, \(\sigma_2\) = sigma2 and.
static double barF (double x, double y, double rho)
 Computes the standard upper binormal distribution with \(\mu_1 = \mu_2 = 0\) and \(\sigma_1 = \sigma_2 = 1\).
static double barF (double mu1, double sigma1, double x, double mu2, double sigma2, double y, double rho)
 Computes the upper binormal distribution function ( cdf3binormal ) with parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2, \(\sigma_1\) = sigma1, \(\sigma_2\) = sigma2 and.
static double[] getMean (double mu1, double sigma1, double mu2, double sigma2, double rho)
 Return the mean vector \(E[X] = (\mu_1, \mu_2)\) of the binormal distribution.
static double[][] getCovariance (double mu1, double sigma1, double mu2, double sigma2, double rho)
 Return the covariance matrix of the binormal distribution.
static double[][] getCorrelation (double mu1, double sigma1, double mu2, double sigma2, double rho)
 Return the correlation matrix of the binormal distribution.

Protected Member Functions

void setParams (double mu1, double sigma1, double mu2, double sigma2, double rho)
 Sets the parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2,.

Additional Inherited Members

Public Attributes inherited from umontreal.ssj.probdistmulti.ContinuousDistribution2Dim
int decPrec = 15
 Defines the target number of decimals of accuracy when approximating a distribution function, but there is no guarantee that this target is always attained.

Detailed Description

Extends the class ContinuousDistribution2Dim for the bivariate normal distribution [94]  (page 84).

It has means \(E[X] =\mu_1\), \(E[Y] =\mu_2\), and variances var \([X] = \sigma_1^2\), var \([Y] = \sigma_2^2\) such that \(\sigma_1 > 0\) and \(\sigma_2 > 0\). The correlation between \(X\) and \(Y\) is \(\rho\). Its density function is

\[ f (x, y) = \frac{1}{2\pi\sigma_1\sigma_2\sqrt{1-\rho^2}}e^{-T} \tag{f1binormal} \]

\[ T = \frac{1}{2(1-\rho^2)}\left[\left(\frac{x-\mu_1}{\sigma_1}\right)^2 - 2\rho\left(\frac{x-\mu_1}{\sigma_1}\right) \left(\frac{y-\mu_2}{\sigma_2}\right) + \left(\frac{y-\mu_2}{\sigma_2}\right)^2\right] \]

and the corresponding distribution function is (the cdf method)

\[ \Phi(\mu_1, \sigma_1, x, \mu_2, \sigma_2, y, \rho) = \frac{1}{2\pi\sigma_1\sigma_2\sqrt{1-\rho^2}} \int_{-\infty}^x dx \int_{-\infty}^y dy  e^{-T}. \tag{cdf1binormal} \]

We also define the upper distribution function (the barF method) as

\[ \overline{\Phi}(\mu_1, \sigma_1, x, \mu_2, \sigma_2, y, \rho) = \frac{1}{2\pi\sigma_1\sigma_2\sqrt{1-\rho^2}} \int^{\infty}_x dx \int^{\infty}_y dy  e^{-T}. \tag{cdf3binormal} \]

When \(\mu_1=\mu_2=0\) and \(\sigma_1=\sigma_2=1\), we have the standard binormal distribution, with corresponding distribution function

\[ \Phi(x, y, \rho) = \frac{1}{2\pi\sqrt{1-\rho^2}} \int_{-\infty}^x dx \int_{-\infty}^y dy  e^{-S} \tag{cdf2binormal} \]

\[ S = \frac{x^2 - 2\rho x y + y^2}{2(1-\rho^2)}. \]

Definition at line 64 of file BiNormalDist.java.

Constructor & Destructor Documentation

◆ BiNormalDist() [1/2]

umontreal.ssj.probdistmulti.BiNormalDist.BiNormalDist ( double rho)

Constructs a BiNormalDist object with default parameters \(\mu_1 = \mu_2 = 0\), \(\sigma_1 = \sigma_2 = 1\) and correlation.

\(\rho= \) rho.

Definition at line 85 of file BiNormalDist.java.

◆ BiNormalDist() [2/2]

umontreal.ssj.probdistmulti.BiNormalDist.BiNormalDist ( double mu1,
double sigma1,
double mu2,
double sigma2,
double rho )

Constructs a BiNormalDist object with parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2, \(\sigma_1\) = sigma1,.

\(\sigma_2\) = sigma2 and \(\rho\) = rho.

Definition at line 95 of file BiNormalDist.java.

Member Function Documentation

◆ barF() [1/3]

double umontreal.ssj.probdistmulti.BiNormalDist.barF ( double mu1,
double sigma1,
double x,
double mu2,
double sigma2,
double y,
double rho )
static

Computes the upper binormal distribution function ( cdf3binormal ) with parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2, \(\sigma_1\) = sigma1, \(\sigma_2\) = sigma2 and.

\(\rho\) = rho. Uses the fast Drezner-Wesolowsky method described in [53] . The absolute error is expected to be smaller than \(2 \cdot10^{-7}\).

Reimplemented in umontreal.ssj.probdistmulti.BiNormalDonnellyDist, and umontreal.ssj.probdistmulti.BiNormalGenzDist.

Definition at line 313 of file BiNormalDist.java.

◆ barF() [2/3]

double umontreal.ssj.probdistmulti.BiNormalDist.barF ( double x,
double y )

Computes the upper cumulative distribution function.

\(\overline{F}(x, y)\):

\[ \overline{F}(x, y) = P[X\ge x, Y \ge y] = \int^{\infty}_x ds \int^{\infty}_y dt  f(s, t). \]

Parameters
xvalue \(x\) at which the upper distribution is evaluated
yvalue \(y\) at which the upper distribution is evaluated
Returns
upper distribution function evaluated at \((x, y)\)

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistribution2Dim.

Reimplemented in umontreal.ssj.probdistmulti.BiNormalDonnellyDist, and umontreal.ssj.probdistmulti.BiNormalGenzDist.

Definition at line 299 of file BiNormalDist.java.

◆ barF() [3/3]

double umontreal.ssj.probdistmulti.BiNormalDist.barF ( double x,
double y,
double rho )
static

Computes the standard upper binormal distribution with \(\mu_1 = \mu_2 = 0\) and \(\sigma_1 = \sigma_2 = 1\).

Uses the fast Drezner-Wesolowsky method described in [53] . The absolute error is expected to be smaller than \(2 \cdot10^{-7}\).

Reimplemented in umontreal.ssj.probdistmulti.BiNormalDonnellyDist, and umontreal.ssj.probdistmulti.BiNormalGenzDist.

Definition at line 295 of file BiNormalDist.java.

◆ cdf() [1/3]

double umontreal.ssj.probdistmulti.BiNormalDist.cdf ( double mu1,
double sigma1,
double x,
double mu2,
double sigma2,
double y,
double rho )
static

Computes the binormal distribution function ( cdf1binormal ) with parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2, \(\sigma_1\) = sigma1, \(\sigma_2\) = sigma2 and.

\(\rho\) = rho. Uses the fast Drezner-Wesolowsky method described in [53] . The absolute error is expected to be smaller than \(2 \cdot10^{-7}\).

Reimplemented in umontreal.ssj.probdistmulti.BiNormalDonnellyDist, and umontreal.ssj.probdistmulti.BiNormalGenzDist.

Definition at line 279 of file BiNormalDist.java.

◆ cdf() [2/3]

double umontreal.ssj.probdistmulti.BiNormalDist.cdf ( double x,
double y )

Computes the distribution function \(F(x, y)\):

\[ F(x, y) = P[X\le x, Y \le y] = \int_{-\infty}^x ds \int_{-\infty}^y dt  f(s, t). \]

Parameters
xvalue \(x\) at which the distribution function is evaluated
yvalue \(y\) at which the distribution function is evaluated
Returns
distribution function evaluated at \((x, y)\)

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistribution2Dim.

Reimplemented in umontreal.ssj.probdistmulti.BiNormalDonnellyDist, and umontreal.ssj.probdistmulti.BiNormalGenzDist.

Definition at line 265 of file BiNormalDist.java.

◆ cdf() [3/3]

double umontreal.ssj.probdistmulti.BiNormalDist.cdf ( double x,
double y,
double rho )
static

Computes the standard binormal distribution ( cdf2binormal ) using the fast Drezner-Wesolowsky method described in.

[53] . The absolute error is expected to be smaller than \(2 \cdot10^{-7}\).

Reimplemented in umontreal.ssj.probdistmulti.BiNormalDonnellyDist, and umontreal.ssj.probdistmulti.BiNormalGenzDist.

Definition at line 198 of file BiNormalDist.java.

◆ density() [1/3]

double umontreal.ssj.probdistmulti.BiNormalDist.density ( double mu1,
double sigma1,
double x,
double mu2,
double sigma2,
double y,
double rho )
static

Computes the binormal density function ( f1binormal ) with parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2, \(\sigma_1\) = sigma1, \(\sigma_2\) = sigma2 and.

\(\rho\) = rho.

Definition at line 125 of file BiNormalDist.java.

◆ density() [2/3]

double umontreal.ssj.probdistmulti.BiNormalDist.density ( double x,
double y )

Returns \(f(x, y)\), the density of \((X, Y)\) evaluated at \((x, y)\).

Parameters
xvalue \(x\) at which the density is evaluated
yvalue \(y\) at which the density is evaluated
Returns
density function evaluated at \((x, y)\)

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistribution2Dim.

Definition at line 99 of file BiNormalDist.java.

◆ density() [3/3]

double umontreal.ssj.probdistmulti.BiNormalDist.density ( double x,
double y,
double rho )
static

Computes the standard binormal density function ( f1binormal ) with \(\mu_1 = \mu_2 = 0\) and \(\sigma_1 = \sigma_2 = 1\).

Definition at line 113 of file BiNormalDist.java.

◆ getCorrelation() [1/2]

double[][] umontreal.ssj.probdistmulti.BiNormalDist.getCorrelation ( )

Returns the correlation matrix of the distribution, defined as.

\(\rho_{ij} = \sigma_{ij}/\sqrt{\sigma_{ii}\sigma_{jj}}\).

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistributionMulti.

Definition at line 372 of file BiNormalDist.java.

◆ getCorrelation() [2/2]

double[][] umontreal.ssj.probdistmulti.BiNormalDist.getCorrelation ( double mu1,
double sigma1,
double mu2,
double sigma2,
double rho )
static

Return the correlation matrix of the binormal distribution.

Definition at line 379 of file BiNormalDist.java.

◆ getCovariance() [1/2]

double[][] umontreal.ssj.probdistmulti.BiNormalDist.getCovariance ( )

Returns the variance-covariance matrix of the distribution, defined as
\(\sigma_{ij} = E[(X_i - \mu_i)(X_j - \mu_j)]\).

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistributionMulti.

Definition at line 347 of file BiNormalDist.java.

◆ getCovariance() [2/2]

double[][] umontreal.ssj.probdistmulti.BiNormalDist.getCovariance ( double mu1,
double sigma1,
double mu2,
double sigma2,
double rho )
static

Return the covariance matrix of the binormal distribution.

Definition at line 354 of file BiNormalDist.java.

◆ getMean() [1/2]

double[] umontreal.ssj.probdistmulti.BiNormalDist.getMean ( )

Returns the mean vector of the distribution, defined as \(\mu_i = E[X_i]\).

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistributionMulti.

Definition at line 323 of file BiNormalDist.java.

◆ getMean() [2/2]

double[] umontreal.ssj.probdistmulti.BiNormalDist.getMean ( double mu1,
double sigma1,
double mu2,
double sigma2,
double rho )
static

Return the mean vector \(E[X] = (\mu_1, \mu_2)\) of the binormal distribution.

Definition at line 331 of file BiNormalDist.java.

◆ getMu1()

double umontreal.ssj.probdistmulti.BiNormalDist.getMu1 ( )

Returns the parameter \(\mu_1\).

Definition at line 400 of file BiNormalDist.java.

◆ getMu2()

double umontreal.ssj.probdistmulti.BiNormalDist.getMu2 ( )

Returns the parameter \(\mu_2\).

Definition at line 407 of file BiNormalDist.java.

◆ getSigma1()

double umontreal.ssj.probdistmulti.BiNormalDist.getSigma1 ( )

Returns the parameter \(\sigma_1\).

Definition at line 414 of file BiNormalDist.java.

◆ getSigma2()

double umontreal.ssj.probdistmulti.BiNormalDist.getSigma2 ( )

Returns the parameter \(\sigma_2\).

Definition at line 421 of file BiNormalDist.java.

◆ setParams()

void umontreal.ssj.probdistmulti.BiNormalDist.setParams ( double mu1,
double sigma1,
double mu2,
double sigma2,
double rho )
protected

Sets the parameters \(\mu_1\) = mu1, \(\mu_2\) = mu2,.

\(\sigma_1\) = sigma1, \(\sigma_2\) = sigma2 and \(\rho\) = rho of this object.

Definition at line 431 of file BiNormalDist.java.


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