umontreal.iro.lecuyer.probdistmulti
Class BiNormalDist
- java.lang.Object
-
- umontreal.iro.lecuyer.probdistmulti.ContinuousDistributionMulti
-
- umontreal.iro.lecuyer.probdistmulti.ContinuousDistribution2Dim
-
- umontreal.iro.lecuyer.probdistmulti.BiNormalDist
-
- Direct Known Subclasses:
- BiNormalDonnellyDist, BiNormalGenzDist
public class BiNormalDist extends ContinuousDistribution2Dim
Extends the classContinuousDistribution2Dimfor the bivariate normal distribution. It has means E[X] = μ1, E[Y] = μ2, and variances var [X] = σ12, var [Y] = σ22 such that σ1 > 0 and σ2 > 0. The correlation between X and Y is r. Its density function isf (x, y) = e-T/(2πσ1σ2(1-r^2)1/2)T = [((x - μ1)/σ1)2 -2r((x - μ1)/σ1)((y - μ2)/σ2) + ((y - μ2)/σ2)2]/(2(1 - r2))and the corresponding distribution function is (the cdf method)Φ(μ1, σ1, x, μ2, σ2, y, r) = ∫-∞xdx∫-∞ydy e-T/(2πσ1σ2(1 - r^2)1/2).We also define the upper distribution function (the barF method) asbar(Φ)(μ1, σ1, x, μ2, σ2, y, r) = ∫∞xdx∫∞ydy e-T/(2πσ1σ2(1 - r^2)1/2).When μ1 = μ2 = 0 and σ1 = σ2 = 1, we have the standard binormal distribution, with corresponding distribution functionΦ(x, y, r) = ∫∞xdx∫∞ydy e-S/(2π(1 - r^2)1/2)S = (x2 -2rxy + y2)/(2(1 - r2)).
-
-
Field Summary
-
Fields inherited from class umontreal.iro.lecuyer.probdistmulti.ContinuousDistribution2Dim
decPrec
-
-
Constructor Summary
Constructors Constructor and Description BiNormalDist(double rho)Constructs a BiNormalDist object with default parameters μ1 = μ2 = 0, σ1 = σ2 = 1 and correlation ρ = rho.BiNormalDist(double mu1, double sigma1, double mu2, double sigma2, double rho)Constructs a BiNormalDist object with parameters μ1 = mu1, μ2 = mu2, σ1 = sigma1, σ2 = sigma2 and ρ = rho.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublebarF(double x, double y).static doublebarF(double x, double y, double rho)Computes the standard upper binormal distribution with μ1 = μ2 = 0 and σ1 = σ2 = 1.static doublebarF(double mu1, double sigma1, double x, double mu2, double sigma2, double y, double rho)Computes the upper binormal distribution function with parameters μ1 = mu1, μ2 = mu2, σ1 = sigma1, σ2 = sigma2 and ρ = rho.doublecdf(double x, double y).static doublecdf(double x, double y, double rho)Computes the standard binormal distribution using the fast Drezner-Wesolowsky method described in.static doublecdf(double mu1, double sigma1, double x, double mu2, double sigma2, double y, double rho)Computes the binormal distribution function with parameters μ1 = mu1, μ2 = mu2, σ1 = sigma1, σ2 = sigma2 and ρ = rho.doubledensity(double x, double y)Returns f (x, y), the density of (X, Y) evaluated at (x, y).static doubledensity(double x, double y, double rho)Computes the standard binormal density function with μ1 = μ2 = 0 and σ1 = σ2 = 1.static doubledensity(double mu1, double sigma1, double x, double mu2, double sigma2, double y, double rho)Computes the binormal density function with parameters μ1 = mu1, μ2 = mu2, σ1 = sigma1, σ2 = sigma2 and ρ = rho.double[][]getCorrelation()Returns the correlation matrix of the distribution, defined as ρij = σij/(σ_iiσ_jj)1/2.static double[][]getCorrelation(double mu1, double sigma1, double mu2, double sigma2, double rho)Return the correlation matrix of the binormal distribution.double[][]getCovariance()Returns the variance-covariance matrix of the distribution, defined as
σij = E[(Xi - μi)(Xj - μj)].static double[][]getCovariance(double mu1, double sigma1, double mu2, double sigma2, double rho)Return the covariance matrix of the binormal distribution.double[]getMean()Returns the mean vector of the distribution, defined as μi = E[Xi].static double[]getMean(double mu1, double sigma1, double mu2, double sigma2, double rho)Return the mean vector E[X] = (μ1, μ2) of the binormal distribution.doublegetMu1()Returns the parameter μ1.doublegetMu2()Returns the parameter μ2.doublegetSigma1()Returns the parameter σ1.doublegetSigma2()Returns the parameter σ2.-
Methods inherited from class umontreal.iro.lecuyer.probdistmulti.ContinuousDistribution2Dim
cdf, density
-
Methods inherited from class umontreal.iro.lecuyer.probdistmulti.ContinuousDistributionMulti
getDimension
-
-
-
-
Constructor Detail
-
BiNormalDist
public BiNormalDist(double rho)
Constructs a BiNormalDist object with default parameters μ1 = μ2 = 0, σ1 = σ2 = 1 and correlation ρ = rho.
-
BiNormalDist
public BiNormalDist(double mu1, double sigma1, double mu2, double sigma2, double rho)Constructs a BiNormalDist object with parameters μ1 = mu1, μ2 = mu2, σ1 = sigma1, σ2 = sigma2 and ρ = rho.
-
-
Method Detail
-
density
public double density(double x, double y)Description copied from class:ContinuousDistribution2DimReturns f (x, y), the density of (X, Y) evaluated at (x, y).- Specified by:
densityin classContinuousDistribution2Dim- Parameters:
x- value x at which the density is evaluatedy- value y at which the density is evaluated- Returns:
- density function evaluated at (x, y)
-
density
public static double density(double x, double y, double rho)Computes the standard binormal density function with μ1 = μ2 = 0 and σ1 = σ2 = 1.
-
density
public static double density(double mu1, double sigma1, double x, double mu2, double sigma2, double y, double rho)Computes the binormal density function with parameters μ1 = mu1, μ2 = mu2, σ1 = sigma1, σ2 = sigma2 and ρ = rho.
-
cdf
public static double cdf(double x, double y, double rho)Computes the standard binormal distribution using the fast Drezner-Wesolowsky method described in. The absolute error is expected to be smaller than 2⋅10-7.
-
cdf
public double cdf(double x, double y)Description copied from class:ContinuousDistribution2Dim. Computes the distribution function F(x, y):F(x, y) = P[X <= x, Y <= y] = ∫-∞xds∫-∞ydt f (s, t).- Specified by:
cdfin classContinuousDistribution2Dim- Parameters:
x- value x at which the distribution function is evaluatedy- value y at which the distribution function is evaluated- Returns:
- distribution function evaluated at (x, y)
-
cdf
public static double cdf(double mu1, double sigma1, double x, double mu2, double sigma2, double y, double rho)Computes the binormal distribution function with parameters μ1 = mu1, μ2 = mu2, σ1 = sigma1, σ2 = sigma2 and ρ = rho. Uses the fast Drezner-Wesolowsky method described in. The absolute error is expected to be smaller than 2⋅10-7.
-
barF
public static double barF(double x, double y, double rho)Computes the standard upper binormal distribution with μ1 = μ2 = 0 and σ1 = σ2 = 1. Uses the fast Drezner-Wesolowsky method described in. The absolute error is expected to be smaller than 2⋅10-7.
-
barF
public double barF(double x, double y)Description copied from class:ContinuousDistribution2Dim. Computes the upper cumulative distribution function bar(F)(x, y):bar(F)(x, y) = P[X >= x, Y >= y] = ∫∞xds∫∞ydt f (s, t).- Overrides:
barFin classContinuousDistribution2Dim- Parameters:
x- value x at which the upper distribution is evaluatedy- value y at which the upper distribution is evaluated- Returns:
- upper distribution function evaluated at (x, y)
-
barF
public static double barF(double mu1, double sigma1, double x, double mu2, double sigma2, double y, double rho)Computes the upper binormal distribution function with parameters μ1 = mu1, μ2 = mu2, σ1 = sigma1, σ2 = sigma2 and ρ = rho. Uses the fast Drezner-Wesolowsky method described in. The absolute error is expected to be smaller than 2⋅10-7.
-
getMean
public double[] getMean()
Description copied from class:ContinuousDistributionMultiReturns the mean vector of the distribution, defined as μi = E[Xi].- Specified by:
getMeanin classContinuousDistributionMulti
-
getMean
public static double[] getMean(double mu1, double sigma1, double mu2, double sigma2, double rho)Return the mean vector E[X] = (μ1, μ2) of the binormal distribution.
-
getCovariance
public double[][] getCovariance()
Description copied from class:ContinuousDistributionMultiReturns the variance-covariance matrix of the distribution, defined as
σij = E[(Xi - μi)(Xj - μj)].- Specified by:
getCovariancein classContinuousDistributionMulti
-
getCovariance
public static double[][] getCovariance(double mu1, double sigma1, double mu2, double sigma2, double rho)Return the covariance matrix of the binormal distribution.
-
getCorrelation
public double[][] getCorrelation()
Description copied from class:ContinuousDistributionMultiReturns the correlation matrix of the distribution, defined as ρij = σij/(σ_iiσ_jj)1/2.- Specified by:
getCorrelationin classContinuousDistributionMulti
-
getCorrelation
public static double[][] getCorrelation(double mu1, double sigma1, double mu2, double sigma2, double rho)Return the correlation matrix of the binormal distribution.
-
getMu1
public double getMu1()
Returns the parameter μ1.
-
getMu2
public double getMu2()
Returns the parameter μ2.
-
getSigma1
public double getSigma1()
Returns the parameter σ1.
-
getSigma2
public double getSigma2()
Returns the parameter σ2.
-
-
DMelt 3.0 © DataMelt by jWork.ORG