"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/src/gretl_normal.c" between
gretl-2020a.tar.xz and gretl-2020b.tar.xz

About: gretl (Gnu Regression, Econometrics and Time-series Library) is a cross-platform statistical package mainly for econometric analysis.

gretl_normal.c  (gretl-2020a.tar.xz):gretl_normal.c  (gretl-2020b.tar.xz)
skipping to change at line 135 skipping to change at line 135
* @limx: abscissa value, first Gaussian r.v. * @limx: abscissa value, first Gaussian r.v.
* @limy: abscissa value, second Gaussian r.v. * @limy: abscissa value, second Gaussian r.v.
* *
* Based on FORTRAN code by Alan Genz, with minor adaptations. * Based on FORTRAN code by Alan Genz, with minor adaptations.
* Original source at * Original source at
* http://www.math.wsu.edu/faculty/genz/software/fort77/tvpack.f * http://www.math.wsu.edu/faculty/genz/software/fort77/tvpack.f
* No apparent license. * No apparent license.
* *
* The algorithm is from Drezner and Wesolowsky (1989), 'On the * The algorithm is from Drezner and Wesolowsky (1989), 'On the
* Computation of the Bivariate Normal Integral', Journal of * Computation of the Bivariate Normal Integral', Journal of
* Statist. Comput. Simul. 35 pp. 101-107, with major modifications * Statistical Computation and Simulation, 35 pp. 101-107, with major
* for double precision, and for |R| close to 1. * modifications for double precision, and for |rho| close to 1.
* *
* Returns: for (x, y) a bivariate standard Normal rv with correlation * Returns: for (x, y) a bivariate standard Normal rv with correlation
* coefficient @rho, the joint probability that (x < @limx) and (y < @limy), * coefficient @rho, the joint probability that (x < @limx) and (y < @limy),
* or #NADBL on failure. * or #NADBL on failure.
*/ */
static double genz04 (double rho, double limx, double limy) static double genz04 (double rho, double limx, double limy)
{ {
double w[10], x[10]; double w[10], x[10];
double absrho = fabs(rho); double absrho = fabs(rho);
double h, k, hk, bvn, hs, asr; double h, k, hk, bvn, hs, asr;
double a, b, as, d1, bs, c, d, tmp; double a, b, as, d1, bs, c, d, tmp;
double sn, xs, rs; double sn, xs, rs;
int i, lg, j; int i, lg, j;
if (absrho < 0.3) { if (absrho < 0.3) {
w[0] = .1713244923791705; w[0] = .1713244923791705;
w[1] = .3607615730481384; w[1] = .3607615730481384;
w[2] = .4679139345726904; w[2] = .4679139345726904;
x[0] = -.9324695142031522; x[0] = -.9324695142031522;
x[1] = -.6612093864662647; x[1] = -.6612093864662647;
x[2] = -.238619186083197; x[2] = -.238619186083197;
lg = 3; lg = 3;
} else if (absrho < 0.75) { } else if (absrho < 0.75) {
w[0] = .04717533638651177; w[0] = .04717533638651177;
w[1] = .1069393259953183; w[1] = .1069393259953183;
w[2] = .1600783285433464; w[2] = .1600783285433464;
w[3] = .2031674267230659; w[3] = .2031674267230659;
w[4] = .2334925365383547; w[4] = .2334925365383547;
w[5] = .2491470458134029; w[5] = .2491470458134029;
x[0] = -.9815606342467191; x[0] = -.9815606342467191;
x[1] = -.904117256370475; x[1] = -.904117256370475;
x[2] = -.769902674194305; x[2] = -.769902674194305;
x[3] = -.5873179542866171; x[3] = -.5873179542866171;
x[4] = -.3678314989981802; x[4] = -.3678314989981802;
x[5] = -.1252334085114692; x[5] = -.1252334085114692;
lg = 6; lg = 6;
} else { } else {
w[0] = .01761400713915212; w[0] = .01761400713915212;
w[1] = .04060142980038694; w[1] = .04060142980038694;
w[2] = .06267204833410906; w[2] = .06267204833410906;
w[3] = .08327674157670475; w[3] = .08327674157670475;
w[4] = .1019301198172404; w[4] = .1019301198172404;
w[5] = .1181945319615184; w[5] = .1181945319615184;
w[6] = .1316886384491766; w[6] = .1316886384491766;
w[7] = .1420961093183821; w[7] = .1420961093183821;
w[8] = .1491729864726037; w[8] = .1491729864726037;
w[9] = .1527533871307259; w[9] = .1527533871307259;
 End of changes. 4 change blocks. 
5 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)