25package umontreal.ssj.probdistmulti.norta;
27import umontreal.ssj.probdist.*;
54 private double tolerance;
67 super(rX, dist1, dist2, tr);
68 this.tolerance = tolerance;
76 final double ITMAX = 100;
89 double ccc = rX * sd1 * sd2 + mu1 * mu2;
101 b = 2 * Math.sin(Math.PI * rX / 6);
107 for (
int i = 1; i <= ITMAX; i++) {
108 if ((((b - xh) * df - f) * ((b - xl) * df - f) > 0.0) || (Math.abs(2.0 * f) > Math.abs(dxold * df))) {
112 dx = 0.5 * (xh - xl);
124 if (Math.abs(dx) < tolerance)
136 public String toString() {
138 String desc = super.toString();
139 desc +=
"tolerance : " + tolerance +
"\n";
Classes implementing discrete distributions over the integers should inherit from this class.
NI3(double rX, DiscreteDistributionInt dist1, DiscreteDistributionInt dist2, double tr, double tolerance)
Constructor with the target rank correlation rX, the two discrete marginals dist1 and dist2,...
double computeCorr()
Computes and returns the correlation using algorithm NI3.
NortaInitDisc(double rX, DiscreteDistributionInt dist1, DiscreteDistributionInt dist2, double tr)
Constructor with the target rank correlation rX, the two discrete marginals dist1 and dist2 and the p...
double deriv(double r)
Computes the derivative of , given by.
void computeParams()
Computes the following inputs of each marginal distribution:
double integ(double r)
Computes the function.