06 October 2025 6:52:52.273 PM wishart_matrix_test(): Fortran90 version Test wishart_matrix(). INITIALIZE - Note: The RNGLIB package has been initialized. WISHART_UNIT_SAMPLE_TEST: WISHART_UNIT_SAMPLE samples unit Wishart matrices by: W = wishart_unit_sample ( n, df ) wishart_unit_sample ( 5, 8 ): Col 1 2 3 4 5 Row 1: 5.56493 5.05461 1.26202 0.214321 -1.95278 2: 5.05461 15.4694 -3.05087 -5.31932 1.97391 3: 1.26202 -3.05087 5.24692 2.58788 1.78216 4: 0.214321 -5.31932 2.58788 5.17439 0.511312E-01 5: -1.95278 1.97391 1.78216 0.511312E-01 9.43579 wishart_unit_sample ( 5, 8 ): Col 1 2 3 4 5 Row 1: 7.15062 0.710723E-01 -0.497145 -0.395115 2.96170 2: 0.710723E-01 7.24595 2.61084 -0.752288 -1.40759 3: -0.497145 2.61084 2.11783 -0.314598 -0.799090 4: -0.395115 -0.752288 -0.314598 1.24492 1.31259 5: 2.96170 -1.40759 -0.799090 1.31259 16.9436 wishart_unit_sample ( 5, 5 ): Col 1 2 3 4 5 Row 1: 3.59066 2.61702 3.72394 -1.17358 2.99275 2: 2.61702 8.15058 -2.19828 -1.58592 3.37922 3: 3.72394 -2.19828 10.0528 -0.301395E-01 1.89636 4: -1.17358 -1.58592 -0.301395E-01 2.76486 1.24149 5: 2.99275 3.37922 1.89636 1.24149 5.94794 wishart_unit_sample ( 3, 5 ): Col 1 2 3 Row 1: 5.32187 1.79882 0.849214 2: 1.79882 9.62478 1.00531 3: 0.849214 1.00531 0.576206 Eigenvectors of previous matrix: Col 1 2 3 Row 1: 0.347769 0.927022 -0.140309 2: 0.929245 -0.360706 -0.799635E-01 3: 0.124738 0.102572 0.986873 Eigenvalues of previous matrix: 1: 10.432932 2: 4.7159053 3: 0.37401174 INITIALIZE - Note: The RNGLIB package has been initialized. BARTLETT_UNIT_SAMPLE_TEST: BARTLETT_UNIT_SAMPLE samples unit Bartlett matrices by: call bartlett_unit_sample ( n, df, t ) bartlett_unit_sample ( 5, 8, t ): Col 1 2 3 4 5 Row 1: 2.27061 -0.942562 -0.490321 -2.32358 0.632391 2: 0. 2.69685 -0.590132 -0.589747 0.261983 3: 0. 0. 1.81069 0.521907 -0.232258 4: 0. 0. 0. 2.35263 0.657202 5: 0. 0. 0. 0. 2.00597 bartlett_unit_sample ( 5, 8, t ): Col 1 2 3 4 5 Row 1: 1.30020 -0.411377 1.02990 0.204099 -0.164523 2: 0. 2.67105 -1.23916 1.08860 -0.269434 3: 0. 0. 3.78187 0.688780 -0.732557 4: 0. 0. 0. 3.20755 -1.55817 5: 0. 0. 0. 0. 2.08252 bartlett_unit_sample ( 5, 5, t ): Col 1 2 3 4 5 Row 1: 3.35465 1.04134 1.46614 0.469584 0.883593 2: 0. 2.75723 0.518317 -0.712684 -0.186021 3: 0. 0. 1.69178 -0.258773 0.974327 4: 0. 0. 0. 0.614337 -1.52654 5: 0. 0. 0. 0. 0.691369 bartlett_unit_sample ( 3, 5, t ): Col 1 2 3 Row 1: 1.83918 0.993714 -1.53000 2: 0. 2.19217 -2.26363 3: 0. 0. 0.881595 Eigenvectors of previous matrix: Col 1 2 3 Row 1: -0.284914 0.942589 0.174213 2: -0.605643 -0.317892 0.729480 3: 0.742981 0.102328 0.661444 Eigenvalues of previous matrix: 1: 14.605533 2: 2.4607155 3: 0.35152452 INITIALIZE - Note: The RNGLIB package has been initialized. TEST03: Verify that, if using the same set of random numbers, W = T' * T, where W = wishart_unit_sample ( n, df ) T = bartlett_unit_sample ( n, df ) INITIALIZE - Note: The RNGLIB package has been initialized. INITIALIZE - Note: The RNGLIB package has been initialized. Frobenius norm of error is 18.7922 INITIALIZE - Note: The RNGLIB package has been initialized. TEST04: We can compute sample Wishart matrices by: W = wishart_sample ( n, df, sigma ) wishart_sample ( 5, 8, Identity ): Col 1 2 3 4 5 Row 1: 5.57690 -1.86807 -3.96240 1.54658 -3.15501 2: -1.86807 8.89266 1.75125 -2.03993 5.91087 3: -3.96240 1.75125 8.63344 0.875481 5.62070 4: 1.54658 -2.03993 0.875481 10.6038 -1.63258 5: -3.15501 5.91087 5.62070 -1.63258 9.23989 wishart_sample ( 5, 8, Identity ): Col 1 2 3 4 5 Row 1: 2.58868 -3.34438 1.48556 2.51810 -2.15336 2: -3.34438 7.96922 -1.71509 -3.14726 5.31551 3: 1.48556 -1.71509 10.5215 -2.13759 0.598104 4: 2.51810 -3.14726 -2.13759 10.1504 -0.461777 5: -2.15336 5.31551 0.598104 -0.461777 6.61117 wishart_sample ( 5, 8, diag(1,2,3,4,5) ): Col 1 2 3 4 5 Row 1: 7.52894 -3.10529 2.74378 8.71745 2.20177 2: -3.10529 12.2122 0.921406 7.36094 -4.65963 3: 2.74378 0.921406 5.22598 9.83733 -4.20232 4: 8.71745 7.36094 9.83733 40.8244 -4.42721 5: 2.20177 -4.65963 -4.20232 -4.42721 20.1497 Set covariance SIGMA: Col 1 2 3 Row 1: 25. 5. 15. 2: 5. 17. 11. 3: 15. 11. 49. wishart_sample ( 3, 3, sigma ): Col 1 2 3 Row 1: 11.4903 -12.8389 1.68144 2: -12.8389 41.1760 -19.0187 3: 1.68144 -19.0187 22.5310 Eigenvectors of previous matrix: Col 1 2 3 Row 1: -0.258243 -0.600273 0.756956 2: 0.835488 0.254625 0.486955 3: -0.485046 0.758181 0.435766 Eigenvalues of previous matrix: 1: 56.185805 2: 14.812565 3: 4.1989447 INITIALIZE - Note: The RNGLIB package has been initialized. TEST05: We can compute sample Bartlett matrices by: T = bartlett_sample ( n, df, sigma ) bartlett_sample ( 5, 8, Identity ): Col 1 2 3 4 5 Row 1: 2.29876 -0.458784 1.04393 1.41573 0.333362 2: 0. 1.73553 0.334422 0.629084 1.46043 3: 0. 0. 3.12636 0.535104 0.495854 4: 0. 0. 0. 1.88078 -0.544949 5: 0. 0. 0. 0. 1.74784 bartlett_sample ( 5, 8, Identity ): Col 1 2 3 4 5 Row 1: 3.63805 0.381199 1.49583 2.50616 -0.657311 2: 0. 3.89796 -1.16909 2.28145 1.22814 3: 0. 0. 2.11036 -0.602950 -1.05720 4: 0. 0. 0. 2.02040 -1.09579 5: 0. 0. 0. 0. 1.00044 bartlett_sample ( 5, 8, diag(1,2,3,4,5) ): Col 1 2 3 4 5 Row 1: 2.18008 0.232472 -1.51217 2.18171 -2.23042 2: 0. 4.11610 3.00483 -1.55270 -3.27285 3: 0. 0. 4.83741 0.586553 -3.02550 4: 0. 0. 0. 3.60644 0.308151E-01 5: 0. 0. 0. 0. 4.94889 Set covariance SIGMA: Col 1 2 3 Row 1: 25. 5. 15. 2: 5. 17. 11. 3: 15. 11. 49. bartlett_sample ( 3, 3, sigma ): Col 1 2 3 Row 1: 8.60435 -1.81183 15.6500 2: 0. 5.31216 -1.81094 3: 0. 0. 3.58050 Eigenvectors of previous matrix: Col 1 2 3 Row 1: 0.458076 0.203270 0.865360 2: -0.132665 0.978234 -0.159558 3: 0.878957 0.417128E-01 -0.475072 Eigenvalues of previous matrix: 1: 336.93223 2: 26.643034 3: 2.9835973 INITIALIZE - Note: The RNGLIB package has been initialized. TEST06: Verify that, if using the same set of random numbers, W = T' * T, where W = wishart_sample ( n, df, sigma ) T = bartlett_sample ( n, df, sigma ) Covariance SIGMA: Col 1 2 3 Row 1: 25. 5. 15. 2: 5. 17. 11. 3: 15. 11. 49. INITIALIZE - Note: The RNGLIB package has been initialized. INITIALIZE - Note: The RNGLIB package has been initialized. Frobenius norm of error is 564.800 INITIALIZE - Note: The RNGLIB package has been initialized. TEST07: For given values of N, DF, SIGMA, the random\ matrices from the Wishart distribution: W = wishart_sample ( n, df, sigma ) should have mean DF * SIGMA. Fix N = 3 Fix DF = 5 Fix covariance SIGMA: Col 1 2 3 Row 1: 25. 5. 15. 2: 5. 17. 11. 3: 15. 11. 49. W_Average / DF: Col 1 2 3 Row 1: 24.6924 4.54417 14.9928 2: 4.54417 16.8306 10.4664 3: 14.9928 10.4664 49.1054 Frobenius norm of SIGMA-W_average/DF = 1.05810 INITIALIZE - Note: The RNGLIB package has been initialized. TEST08: Verify that, if using the same set of random numbers, inverse(W) = M, where W = wishart_unit_sample ( n, df ) M = wishart_unit_sample_inverse ( n, df ) INITIALIZE - Note: The RNGLIB package has been initialized. INITIALIZE - Note: The RNGLIB package has been initialized. Frobenius norm of error is 3.21458 INITIALIZE - Note: The RNGLIB package has been initialized. TEST09: Verify that, if using the same set of random numbers, inverse(W) = M, where W = wishart_sample ( n, df, sigma ) M = wishart_sample_inverse ( n, df, sigma ) INITIALIZE - Note: The RNGLIB package has been initialized. INITIALIZE - Note: The RNGLIB package has been initialized. Frobenius norm of error is 5.89535 wishart_matrix_test(): Normal end of execution. 06 October 2025 6:52:52.275 PM