29-Jun-2022 18:14:03 asa266_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test asa266(). asa266_test01(): alnorm(), normp(), and nprob() compute the cumulative density function for the normal distribution. X CDF1 1-CDF1 CDF2 1-CDF2 PDF2 CDF3 1-CDF3 PDF3 0.000000 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.000000 0.841345 0.158655 0.841345 0.158655 0.241971 0.841345 0.158655 0.241971 1.200000 0.884930 0.115070 0.884930 0.115070 0.194186 0.884930 0.115070 0.194186 1.400000 0.919243 0.080757 0.919243 0.080757 0.149727 0.919243 0.080757 0.149727 1.600000 0.945201 0.054799 0.945201 0.054799 0.110921 0.945201 0.054799 0.110921 1.800000 0.964070 0.035930 0.964070 0.035930 0.078950 0.964070 0.035930 0.078950 2.000000 0.977250 0.022750 0.977250 0.022750 0.053991 0.977250 0.022750 0.053991 2.200000 0.986097 0.013903 0.986097 0.013903 0.035475 0.986097 0.013903 0.035475 2.400000 0.991802 0.008198 0.991802 0.008198 0.022395 0.991802 0.008198 0.022395 2.600000 0.995339 0.004661 0.995339 0.004661 0.013583 0.995339 0.004661 0.013583 2.800000 0.997445 0.002555 0.997445 0.002555 0.007915 0.997445 0.002555 0.007915 3.000000 0.998650 0.001350 0.998650 0.001350 0.004432 0.998650 0.001350 0.004432 asa266_test02() ppnd(), r8_normal_01_cdf_inverse() compute the percentage points of the normal distribution. CDF, PPND(CDF), R8(CDF) 0.100000 -1.281552 -1.281552 0.200000 -0.841621 -0.841621 0.300000 -0.524401 -0.524401 0.400000 -0.253347 -0.253347 0.500000 0.000000 0.000000 0.600000 0.253347 0.253347 0.700000 0.524401 0.524401 0.800000 0.841621 0.841621 0.900000 1.281552 1.281552 asa266_test03(): digamma(X) = d ( Log ( Gamma ( X ) ) ) / dX. digamma() and r8_psi() compute the digamma function: X DIGAMMA R8_PSI 0.100000 -10.423755 -10.423755 0.200000 -5.289040 -5.289040 0.300000 -3.502524 -3.502524 0.400000 -2.561385 -2.561385 0.500000 -1.963510 -1.963510 0.600000 -1.540619 -1.540619 0.700000 -1.220024 -1.220024 0.800000 -0.965009 -0.965009 0.900000 -0.754927 -0.754927 1.000000 -0.577216 -0.577216 asa266_test04() trigamma() computes the trigamma function: trigamma(X) = d^2 ( Log ( Gamma ( X ) ) ) / dX^2. X TRIGAMMA 0.100000 101.433299 0.200000 26.267377 0.300000 12.245365 0.400000 7.275357 0.500000 4.934802 0.600000 3.636210 0.700000 2.834049 0.800000 2.299474 0.900000 1.922540 1.000000 1.644934 asa266_test05(): alogam(), gammaln(), lngamma() compute the logarithm of the gamma function. X ALOGAM R8_GAMMA_LOG LNGAMMA 0.100000 2.252713 2.252713 2.252713 0.200000 1.524064 1.524064 1.524064 0.300000 1.095798 1.095798 1.095798 0.400000 0.796678 0.796678 0.796678 0.500000 0.572365 0.572365 0.572365 0.600000 0.398234 0.398234 0.398234 0.700000 0.260867 0.260867 0.260867 0.800000 0.152060 0.152060 0.152060 0.900000 0.066376 0.066376 0.066376 1.000000 -0.000000 0.000000 0.000000 asa266_test06(): gamain(), gammds(), 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.000000 0.095163 0.095163 0.095163 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.000000 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.000000 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.000000 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.000000 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.000000 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.000000 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.000000 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.000000 0.593430 0.593430 0.593430 1.000000 0.100000 0.975873 0.975873 0.975873 1.000000 0.200000 0.947620 0.947620 0.947620 1.000000 0.300000 0.915674 0.915674 0.915674 1.000000 0.400000 0.880526 0.880526 0.880526 1.000000 0.500000 0.842701 0.842701 0.842701 1.000000 0.600000 0.802740 0.802740 0.802740 1.000000 0.700000 0.761188 0.761188 0.761188 1.000000 0.800000 0.718571 0.718571 0.718571 1.000000 0.900000 0.675392 0.675392 0.675392 1.000000 1.000000 0.632121 0.632121 0.632121 asa266_test07(): ppchi2() computes the percentage points of the chi squared distribution. CDF, PPCHI2(CDF) For Chi^2 parameter value 1.000000 0.100000 0.015791 0.200000 0.064185 0.300000 0.148472 0.400000 0.274996 0.500000 0.454936 0.600000 0.708326 0.700000 1.074194 0.800000 1.642374 0.900000 2.705543 For Chi^2 parameter value 2.000000 0.100000 0.210721 0.200000 0.446287 0.300000 0.713350 0.400000 1.021651 0.500000 1.386294 0.600000 1.832581 0.700000 2.407946 0.800000 3.218876 0.900000 4.605170 For Chi^2 parameter value 3.000000 0.100000 0.584374 0.200000 1.005174 0.300000 1.423652 0.400000 1.869168 0.500000 2.365974 0.600000 2.946166 0.700000 3.664871 0.800000 4.641628 0.900000 6.251389 For Chi^2 parameter value 4.000000 0.100000 1.063623 0.200000 1.648777 0.300000 2.194698 0.400000 2.752843 0.500000 3.356694 0.600000 4.044626 0.700000 4.878433 0.800000 5.988617 0.900000 7.779440 For Chi^2 parameter value 5.000000 0.100000 1.610308 0.200000 2.342534 0.300000 2.999908 0.400000 3.655500 0.500000 4.351460 0.600000 5.131867 0.700000 6.064430 0.800000 7.289276 0.900000 9.236357 For Chi^2 parameter value 6.000000 0.100000 2.204131 0.200000 3.070088 0.300000 3.827552 0.400000 4.570154 0.500000 5.348121 0.600000 6.210757 0.700000 7.231135 0.800000 8.558060 0.900000 10.644641 For Chi^2 parameter value 7.000000 0.100000 2.833107 0.200000 3.822322 0.300000 4.671330 0.400000 5.493235 0.500000 6.345811 0.600000 7.283208 0.700000 8.383431 0.800000 9.803250 0.900000 12.017037 For Chi^2 parameter value 8.000000 0.100000 3.489539 0.200000 4.593574 0.300000 5.527422 0.400000 6.422646 0.500000 7.344121 0.600000 8.350525 0.700000 9.524458 0.800000 11.030091 0.900000 13.361566 For Chi^2 parameter value 9.000000 0.100000 4.168159 0.200000 5.380053 0.300000 6.393306 0.400000 7.357035 0.500000 8.342833 0.600000 9.413640 0.700000 10.656372 0.800000 12.242145 0.900000 14.683657 asa266_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.083000 0.448000 0.469000 4 0.087000 0.474000 0.439000 5 0.078000 0.503000 0.419000 6 0.040000 0.456000 0.504000 7 0.049000 0.363000 0.588000 8 0.100000 0.317000 0.583000 9 0.075000 0.394000 0.531000 10 0.084000 0.445000 0.471000 11 0.060000 0.435000 0.505000 12 0.089000 0.418000 0.493000 13 0.050000 0.485000 0.465000 14 0.073000 0.378000 0.549000 15 0.064000 0.562000 0.374000 16 0.085000 0.465000 0.450000 17 0.094000 0.388000 0.518000 18 0.014000 0.449000 0.537000 19 0.060000 0.544000 0.396000 20 0.031000 0.569000 0.400000 21 0.025000 0.491000 0.484000 22 0.045000 0.613000 0.342000 23 0.019500 0.526000 0.454500 Observed means, variances are: 1 0.071543 0.001578 2 0.451130 0.006562 3 0.477326 0.004058 Index, Estimate, Lower Limit, Upper Limit: 1 3.215425 1.890272 4.540579 2 20.382491 11.928183 28.836799 3 21.685248 12.692475 30.678022 Expected means, variances are: 1 0.071007 0.001425 2 0.450112 0.005348 3 0.478881 0.005392 Alpha sum is 45.283164 NORMALIZED VALUES: Index, Estimate, Lower Limit, Upper Limit: 1 0.071007 0.041743 0.100271 2 0.450112 0.263413 0.636811 3 0.478881 0.280291 0.677471 Log likelikhood function = 73.124994 asa266_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.220000 2 20.380000 3 21.680000 Distribution means, variances are: 1 0.071113 0.001427 2 0.450088 0.005348 3 0.478799 0.005392 Number of samples is 1000 First few samples: 1 0.082422 0.647396 0.270182 2 0.080700 0.357153 0.562146 3 0.192581 0.556193 0.251226 4 0.092218 0.446517 0.461265 5 0.094590 0.439952 0.465457 6 0.081835 0.308646 0.609518 7 0.067656 0.467150 0.465194 8 0.064079 0.472172 0.463749 9 0.030331 0.525055 0.444614 10 0.046636 0.374292 0.579073 Observed means, variances are: 1 0.070812 0.001387 2 0.457679 0.005412 3 0.471509 0.005704 Index, Estimate, Lower Limit, Upper Limit: 1 3.278008 3.072719 3.483298 2 20.999590 19.676055 22.323125 3 21.616268 20.253844 22.978692 Alpha sum is 45.893866 NORMALIZED VALUES: Index, Estimate, Lower Limit, Upper Limit: 1 0.071426 0.066953 0.075899 2 0.457569 0.428730 0.486408 3 0.471006 0.441319 0.500692 Log likelikhood function = 3187.528838 asa266_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.000000 0.178680 0.821320 2 2 0.864358 0.135642 0.000000 3 2 0.922783 0.000042 0.077175 4 1 0.000576 0.683745 0.315679 5 3 0.000000 0.022494 0.977506 6 1 0.000000 0.010750 0.989250 7 2 0.427879 0.572114 0.000007 8 1 0.617543 0.026791 0.355666 9 2 0.980571 0.019429 0.000000 10 3 0.000000 0.999297 0.000703 Element Observed mean, variance 1 0.301396 0.177988 2 0.174459 0.072286 3 0.524145 0.175796 asa266_test(): Normal end of execution. 29-Jun-2022 18:14:03