public class BivariateGaussianDistributionUtils extends Object
Constructor and Description |
---|
BivariateGaussianDistributionUtils() |
Modifier and Type | Method and Description |
---|---|
static double[] |
fromUnitCovarianceEllipse(double semiMajorAxisLength,
double semiMinorAxisLength,
double orientation)
Given the parameters defining the unit covariance ellipse for a Bivariate Gaussian
distribution centered about the origin, this method returns sigmaX = Sqrt[Var(X)], sigmaY =
Sqrt[Var(Y)], and correlation = Cov(X,Y) / (sigmaX sigmaY) for this probability distribution.
|
static void |
main(String[] args) |
static double[] |
toUnitCovarianceEllipse(double sigmaX,
double sigmaY,
double correlation)
Returns the parameters defining the unit covariance ellipse for a Bivariate Gaussian
distribution centered about the origin with given sigmaX, sigmaY, and correlation.
|
public static double[] toUnitCovarianceEllipse(double sigmaX, double sigmaY, double correlation)
Note: correlation must be <= 1 and >= -1.
Ref: Data Analysis for Scientists and Engineers, Stuart Meyer, 1975, p.288-290.
sigmaX
- X standard deviation = Sqrt[Var(X)]sigmaY
- Y standard deviation = Sqrt[Var(Y)]correlation
- correlation coefficient = Cov(X,Y) / (sigmaX sigmaY)IllegalArgumentException
- if correlation is outside valid domain.public static double[] fromUnitCovarianceEllipse(double semiMajorAxisLength, double semiMinorAxisLength, double orientation)
Note: Calculation is based on COV = Q' R Q where Q is rotation matrix {cos,sin;-sin, cos} for given orientation and R is diagonal matrix {semiMaj, 0; 0, semiMin} for axis lengths. With COV computed, we get sigmaX = Sqrt[COV(0,0)], sigmaY = Sqrt[COV(1,1)], and finally correlation = COV(0,1)/(sigmaX * sigmaY).
semiMajorAxisLength
- length of semi-major axis of 1-sigma covariance ellipsesemiMinorAxisLength
- length of semi-minor axis of 1-sigma covariance ellipseorientation
- orientation of covariance ellipse (azimuth of semi-major axis)public static void main(String[] args)
Copyright © 2016 Metron, Inc.. All rights reserved.