June 24 2002 2:22:31.103 PM REGRESSION_PRB Tests for REGRESSION. TEST01 EXAMPLE_SIZE gets the size of an example file. EXAMPLE_READ reads an example file. EXAMPLE_PRINT prints an example file. Open and print file x01.txt EXAMPLE_PRINT: Number of rows/observations = 62 Number of columns/variables = 1 # Brain WeigBody Weigh 1 3.385 44.500 2 0.480 15.500 3 1.350 8.100 4 465.000 423.000 5 36.330 119.500 6 27.660 115.000 7 14.830 98.200 8 1.040 5.500 9 4.190 58.000 10 0.425 6.400 11 0.101 4.000 12 0.920 5.700 13 1.000 6.600 14 0.005 0.140 15 0.060 1.000 16 3.500 10.800 17 2.000 12.300 18 1.700 6.300 19 2547.000 4603.000 20 0.023 0.300 21 187.100 419.000 22 521.000 655.000 23 0.785 3.500 24 10.000 115.000 25 3.300 25.600 26 0.200 5.000 27 1.410 17.500 28 529.000 680.000 29 207.000 406.000 30 85.000 325.000 31 0.750 12.300 32 62.000 1320.000 33 6654.000 5712.000 34 3.500 3.900 35 6.800 179.000 36 35.000 56.000 37 4.050 17.000 38 0.120 1.000 39 0.023 0.400 40 0.010 0.250 41 1.400 12.500 42 250.000 490.000 43 2.500 12.100 44 55.500 175.000 45 100.000 157.000 46 52.160 440.000 47 10.550 179.500 48 0.550 2.400 49 60.000 81.000 50 3.600 21.000 51 4.288 39.200 52 0.280 1.900 53 0.075 1.200 54 0.122 3.000 55 0.048 0.330 56 192.000 180.000 57 3.000 25.000 58 160.000 169.000 59 0.900 2.600 60 1.620 11.400 61 0.104 2.500 62 4.235 50.400 TEST01 EXAMPLE_SIZE gets the size of an example file. EXAMPLE_READ reads an example file. EXAMPLE_PRINT prints an example file. Open and print file x03.txt EXAMPLE_PRINT: Number of rows/observations = 30 Number of columns/variables = 2 # One AgeSystolic B 1 1.000 39.000 144.000 2 1.000 47.000 220.000 3 1.000 45.000 138.000 4 1.000 47.000 145.000 5 1.000 65.000 162.000 6 1.000 46.000 142.000 7 1.000 67.000 170.000 8 1.000 42.000 124.000 9 1.000 67.000 158.000 10 1.000 56.000 154.000 11 1.000 64.000 162.000 12 1.000 56.000 150.000 13 1.000 59.000 140.000 14 1.000 34.000 110.000 15 1.000 42.000 128.000 16 1.000 48.000 130.000 17 1.000 45.000 135.000 18 1.000 17.000 114.000 19 1.000 20.000 116.000 20 1.000 19.000 124.000 21 1.000 36.000 136.000 22 1.000 50.000 142.000 23 1.000 39.000 120.000 24 1.000 21.000 120.000 25 1.000 44.000 160.000 26 1.000 53.000 158.000 27 1.000 63.000 144.000 28 1.000 29.000 130.000 29 1.000 25.000 125.000 30 1.000 69.000 175.000 TEST01 EXAMPLE_SIZE gets the size of an example file. EXAMPLE_READ reads an example file. EXAMPLE_PRINT prints an example file. Open and print file x60.txt EXAMPLE_PRINT: Number of rows/observations = 3 Number of columns/variables = 3 # A1 A2 A3 B 1 2.000 -1.000 0.000 0.000 2 -1.000 2.000 -1.000 0.000 3 0.000 -1.000 2.000 4.000 TEST02 GEN generates a random example. EXAMPLE_PRINT: Number of rows/observations = 5 Number of columns/variables = 3 # A1 A2 A3 B 1 0.012 0.071 0.563 0.650 2 0.716 0.767 0.756 2.249 3 0.734 0.294 0.322 1.367 4 0.545 0.315 0.416 1.269 5 0.132 0.484 0.452 1.016 EXAMPLE_PRINT: Number of rows/observations = 8 Number of columns/variables = 4 # A1 A2 A3 A4 B 1 0.435 0.384 0.762 0.927 2.508 2 0.340 0.218 0.390 0.609 1.541 3 0.757 0.708 0.797 0.359 2.678 4 0.227 0.202 0.793 0.714 1.971 5 0.198 0.712 0.476 0.619 1.942 6 0.930 0.505 0.224 0.356 1.967 7 0.207 0.661 0.126 0.190 1.129 8 0.557 0.534 0.370 0.549 1.937 EXAMPLE_PRINT: Number of rows/observations = 4 Number of columns/variables = 2 # A1 A2 B 1 0.191 0.615 0.788 2 0.275 0.326 0.626 3 0.917 0.532 1.424 4 0.613 0.821 1.426 TEST03 SCR returns all the M by NA submatrices of an M by N matrix A, where NA is between NL and NU. For our problem: M = 4 N = 5 NL = 2 NU = 3 The M by N matrix A: 1 2 3 4 5 1 11.0000 12.0000 13.0000 14.0000 15.0000 2 21.0000 22.0000 23.0000 24.0000 25.0000 3 31.0000 32.0000 33.0000 34.0000 35.0000 4 41.0000 42.0000 43.0000 44.0000 45.0000 1 2 1 11.0000 12.0000 2 21.0000 22.0000 3 31.0000 32.0000 4 41.0000 42.0000 1 2 1 11.0000 13.0000 2 21.0000 23.0000 3 31.0000 33.0000 4 41.0000 43.0000 1 2 1 12.0000 13.0000 2 22.0000 23.0000 3 32.0000 33.0000 4 42.0000 43.0000 1 2 1 11.0000 14.0000 2 21.0000 24.0000 3 31.0000 34.0000 4 41.0000 44.0000 1 2 1 12.0000 14.0000 2 22.0000 24.0000 3 32.0000 34.0000 4 42.0000 44.0000 1 2 1 13.0000 14.0000 2 23.0000 24.0000 3 33.0000 34.0000 4 43.0000 44.0000 1 2 1 11.0000 15.0000 2 21.0000 25.0000 3 31.0000 35.0000 4 41.0000 45.0000 1 2 1 12.0000 15.0000 2 22.0000 25.0000 3 32.0000 35.0000 4 42.0000 45.0000 1 2 1 13.0000 15.0000 2 23.0000 25.0000 3 33.0000 35.0000 4 43.0000 45.0000 1 2 1 14.0000 15.0000 2 24.0000 25.0000 3 34.0000 35.0000 4 44.0000 45.0000 1 2 3 1 11.0000 12.0000 13.0000 2 21.0000 22.0000 23.0000 3 31.0000 32.0000 33.0000 4 41.0000 42.0000 43.0000 1 2 3 1 11.0000 12.0000 14.0000 2 21.0000 22.0000 24.0000 3 31.0000 32.0000 34.0000 4 41.0000 42.0000 44.0000 1 2 3 1 11.0000 13.0000 14.0000 2 21.0000 23.0000 24.0000 3 31.0000 33.0000 34.0000 4 41.0000 43.0000 44.0000 1 2 3 1 12.0000 13.0000 14.0000 2 22.0000 23.0000 24.0000 3 32.0000 33.0000 34.0000 4 42.0000 43.0000 44.0000 1 2 3 1 11.0000 12.0000 15.0000 2 21.0000 22.0000 25.0000 3 31.0000 32.0000 35.0000 4 41.0000 42.0000 45.0000 1 2 3 1 11.0000 13.0000 15.0000 2 21.0000 23.0000 25.0000 3 31.0000 33.0000 35.0000 4 41.0000 43.0000 45.0000 1 2 3 1 12.0000 13.0000 15.0000 2 22.0000 23.0000 25.0000 3 32.0000 33.0000 35.0000 4 42.0000 43.0000 45.0000 1 2 3 1 11.0000 14.0000 15.0000 2 21.0000 24.0000 25.0000 3 31.0000 34.0000 35.0000 4 41.0000 44.0000 45.0000 1 2 3 1 12.0000 14.0000 15.0000 2 22.0000 24.0000 25.0000 3 32.0000 34.0000 35.0000 4 42.0000 44.0000 45.0000 1 2 3 1 13.0000 14.0000 15.0000 2 23.0000 24.0000 25.0000 3 33.0000 34.0000 35.0000 4 43.0000 44.0000 45.0000 TEST04 QRBD computes the singular values S of a bidiagonal matrix BD, and can also compute the decomposition factors U and V, so that S = U * BD * V. The bidiagonal matrix BD: 0.7177 0.4485 0.0000 0.0000 0.6554 0.4345 0.0000 0.0000 0.1152 The singular values of BD: 1 0.983048 2 0.610998 3 0.902531E-01 The factor U: 0.7611 0.6477 0.0340 -0.6472 0.7550 0.1050 0.0423 -0.1019 0.9939 The factor V: 0.5557 -0.7603 0.3365 0.7791 0.3348 -0.5300 0.2903 0.5567 0.7784 The product U' * S * V' = BD: 0.7177 0.4485 0.0000 0.0000 0.6554 0.4345 0.0000 0.0000 0.1152 TEST05 SVD computes the singular value decomposition of a real general matrix. Matrix order = 4 The matrix A: 1 2 3 4 1 0.990000 0.200000E-02 0.600000E-02 0.200000E-02 2 0.200000E-02 0.990000 0.200000E-02 0.600000E-02 3 0.600000E-02 0.200000E-02 0.990000 0.200000E-02 4 0.200000E-02 0.600000E-02 0.200000E-02 0.990000 The singular values S 1 1.00000 2 0.984000 3 0.992000 4 0.984000 The U matrix: 1 2 3 4 1 -0.499987 0.707125 -0.499987 0.235177E-09 2 -0.499996 0.755489E-05 0.500007 0.707104 3 -0.500023 -0.707088 -0.500003 0.154972E-05 4 -0.499994 0.602007E-05 0.500003 -0.707109 The V matrix: 1 2 3 4 1 -0.499987 0.707125 -0.499987 0.00000 2 -0.499996 0.759959E-05 0.500007 0.707104 3 -0.500023 -0.707088 -0.500003 0.157952E-05 4 -0.499994 0.591576E-05 0.500003 -0.707109 The product U * S * Transpose(V): 1 2 3 4 1 0.990000 0.199993E-02 0.600006E-02 0.199990E-02 2 0.199993E-02 0.990000 0.200010E-02 0.600004E-02 3 0.600003E-02 0.199993E-02 0.990001 0.200009E-02 4 0.199991E-02 0.599998E-02 0.200001E-02 0.990000 TEST06 C01M generates all subsets of size M from a set of size N, one at a time, trying to use simple exchanges. 1 0 0 1 1 1 1 1 1 2 0 1 0 1 1 1 1 1 3 0 1 1 0 1 1 1 1 4 0 1 1 1 0 1 1 1 5 0 1 1 1 1 0 1 1 6 0 1 1 1 1 1 0 1 7 0 1 1 1 1 1 1 0 8 1 0 0 1 1 1 1 1 9 1 0 1 0 1 1 1 1 10 1 0 1 1 0 1 1 1 11 1 0 1 1 1 0 1 1 12 1 0 1 1 1 1 0 1 13 1 0 1 1 1 1 1 0 14 1 1 0 0 1 1 1 1 TEST07 CWLR_L2 uses clustering techniques. Open data file x06.txt Number of rows/observations, M = 44 Number of columns/variables, N = 2 Number of clusters, S = 4 Minimum cluster population, ML = 3 Maximum cluster population, MU = 44 Solution column vectors X: 1 2 1 28.4520 18.9332 2 27.6593 28.7828 3 23.0758 44.1703 4 23.2025 43.6331 Objective function = 0.180519E+08 TEST08 CWLR_LI uses clustering techniques. Open data file x06.txt Number of rows/observations, M = 44 Number of columns/variables, N = 2 Number of clusters, S = 4 Minimum cluster population, ML = 3 Maximum cluster population, MU = 44 Solution column vectors X: 1 2 1 132.051 15.6103 2 12.6394 44.1118 3 48.7025 -28.2302 4 42.4157 42.2368 Objective function = 11359.7 TEST09 REGR_LP minimizes the LP norm of the residual A*X-B, where 1 < P < Infinity. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Using P = 1.10000 REGR_LP - Warning! No convergence after ITMAX iterations. TEST09 - Warning! REGR_LP returned IFLAG = 3 Using P = 1.20000 Solution: 1 98.4419 2 0.954033 LP norm of residual = 183.050 Using P = 1.40000 Solution: 1 98.6083 2 0.950761 LP norm of residual = 137.261 Using P = 1.70000 Solution: 1 98.5766 2 0.957684 LP norm of residual = 105.842 Using P = 2.00000 Solution: 1 98.7147 2 0.970870 LP norm of residual = 91.6157 Using P = 2.50000 Solution: 1 100.337 2 0.996376 LP norm of residual = 80.9287 Using P = 4.00000 Solution: 1 109.085 2 1.03575 LP norm of residual = 68.0956 Using P = 6.50000 Solution: 1 115.482 2 1.05888 LP norm of residual = 59.1820 TEST10 NORMAL_L2 solves the normal equations. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution: 1 98.7147 2 0.970871 L2 norm of residual = 91.6157 TEST11 MGS_L2 uses the modified Gram Schmidt method. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution: 1 98.7147 2 0.970870 L2 norm of residual = 91.6157 TEST12 ICMGS_L2 uses the modified Gram Schmidt method. Note that this code should get the same answer as MGS_L2. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution: 1 98.7148 2 0.970870 L2 norm of residual = 91.6157 TEST13 GIVR_L2 uses the Givens Rotation method. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution: 1 98.7147 2 0.970871 L2 norm of residual = 91.6157 TEST14 HFTI_L2 uses Householder transformations. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution: 1 98.7147 2 0.970870 L2 norm of residual = 91.6157 TEST15 SVDR_L2 uses the singular value decomposition to solve a least squares problem. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution: 1 98.7147 2 0.970871 L2 norm of residual = 91.6157 TEST16 A478_L1 minimizes the L1 norm of the residual A*X-B. Open data file x10.txt Number of rows/observations = 21 Number of columns/variables = 3 Solution: 1 0.928071 2 0.358244 3 -0.533162 Numerical estimate of rank = 3 L1 norm of computed residual = 63.9715 L1 norm of recomputed residual = 63.9715 TEST17 AFK_L1 minimizes the L1 norm of the residual A*X-B. Open data file x10.txt Number of rows/observations = 21 Number of columns/variables = 3 Solution: 1 0.928071 2 0.358245 3 -0.533162 L1 norm of computed residual = 63.9715 L1 norm of recomputed residual = 63.9715 TEST18 BLOD_L1 minimizes the L1 norm of the residual A*X-B. Open data file x10.txt Number of rows/observations = 21 Number of columns/variables = 3 Solution: 1 0.928071 2 0.358244 3 -0.533162 Computed L1 norm of residual = 63.9715 Recomputed L1 norm of residual = 63.9715 TEST19 A328_LI minimizes the L-infinity norm of the residual A*X-B. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution: 1 117.517 2 1.17241 Computed L-infinity norm of residual = 47.3793 Recomputed L-infinity norm of residual = 47.3793 TEST20 A495_LI minimizes the L-infinity norm of the residual A*X-B. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution: 1 117.517 2 1.17241 Computed L-infinity norm of residual = 47.3793 Recomputed L-infinity norm of residual = 47.3793 TEST21 ABD_LI minimizes the L-infinity norm of the residual A*X-B. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution: 1 117.517 2 1.17241 Computed L-infinity norm of residual = 47.3793 Recomputed L-infinity norm of residual = 47.3793 TEST30 ORTH_L2 minimizes the L2 norm of: A*X - X(N+1)*B with L2 norm of X equal to 1. Open data file x02.txt Number of rows/observations = 12 Number of columns/variables = 2 Solution: 1 0.728804 2 -0.133712 3 0.671540 L2 norm of AX-X(N+1)*B = 9.96384 L2 norm of X = 1.00000 TEST305 ORTH_L1 minimizes the L1 norm of: A*X - X(N+1)*B with L2 norm of X equal to 1. Open data file x02.txt Number of rows/observations = 12 Number of columns/variables = 2 Solution: 1 0.730790 2 -0.138924 3 0.668316 L1 norm of AX-X(N+1)*B = 23.5581 L2 norm of X = 1.00000 Spaeth solution: 1 0.730791 2 -0.138925 3 0.668315 L1 norm of AX-X(N+1)*B = 23.5581 L2 norm of X = 1.00000 TEST306 ORTH_LI minimizes the LI norm of: A*X - X(N+1)*B with L2 norm of X equal to 1. Open data file x02.txt Number of rows/observations = 12 Number of columns/variables = 2 Solution: 1 0.00000 2 0.613410 3 0.789765 LI norm of AX-X(N+1)*B = 17.8656 L2 norm of X = 1.00000 Spaeth solution: 1 0.699750 2 -0.845856E-01 3 0.709362 LI norm of AX-X(N+1)*B = 5.64030 L2 norm of X = 1.00000 TEST307 ORTH_LP minimizes the LP norm of: A*X - X(N+1)*B with L2 norm of X equal to 1. Open data file x02.txt Number of rows/observations = 12 Number of columns/variables = 2 P = 1.10000 ORTH_LP - Fatal error! Number of iterations exceeded. TEST307 - Warning! ORTH_LP returned IFLAG = 4 Solution: 1 0.730113 2 -0.137896 3 0.669268 LP norm of AX-X(N+1)*B = 19.8290 L2 norm of X = 1.00000 P = 1.20000 Solution: 1 0.729306 2 -0.136651 3 0.670403 LP norm of AX-X(N+1)*B = 17.2456 L2 norm of X = 1.00000 P = 1.40000 Solution: 1 0.729545 2 -0.136965 3 0.670078 LP norm of AX-X(N+1)*B = 13.9803 L2 norm of X = 1.00000 P = 1.70000 Solution: 1 0.729919 2 -0.137038 3 0.669656 LP norm of AX-X(N+1)*B = 11.3722 L2 norm of X = 1.00000 P = 2.00000 Solution: 1 0.728804 2 -0.133712 3 0.671540 LP norm of AX-X(N+1)*B = 9.96384 L2 norm of X = 1.00000 P = 2.50000 Solution: 1 0.724671 2 -0.123655 3 0.677910 LP norm of AX-X(N+1)*B = 8.70769 L2 norm of X = 1.00000 P = 4.00000 Solution: 1 0.713690 2 -0.103738 3 0.692738 LP norm of AX-X(N+1)*B = 7.32297 L2 norm of X = 1.00000 P = 6.50000 ORTH_LP - Fatal error! Number of iterations exceeded. TEST307 - Warning! ORTH_LP returned IFLAG = 4 Solution: 1 0.717497 2 -0.154112 3 0.679300 LP norm of AX-X(N+1)*B = 6.65007 L2 norm of X = 1.00000 TEST33 CON_L1 solves a constrained minimization problem in the L1 norm: Find an N vector X which minimizes the residual: || A * X - B || and satisifies the linear equalities: C * X = D and the linear inequalities: E * X >= F. Open data file x54.txt Number of rows/observations = 13 Number of columns/variables = 5 Number of subsystems = 3 Open data file x54_01.txt Open data file x54_02.txt Open data file x54_03.txt Solution: 1 0.816327E-01 2 0.00000 3 0.00000 4 0.782313E-01 5 -0.646258E-01 L1 norms of residuals: CON_L1 claims A*X-B residual norm = 31.3401 A*X-B = 31.3401 C*X-D = 0.178814E-06 E*X-F = 7.34014 E*X-F: 1 0.510204 2 6.82993 Spaeth's solution: 1 0.816327E-01 2 0.00000 3 0.00000 4 0.782313E-01 5 -0.646259E-01 L1 norms of residuals: A*X-B = 31.3401 C*X-D = 0.774860E-06 E*X-F = 7.34014 E*X-F: 1 0.510204 2 6.82993 TEST34 CON_L2 solves a constrained minimization problem in the L2 norm: Find an N vector X which minimizes the residual: || A * X - B || and satisifies the linear equalities: C * X = D and the linear inequalities: E * X >= F. Open data file x54.txt Number of rows/observations = 13 Number of columns/variables = 5 Number of subsystems = 3 Open data file x54_01.txt Number of minimizine equations M = 8 Open data file x54_02.txt Number of equality constraints L = 3 Open data file x54_03.txt Number of inequality constraints K = 2 Solution: 1 -0.194991 2 -0.887155E-02 3 0.267374 4 0.912886E-01 5 0.272189 L2 norms of residuals: CON_L2 claims A*X-B residual norm = 9.03411 A*X-B = 10.2120 C*X-D = 3.87588 E*X-F = 5.93724 E*X-F: 1 -0.197039 2 5.93397 Spaeth's solution: 1 -0.411582E-01 2 0.411582E-01 3 0.252699E-08 4 0.101372 5 -0.414852E-01 L2 norms of residuals: A*X-B = 13.3791 C*X-D = 0.178416E-05 E*X-F = 7.15954 E*X-F: 1 0.805312 2 7.11411 TEST35 CON_LI solves a constrained minimization problem in the LI norm: Find an N vector X which minimizes the residual: || A * X - B || and satisifies the linear equalities: C * X = D and the linear inequalities: F <= E * X <= G. Open data file x54.txt Number of rows/observations = 13 Number of columns/variables = 5 Number of subsystems = 3 Open data file x54_01.txt Open data file x54_02.txt Open data file x54_03.txt Solution: 1 0.408163E-01 2 0.00000 3 0.00000 4 0.891157E-01 5 -0.537415E-01 LI norms of residuals: CON_LI claims A*X-B residual norm = 6.95782 A*X-B = 6.95782 C*X-D = 0.476837E-06 E*X-F: 1 0.583673 2 6.90068 G-E*X: 1 100.416 2 101.099 Spaeth's solution: 1 0.408165E-01 2 0.00000 3 0.00000 4 0.891156E-01 5 -0.537416E-01 LI norms of residuals: A*X-B = 6.95782 C*X-D = 0.834465E-06 E*X-F: 1 100.416 2 101.099 G-E*X: 1 100.416 2 101.099 TEST22 NN_L2 minimizes the L2 norm of the residual A*X-B for nonnegative X. Open data file x02.txt Number of rows/observations = 12 Number of columns/variables = 2 Solution: 1 0.875028 2 0.00000 Computed L2 norm of residual = 16.3295 Recomputed L2 norm of residual = 16.3295 TEST225 NN_L1 minimizes the L1 norm of the residual A*X-B for nonnegative X. Find an N vector X which minimizes the residual: || A * X - B || and satisifies the linear equalities: C * X = D and the linear inequalities: E * X >= H and the nonnegativity constraint: X >= 0 Open data file x54.txt Number of rows/observations = 13 Number of columns/variables = 5 Number of subsystems = 3 Open data file x54_01.txt Open data file x54_02.txt Open data file x54_03.txt Solution: 1 0.816327E-01 2 0.00000 3 0.129252 4 0.136054E-01 5 0.00000 L1 norms of residuals: NN_L1 claims A*X-B residual norm = 31.3401 A*X-B = 31.3401 C*X-D = 0.238419E-06 E*X-H = 7.34014 E*X-H: 1 0.510204 2 6.82993 TEST23 SCRF_L1 minimizes the L1 norm of the residual A*X-B. Open data file x10.txt Number of rows/observations = 21 Number of columns/variables = 3 TEST23 - Warning! SCRF_L1 returned IFLAG = ****** TEST24 AVLLSQ carries out average linear regression. Open data file x43.txt Number of rows/observations = 12 Number of columns/variables = 2 Number of clusters = 3 Base filename = x43_01.txt Open subsystem data file x43_01.txt Number of rows/observations = 4 Open subsystem data file x43_02.txt Number of rows/observations = 5 Open subsystem data file x43_03.txt Number of rows/observations = 3 EXAMPLE_PRINT: Number of rows/observations = 12 Number of columns/variables = 2 # A1 A2 B 1 1.000 1.000 2.000 2 3.000 1.000 5.000 3 6.000 1.000 6.000 4 8.000 1.000 6.000 5 2.000 1.000 5.000 6 4.000 1.000 4.000 7 7.000 1.000 5.000 8 8.000 1.000 8.000 9 10.000 1.000 7.000 10 3.000 1.000 2.000 11 6.000 1.000 5.000 12 7.000 1.000 9.000 Solution: 1 0.539414 2 2.39305 Spaeth's solution, page 190: 1 0.539414 2 2.39305 Value of objective function = 2.53822 TEST25 ROBUST minimizes an objective function based on the residuals of A*X-B. Open data file x04.txt Number of rows/observations = 38 Number of columns/variables = 2 Method = 1 Solution: 1 0.271218E-01 2 9.89840 Value of SR = 40.4575 Recomputed L2 norm of residual = 1346.01 Method = 2 Solution: 1 0.271162E-01 2 9.89677 Value of SR = 40.4704 Recomputed L2 norm of residual = 1346.09 Method = 3 Solution: 1 0.264798E-01 2 9.93381 Value of SR = 37.4856 Recomputed L2 norm of residual = 1345.09 Method = 4 Solution: 1 0.264411E-01 2 9.99104 Value of SR = 26.9198 Recomputed L2 norm of residual = 1343.11 Method = 5 Solution: 1 0.274436E-01 2 9.88292 Value of SR = 43.5852 Recomputed L2 norm of residual = 1346.41 Method = 6 Solution: 1 0.215450E-01 2 9.74335 Value of SR = 44.6302 Recomputed L2 norm of residual = 1368.19 Method = 7 Solution: 1 0.318633E-01 2 10.0045 Value of SR = 60.5393 Recomputed L2 norm of residual = 1340.88 Method = 8 Solution: 1 0.268483E-01 2 9.90708 Value of SR = 39.4134 Recomputed L2 norm of residual = 1345.90 TEST26 LDP_L2 solves a least distance programming problem. Find the vector X of minimum L2 norm which satisfies the linear inequalities E * X >= H. Open data file x54_03.txt Number of rows/observations = 2 Number of columns/variables = 5 Solution X: 1 -0.222222 2 -0.740741E-01 3 -0.148148 4 -0.444444 5 -0.148148 Residual E * X - H: 1 3.74074 2 0.953674E-06 TEST27 RR_L2 minimizes the L2 norm of: [ A ] * X - [ B ] [ LAMBDA * I ] [ 0 ] Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution for LAMBDA = 0.00000 Solution: 1 98.7147 2 0.970870 L2 norm of AX-B = 91.6157 L2 norm of LAMBDA*X = 0.00000 L2 norm of residual = 91.6157 Solution for LAMBDA = 1.00000 Solution: 1 74.0272 2 1.46319 L2 norm of AX-B = 101.095 L2 norm of LAMBDA*X = 74.0416 L2 norm of residual = 125.309 Solution for LAMBDA = 100.000 Solution: 1 0.806329E-01 2 2.56075 L2 norm of AX-B = 217.284 L2 norm of LAMBDA*X = 256.202 L2 norm of residual = 335.934 TEST28 RR_L1 minimizes the L1 norm of: [ A ] * X - [ B ] [ LAMBDA * I ] [ 0 ] Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution for LAMBDA = 0.00000 Solution: 1 97.0000 2 1.00000 L1 norm of AX-B = 286.000 L1 norm of LAMBDA*X = 0.00000 L1 norm of residual = 286.000 Solution for LAMBDA = 1.00000 Solution: 1 97.0000 2 1.00000 L1 norm of AX-B = 286.000 L1 norm of LAMBDA*X = 98.0000 L1 norm of residual = 384.000 Solution for LAMBDA = 100.000 Solution: 1 0.00000 2 2.84000 L1 norm of AX-B = 828.160 L1 norm of LAMBDA*X = 284.000 L1 norm of residual = 1112.16 TEST29 RR_LI minimizes the L-infinity norm of: [ A ] * X - [ B ] [ LAMBDA * I ] [ 0 ] Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Solution for LAMBDA = 0.00000 Solution: 1 117.517 2 1.17241 L-infinity norm of AX-B = 47.3793 L-infinity norm of LAMBDA*X = 0.00000 L-infinity norm of residual = 47.3793 Solution for LAMBDA = 1.00000 Solution: 1 56.2857 2 2.28571 L-infinity norm of AX-B = 56.2857 L-infinity norm of LAMBDA*X = 56.2857 L-infinity norm of residual = 56.2857 Solution for LAMBDA = 100.000 Solution: 1 1.48650 2 1.48649 L-infinity norm of AX-B = 148.649 L-infinity norm of LAMBDA*X = 148.650 L-infinity norm of residual = 148.650 TEST31 SVDRS uses the singular value decomposition to solve a least squares problem. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Singular values S: 1 260.617 2 1.73095 Solution = V * inv(S) * U' * B: 1 98.7147 2 0.970871 L2 norm of residual = 91.6157 TEST32 SVD applies the singular value decomposition to a matrix. Open data file x03.txt Number of rows/observations = 30 Number of columns/variables = 2 Singular values S: 1 1.73095 2 260.617 Solution: 1 98.7147 2 0.970871 L2 norm of residual = 91.6157 REGRESSION_PRB Normal end of execution.