5 June 2013 11:11:46.595 AM ASA266_PRB FORTRAN90 version Test the ASA266 library. TEST01 ALNORM, NORMP, and NPROB are routines that compute the cumulative density function for the normal distribution. X CDF1 1-CDF1 CDF2 1-CDF2 PDF2 CDF3 1-CDF3 PDF3 0.00000 0.500000 0.500000 0.500000 0.500000 0.398942 0.500000 0.500000 0.398942 0.200000 0.579260 0.420740 0.579260 0.420740 0.391043 0.579260 0.420740 0.391043 0.400000 0.655422 0.344578 0.655422 0.344578 0.368270 0.655422 0.344578 0.368270 0.600000 0.725747 0.274253 0.725747 0.274253 0.333225 0.725747 0.274253 0.333225 0.800000 0.788145 0.211855 0.788145 0.211855 0.289692 0.788145 0.211855 0.289692 1.00000 0.841345 0.158655 0.841345 0.158655 0.241971 0.841345 0.158655 0.241971 1.20000 0.884930 0.115070 0.884930 0.115070 0.194186 0.884930 0.115070 0.194186 1.40000 0.919243 0.807567E-01 0.919243 0.807567E-01 0.149727 0.919243 0.807567E-01 0.149727 1.60000 0.945201 0.547993E-01 0.945201 0.547993E-01 0.110921 0.945201 0.547993E-01 0.110921 1.80000 0.964070 0.359303E-01 0.964070 0.359303E-01 0.789502E-01 0.964070 0.359303E-01 0.789502E-01 2.00000 0.977250 0.227501E-01 0.977250 0.227501E-01 0.539910E-01 0.977250 0.227501E-01 0.539910E-01 2.20000 0.986097 0.139034E-01 0.986097 0.139034E-01 0.354746E-01 0.986097 0.139034E-01 0.354746E-01 2.40000 0.991802 0.819754E-02 0.991802 0.819754E-02 0.223945E-01 0.991802 0.819754E-02 0.223945E-01 2.60000 0.995339 0.466119E-02 0.995339 0.466119E-02 0.135830E-01 0.995339 0.466119E-02 0.135830E-01 2.80000 0.997445 0.255513E-02 0.997445 0.255513E-02 0.791545E-02 0.997445 0.255513E-02 0.791545E-02 3.00000 0.998650 0.134990E-02 0.998650 0.134990E-02 0.443185E-02 0.998650 0.134990E-02 0.443185E-02 TEST02 PPND, PPND16 compute the percentage points of the normal distribution. CDF PPND(CDF) PPND16(CDF) 0.100000 -1.28155 -1.28155 0.200000 -0.841621 -0.841621 0.300000 -0.524401 -0.524401 0.400000 -0.253347 -0.253347 0.500000 0.00000 0.00000 0.600000 0.253347 0.253347 0.700000 0.524401 0.524401 0.800000 0.841621 0.841621 0.900000 1.28155 1.28155 TEST03 digamma(X) = d ( Log ( Gamma ( X ) ) ) / dX. DIGAMMA and R8_PSI compute the digamma function: X DIGAMMA R8_PSI 0.100000 -10.4238 -10.4238 0.200000 -5.28904 -5.28904 0.300000 -3.50252 -3.50252 0.400000 -2.56138 -2.56138 0.500000 -1.96351 -1.96351 0.600000 -1.54062 -1.54062 0.700000 -1.22002 -1.22002 0.800000 -0.965009 -0.965009 0.900000 -0.754927 -0.754927 1.00000 -0.577216 -0.577216 TEST04 TRIGAMMA computes the trigamma function: trigamma(X) = d^2 ( Log ( Gamma ( X ) ) ) / dX^2. X TRIGAMMA 0.100000 101.433 0.200000 26.2674 0.300000 12.2454 0.400000 7.27536 0.500000 4.93480 0.600000 3.63621 0.700000 2.83405 0.800000 2.29947 0.900000 1.92254 1.00000 1.64493 TEST05 ALNGAM, ALOGAM, R8_GAMMA_LOG, and LNGAMMA compute the logarithm of the gamma function. X ALNGAM ALOGAM R8_GAMMA_LOG LNGAMMA 0.100000 2.25271 2.25271 2.25271 2.25271 0.200000 1.52406 1.52406 1.52406 1.52406 0.300000 1.09580 1.09580 1.09580 1.09580 0.400000 0.796678 0.796678 0.796678 0.796678 0.500000 0.572365 0.572365 0.572365 0.572365 0.600000 0.398234 0.398234 0.398234 0.398234 0.700000 0.260867 0.260867 0.260867 0.260867 0.800000 0.152060 0.152060 0.152060 0.152060 0.900000 0.663762E-01 0.663762E-01 0.663762E-01 0.663762E-01 1.00000 0.00000 -0.199501E-10 0.00000 0.666134E-15 TEST06 GAMAIN, GAMMDS and GAMMAD compute the incomplete Gamma integral. X P GAMMDS GAMMAD GAMAIN 0.100000 0.100000 0.827552 0.827552 0.827552 0.100000 0.200000 0.676043 0.676043 0.676043 0.100000 0.300000 0.545913 0.545913 0.545913 0.100000 0.400000 0.436236 0.436236 0.436236 0.100000 0.500000 0.345279 0.345279 0.345279 0.100000 0.600000 0.270899 0.270899 0.270899 0.100000 0.700000 0.210824 0.210824 0.210824 0.100000 0.800000 0.162840 0.162840 0.162840 0.100000 0.900000 0.124895 0.124895 0.124895 0.100000 1.00000 0.951626E-01 0.951626E-01 0.951626E-01 0.200000 0.100000 0.879420 0.879420 0.879420 0.200000 0.200000 0.764435 0.764435 0.764435 0.200000 0.300000 0.657507 0.657507 0.657507 0.200000 0.400000 0.560104 0.560104 0.560104 0.200000 0.500000 0.472911 0.472911 0.472911 0.200000 0.600000 0.396022 0.396022 0.396022 0.200000 0.700000 0.329108 0.329108 0.329108 0.200000 0.800000 0.271553 0.271553 0.271553 0.200000 0.900000 0.222566 0.222566 0.222566 0.200000 1.00000 0.181269 0.181269 0.181269 0.300000 0.100000 0.908358 0.908358 0.908358 0.300000 0.200000 0.816527 0.816527 0.816527 0.300000 0.300000 0.726957 0.726957 0.726957 0.300000 0.400000 0.641490 0.641490 0.641490 0.300000 0.500000 0.561422 0.561422 0.561422 0.300000 0.600000 0.487583 0.487583 0.487583 0.300000 0.700000 0.420417 0.420417 0.420417 0.300000 0.800000 0.360060 0.360060 0.360060 0.300000 0.900000 0.306407 0.306407 0.306407 0.300000 1.00000 0.259182 0.259182 0.259182 0.400000 0.100000 0.927574 0.927574 0.927574 0.400000 0.200000 0.852337 0.852337 0.852337 0.400000 0.300000 0.776381 0.776381 0.776381 0.400000 0.400000 0.701441 0.701441 0.701441 0.400000 0.500000 0.628907 0.628907 0.628907 0.400000 0.600000 0.559835 0.559835 0.559835 0.400000 0.700000 0.494986 0.494986 0.494986 0.400000 0.800000 0.434858 0.434858 0.434858 0.400000 0.900000 0.379725 0.379725 0.379725 0.400000 1.00000 0.329680 0.329680 0.329680 0.500000 0.100000 0.941402 0.941402 0.941402 0.500000 0.200000 0.878775 0.878775 0.878775 0.500000 0.300000 0.813812 0.813812 0.813812 0.500000 0.400000 0.748019 0.748019 0.748019 0.500000 0.500000 0.682689 0.682689 0.682689 0.500000 0.600000 0.618901 0.618901 0.618901 0.500000 0.700000 0.557515 0.557515 0.557515 0.500000 0.800000 0.499192 0.499192 0.499192 0.500000 0.900000 0.444406 0.444406 0.444406 0.500000 1.00000 0.393469 0.393469 0.393469 0.600000 0.100000 0.951832 0.951832 0.951832 0.600000 0.200000 0.899123 0.899123 0.899123 0.600000 0.300000 0.843211 0.843211 0.843211 0.600000 0.400000 0.785350 0.785350 0.785350 0.600000 0.500000 0.726678 0.726678 0.726678 0.600000 0.600000 0.668198 0.668198 0.668198 0.600000 0.700000 0.610769 0.610769 0.610769 0.600000 0.800000 0.555101 0.555101 0.555101 0.600000 0.900000 0.501764 0.501764 0.501764 0.600000 1.00000 0.451188 0.451188 0.451188 0.700000 0.100000 0.959945 0.959945 0.959945 0.700000 0.200000 0.915220 0.915220 0.915220 0.700000 0.300000 0.866863 0.866863 0.866863 0.700000 0.400000 0.815892 0.815892 0.815892 0.700000 0.500000 0.763276 0.763276 0.763276 0.700000 0.600000 0.709908 0.709908 0.709908 0.700000 0.700000 0.656589 0.656589 0.656589 0.700000 0.800000 0.604021 0.604021 0.604021 0.700000 0.900000 0.552799 0.552799 0.552799 0.700000 1.00000 0.503415 0.503415 0.503415 0.800000 0.100000 0.966395 0.966395 0.966395 0.800000 0.200000 0.928202 0.928202 0.928202 0.800000 0.300000 0.886215 0.886215 0.886215 0.800000 0.400000 0.841245 0.841245 0.841245 0.800000 0.500000 0.794097 0.794097 0.794097 0.800000 0.600000 0.745541 0.745541 0.745541 0.800000 0.700000 0.696301 0.696301 0.696301 0.800000 0.800000 0.647032 0.647032 0.647032 0.800000 0.900000 0.598320 0.598320 0.598320 0.800000 1.00000 0.550671 0.550671 0.550671 0.900000 0.100000 0.971607 0.971607 0.971607 0.900000 0.200000 0.938827 0.938827 0.938827 0.900000 0.300000 0.902253 0.902253 0.902253 0.900000 0.400000 0.862521 0.862521 0.862521 0.900000 0.500000 0.820288 0.820288 0.820288 0.900000 0.600000 0.776205 0.776205 0.776205 0.900000 0.700000 0.730906 0.730906 0.730906 0.900000 0.800000 0.684986 0.684986 0.684986 0.900000 0.900000 0.638996 0.638996 0.638996 0.900000 1.00000 0.593430 0.593430 0.593430 1.00000 0.100000 0.975873 0.975873 0.975873 1.00000 0.200000 0.947620 0.947620 0.947620 1.00000 0.300000 0.915674 0.915674 0.915674 1.00000 0.400000 0.880526 0.880526 0.880526 1.00000 0.500000 0.842701 0.842701 0.842701 1.00000 0.600000 0.802740 0.802740 0.802740 1.00000 0.700000 0.761188 0.761188 0.761188 1.00000 0.800000 0.718571 0.718571 0.718571 1.00000 0.900000 0.675392 0.675392 0.675392 1.00000 1.00000 0.632121 0.632121 0.632121 TEST07 PPCHI2 computes the percentage points of the chi squared distribution. CDF, PPCHI2(CDF) For Chi^2 parameter value 1.00000 0.100000 0.157908E-01 0.200000 0.641848E-01 0.300000 0.148472 0.400000 0.274996 0.500000 0.454936 0.600000 0.708326 0.700000 1.07419 0.800000 1.64237 0.900000 2.70554 For Chi^2 parameter value 2.00000 0.100000 0.210721 0.200000 0.446287 0.300000 0.713350 0.400000 1.02165 0.500000 1.38629 0.600000 1.83258 0.700000 2.40795 0.800000 3.21888 0.900000 4.60517 For Chi^2 parameter value 3.00000 0.100000 0.584374 0.200000 1.00517 0.300000 1.42365 0.400000 1.86917 0.500000 2.36597 0.600000 2.94617 0.700000 3.66487 0.800000 4.64163 0.900000 6.25139 For Chi^2 parameter value 4.00000 0.100000 1.06362 0.200000 1.64878 0.300000 2.19470 0.400000 2.75284 0.500000 3.35669 0.600000 4.04463 0.700000 4.87843 0.800000 5.98862 0.900000 7.77944 For Chi^2 parameter value 5.00000 0.100000 1.61031 0.200000 2.34253 0.300000 2.99991 0.400000 3.65550 0.500000 4.35146 0.600000 5.13187 0.700000 6.06443 0.800000 7.28928 0.900000 9.23636 For Chi^2 parameter value 6.00000 0.100000 2.20413 0.200000 3.07009 0.300000 3.82755 0.400000 4.57015 0.500000 5.34812 0.600000 6.21076 0.700000 7.23114 0.800000 8.55806 0.900000 10.6446 For Chi^2 parameter value 7.00000 0.100000 2.83311 0.200000 3.82232 0.300000 4.67133 0.400000 5.49323 0.500000 6.34581 0.600000 7.28321 0.700000 8.38343 0.800000 9.80325 0.900000 12.0170 For Chi^2 parameter value 8.00000 0.100000 3.48954 0.200000 4.59357 0.300000 5.52742 0.400000 6.42265 0.500000 7.34412 0.600000 8.35053 0.700000 9.52446 0.800000 11.0301 0.900000 13.3616 For Chi^2 parameter value 9.00000 0.100000 4.16816 0.200000 5.38005 0.300000 6.39331 0.400000 7.35703 0.500000 8.34283 0.600000 9.41364 0.700000 10.6564 0.800000 12.2421 0.900000 14.6837 TEST08 For samples of a Dirichlet PDF, DIRICHLET_ESTIMATE estimates the parameters. DIRICHLET_MEAN finds the means; DIRICHLET_VARIANCE finds the variances; Sampled data: 1 0.178000 0.346000 0.476000 2 0.162000 0.307000 0.531000 3 0.830000E-01 0.448000 0.469000 4 0.870000E-01 0.474000 0.439000 5 0.780000E-01 0.503000 0.419000 6 0.400000E-01 0.456000 0.504000 7 0.490000E-01 0.363000 0.588000 8 0.100000 0.317000 0.583000 9 0.750000E-01 0.394000 0.531000 10 0.840000E-01 0.445000 0.471000 11 0.600000E-01 0.435000 0.505000 12 0.890000E-01 0.418000 0.493000 13 0.500000E-01 0.485000 0.465000 14 0.730000E-01 0.378000 0.549000 15 0.640000E-01 0.562000 0.374000 16 0.850000E-01 0.465000 0.450000 17 0.940000E-01 0.388000 0.518000 18 0.140000E-01 0.449000 0.537000 19 0.600000E-01 0.544000 0.396000 20 0.310000E-01 0.569000 0.400000 21 0.250000E-01 0.491000 0.484000 22 0.450000E-01 0.613000 0.342000 23 0.195000E-01 0.526000 0.454500 Observed means, variances are: 1 0.715435E-01 0.157825E-02 2 0.451130 0.656248E-02 3 0.477326 0.405826E-02 Index, Estimate, Lower Limit, Upper Limit: 1 3.21543 1.89027 4.54058 2 20.3825 11.9282 28.8368 3 21.6852 12.6925 30.6780 Expected means, variances are: 1 0.710071E-01 0.142525E-02 2 0.450112 0.534776E-02 3 0.478881 0.539190E-02 Alpha sum is 45.2832 NORMALIZED VALUES: Index, Estimate, Lower Limit, Upper Limit: 1 0.710071E-01 0.417434E-01 0.100271 2 0.450112 0.263413 0.636811 3 0.478881 0.280291 0.677471 Log likelikhood function = 73.1250 TEST085 GAMMA_SAMPLE samples a Gamma distribution. A = 0.514995 B = 1.91700 1 0.524575E-01 2 0.168385E-02 3 0.327396E-02 4 0.124088 5 0.751609 A = 0.279635 B = 0.125872 1 6.55048 2 0.629324E-02 3 0.915894E-01 4 0.473116E-02 5 3.02342 A = 1.73631 B = 0.962208 1 0.973398 2 1.02682 3 0.849548 4 1.85073 5 0.303713 A = 0.797351 B = 1.27269 1 0.238995 2 0.987946 3 0.802530 4 0.248390 5 0.773444 A = 0.873242 B = 1.88362 1 0.707800E-02 2 0.609463E-01 3 0.640018E-01 4 0.124240 5 0.660474 TEST09 For a Dirichlet distribution, DIRICHLET_SAMPLE samples; DIRICHLET_MEAN finds the means; DIRICHLET_VARIANCE finds the variances; DIRICHLET_ESTIMATE estimates the parameters. Distribution parameters are: 1 3.22000 2 20.3800 3 21.6800 Distribution means, variances are: 1 0.711131E-01 0.142731E-02 2 0.450088 0.534807E-02 3 0.478799 0.539219E-02 Number of samples is 1000 First few samples: 1 0.409794E-01 0.137359 0.821662 2 0.491315E-01 0.121637 0.829231 3 0.229294E-01 0.999038E-01 0.877167 4 0.382546 0.297982 0.319472 5 0.279966 0.350219 0.369815 6 0.160128 0.693035 0.146837 7 0.111376 0.451696 0.436928 8 0.146197 0.758542 0.952611E-01 9 0.102435 0.374654 0.522912 10 0.362648E-01 0.143478 0.820257 Observed means, variances are: 1 0.115149 0.951023E-02 2 0.421684 0.551152E-01 3 0.463167 0.552405E-01 Index, Estimate, Lower Limit, Upper Limit: 1 0.834356 0.781302 0.887410 2 2.18012 2.03545 2.32479 3 2.40072 2.24084 2.56059 Alpha sum is 5.41520 NORMALIZED VALUES: Index, Estimate, Lower Limit, Upper Limit: 1 0.154077 0.144280 0.163874 2 0.402593 0.375877 0.429309 3 0.443330 0.413807 0.472853 Log likelikhood function = 1239.22 TEST10 For a Dirichlet mixture distribution, DIRICHLET_MIX_SAMPLE samples; DIRICHLET_MIX_MEAN computes means; DIRICHLET_MIX_VARIANCE computes variances. Component Weight 1 3.000000 2 2.000000 3 1.000000 Component Parameters Means Variances 1 1 0.050000 0.050000 0.023750 2 0.200000 0.200000 0.080000 3 0.750000 0.750000 0.093750 2 1 0.850000 0.850000 0.063750 2 0.100000 0.100000 0.045000 3 0.050000 0.050000 0.023750 3 1 0.000000 0.000000 0.000000 2 0.500000 0.500000 0.125000 3 0.500000 0.500000 0.125000 Element Mean 1 0.308333 2 0.216667 3 0.475000 Number of samples is 200 First few samples: Sample Component X 1 1 0.834665 0.112933 0.052402 2 1 0.000000 0.000003 0.999997 3 2 0.953697 0.046303 0.000000 4 3 0.000000 0.839862 0.160138 5 2 0.984848 0.015151 0.000001 6 2 0.999168 0.000719 0.000113 7 2 0.854503 0.121128 0.024369 8 1 0.061657 0.130630 0.807713 9 1 0.000090 0.608623 0.391288 10 1 0.000000 0.000745 0.999255 Element Observed mean, variance 1 0.300954 0.176911 2 0.195088 0.078626 3 0.503958 0.166115 ASA266_PRB Normal end of execution. 5 June 2013 11:11:46.602 AM