public class BivariateDistribution extends Object
The evaluation of the probability integrals is described in:
Alan Genz, "Numerical Computation of Rectangular Bivariate and Trivariate Normal and t Probabilities" in Statistics and Computing 14, 151 (2004).
The integration code is adapted from the FORTRAN source at:
http://www.math.wsu.edu/faculty/genz/homepage
Modifier and Type | Field and Description |
---|---|
private double |
_dx |
private double |
_dy |
private double[] |
_h |
private double[] |
_k |
private int |
_nx |
private int |
_ny |
private double[] |
_w12 |
private double[] |
_w20 |
private double[] |
_w6 |
private double[] |
_x12 |
private double[] |
_x20 |
private double[] |
_x6 |
private double |
_xmin |
private double |
_ymin |
Constructor and Description |
---|
BivariateDistribution() |
Modifier and Type | Method and Description |
---|---|
double[][] |
Calculate(double x0,
double y0,
double sigx,
double sigy,
double rho)
Integrate the Gaussian probability distribution over each x-y bins,
which must be defined before calling this method.
|
private double |
GenzCalc(double dh,
double dk,
double rho) |
void |
xBins(int nx,
double xmin,
double dx)
Set the locations of the x-coordinate bins
|
void |
yBins(int ny,
double ymin,
double dy)
Set the locations of the y-coordinate bins
|
private int _nx
private int _ny
private double _xmin
private double _ymin
private double _dx
private double _dy
private double[] _h
private double[] _k
private double[] _w6
private double[] _x6
private double[] _w12
private double[] _x12
private double[] _w20
private double[] _x20
public void xBins(int nx, double xmin, double dx)
nx
- number of x coordinate binsxmin
- minimum x coordinatedx
- width of x coordinate binspublic void yBins(int ny, double ymin, double dy)
ny
- number of y coordinate binsymin
- minimum y coordinatedy
- width of y coordinate binspublic double[][] Calculate(double x0, double y0, double sigx, double sigy, double rho)
The output is a double array that gives the binned probability distribution. The first array index is used to indicate the bin in x and the second array index is used to indicate the bin in y.
x0
- mean x coordinate of Gaussian distributiony0
- mean y coordinate of Gaussian distributionsigx
- x coordinate standard deviationsigy
- y coordinate standard deviationrho
- x-y correlation coefficientprivate double GenzCalc(double dh, double dk, double rho)
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.