09 May 2025 9:48:11.630 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.48679 -0.585048 -0.614500 2.61877 1.16973 2: -0.585048 3.56543 0.116348 -2.36823 -0.640957 3: -0.614500 0.116348 3.89865 -0.925013 1.69381 4: 2.61877 -2.36823 -0.925013 5.83661 1.33201 5: 1.16973 -0.640957 1.69381 1.33201 3.77460 wishart_unit_sample ( 5, 8 ): Col 1 2 3 4 5 Row 1: 14.0893 -3.43151 1.57894 -0.332211 -2.74046 2: -3.43151 13.9435 5.06289 1.10422 -0.621602E-02 3: 1.57894 5.06289 10.1835 -1.84820 -0.395511 4: -0.332211 1.10422 -1.84820 2.03959 -0.431551 5: -2.74046 -0.621602E-02 -0.395511 -0.431551 2.72374 wishart_unit_sample ( 5, 5 ): Col 1 2 3 4 5 Row 1: 10.1189 0.627021 -1.24807 -0.118654 1.23241 2: 0.627021 0.707727 1.64281 -0.252495 1.02365 3: -1.24807 1.64281 7.48497 1.52634 2.32969 4: -0.118654 -0.252495 1.52634 1.89641 -0.182145E-01 5: 1.23241 1.02365 2.32969 -0.182145E-01 4.98513 wishart_unit_sample ( 3, 5 ): Col 1 2 3 Row 1: 3.72856 -4.40700 0.791909E-02 2: -4.40700 6.66329 -0.544332 3: 0.791909E-02 -0.544332 1.47422 Eigenvectors of previous matrix: Col 1 2 3 Row 1: -0.582573 -0.271922 0.765942 2: 0.811037 -0.132843 0.569711 3: -0.531668E-01 0.953106 0.297929 Eigenvalues of previous matrix: 1: 9.8645452 2: 1.5478281 3: 0.45368735 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: 3.23891 -1.70902 0.139292 0.375523 -1.20404 2: 0. 1.58961 -0.226219E-01 -0.140497 0.123630 3: 0. 0. 2.09952 -0.857732 -0.258109 4: 0. 0. 0. 2.91186 0.404275 5: 0. 0. 0. 0. 2.50406 bartlett_unit_sample ( 5, 8, t ): Col 1 2 3 4 5 Row 1: 2.88619 -1.08883 1.11724 -0.372508 -1.11582 2: 0. 1.78127 -1.48375 -0.929914 0.905059 3: 0. 0. 2.55151 2.22399 -0.703373 4: 0. 0. 0. 3.33408 -0.371457 5: 0. 0. 0. 0. 1.71114 bartlett_unit_sample ( 5, 5, t ): Col 1 2 3 4 5 Row 1: 0.779396 -0.844772 -0.244780 -0.910703E-01 0.823458E-01 2: 0. 2.05727 2.48381 0.678020E-01 -0.495974 3: 0. 0. 0.912385 1.71574 1.46285 4: 0. 0. 0. 0.347972 1.49001 5: 0. 0. 0. 0. 0.437803 bartlett_unit_sample ( 3, 5, t ): Col 1 2 3 Row 1: 2.39423 0.790786 0.409929 2: 0. 1.83507 0.548096 3: 0. 0. 3.03268 Eigenvectors of previous matrix: Col 1 2 3 Row 1: 0.304577 0.805236 -0.508752 2: 0.278987 0.435284 0.855976 3: 0.910714 -0.402646 -0.920726E-01 Eigenvalues of previous matrix: 1: 10.401278 2: 6.2650604 3: 2.7244544 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 15.1537 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: 13.0176 -1.90375 -0.314215 5.04602 0.498356E-01 2: -1.90375 8.37091 0.982870E-01 -0.403943 -0.444097 3: -0.314215 0.982870E-01 4.88450 -0.121546 -0.381624 4: 5.04602 -0.403943 -0.121546 5.68603 0.357984 5: 0.498356E-01 -0.444097 -0.381624 0.357984 0.857622 wishart_sample ( 5, 8, Identity ): Col 1 2 3 4 5 Row 1: 6.37015 0.211122 3.50591 0.545548 2.71852 2: 0.211122 8.17876 -0.875090 -2.26537 -0.979531 3: 3.50591 -0.875090 11.9107 0.277761 3.11387 4: 0.545548 -2.26537 0.277761 3.54826 -1.07837 5: 2.71852 -0.979531 3.11387 -1.07837 5.45277 wishart_sample ( 5, 8, diag(1,2,3,4,5) ): Col 1 2 3 4 5 Row 1: 14.6054 8.69905 -1.55363 -6.04580 -13.5883 2: 8.69905 25.9126 -5.74532 12.7359 18.7403 3: -1.55363 -5.74532 20.1108 7.50288 -9.67469 4: -6.04580 12.7359 7.50288 42.7166 24.1634 5: -13.5883 18.7403 -9.67469 24.1634 58.3690 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: 13.8487 23.3426 -0.906160 2: 23.3426 48.5158 4.65290 3: -0.906160 4.65290 14.0559 Eigenvectors of previous matrix: Col 1 2 3 Row 1: 0.444307 -0.239681 0.863218 2: 0.892240 0.316833E-01 -0.450448 3: 0.806141E-01 0.970335 0.227930 Eigenvalues of previous matrix: 1: 60.560070 2: 14.431608 3: 1.4287208 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.29887 -0.467759 -1.42443 -1.33791 0.748647 2: 0. 2.35372 -0.487446 -0.474288 -2.01322 3: 0. 0. 1.59591 -0.646837 0.315462 4: 0. 0. 0. 3.11244 -0.827910 5: 0. 0. 0. 0. 0.863959 bartlett_sample ( 5, 8, Identity ): Col 1 2 3 4 5 Row 1: 2.45509 -0.167972 0.245647 -1.90167 0.867645 2: 0. 2.01937 -0.760723 -0.749207 0.339974 3: 0. 0. 2.39518 1.11179 -0.606850 4: 0. 0. 0. 3.80147 1.94443 5: 0. 0. 0. 0. 0.978676 bartlett_sample ( 5, 8, diag(1,2,3,4,5) ): Col 1 2 3 4 5 Row 1: 3.45834 -1.47777 -2.10671 -0.810707 -3.86340 2: 0. 2.54763 1.02876 -3.32801 -0.995925E-01 3: 0. 0. 2.76092 -0.706432 -1.17253 4: 0. 0. 0. 3.58671 1.52640 5: 0. 0. 0. 0. 3.08850 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: 3.31713 -0.874450 4.60424 2: 0. 6.07011 13.7761 3: 0. 0. 13.7353 Eigenvectors of previous matrix: Col 1 2 3 Row 1: 0.353415E-01 -0.414468 0.909378 2: 0.205010 0.893601 0.399310 3: 0.978122 -0.172319 -0.116551 Eigenvalues of previous matrix: 1: 416.87301 2: 23.607093 3: 7.7722073 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 207.999 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: 25.7884 5.52999 15.1667 2: 5.52999 17.6031 11.8459 3: 15.1667 11.8459 48.5189 Frobenius norm of SIGMA-W_average/DF = 1.80704 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 17.2623 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 16.5065 wishart_matrix_test(): Normal end of execution. 09 May 2025 9:48:11.632 PM