/* NIST StRD benchmark from http://www.nist.gov/itl/div898/strd/ Nonlinear Regression Difficulty=Lower Exponential k=8 N=250 Generated Dataset Name: Gauss2 (Gauss2.dat) Procedure: Nonlinear Least Squares Regression Description: The data are two slightly-blended Gaussians on a decaying exponential baseline plus normally distributed zero-mean noise with variance = 6.25. Reference: Rust, B., NIST (1996). Data: 1 Response (y) 1 Predictor (x) 250 Observations Lower Level of Difficulty Generated Data Model: Exponential Class 8 Parameters (b1 to b8) y = b1*exp( -b2*x ) + b3*exp( -(x-b4)**2 / b5**2 ) + b6*exp( -(x-b7)**2 / b8**2 ) + e Starting values Certified Values Start 1 Start 2 Parameter Standard Deviation b1 = 96.0 98.0 9.9018328406E+01 5.3748766879E-01 b2 = 0.009 0.0105 1.0994945399E-02 1.3335306766E-04 b3 = 103.0 103.0 1.0188022528E+02 5.9217315772E-01 b4 = 106.0 105.0 1.0703095519E+02 1.5006798316E-01 b5 = 18.0 20.0 2.3578584029E+01 2.2695595067E-01 b6 = 72.0 73.0 7.2045589471E+01 6.1721965884E-01 b7 = 151.0 150.0 1.5327010194E+02 1.9466674341E-01 b8 = 18.0 20.0 1.9525972636E+01 2.6416549393E-01 Residual Sum of Squares: 1.2475282092E+03 Residual Standard Deviation: 2.2704790782E+00 Degrees of Freedom: 242 Number of Observations: 250 */ clear scalar N = 250 scalar df_r = 242 scalar df_m = 8 scalar rss = 1.2475282092E+03 scalar rmse = 2.2704790782E+00 scalar b1 = 9.9018328406E+01 scalar seb1 = 5.3748766879E-01 scalar b2 = 1.0994945399E-02 scalar seb2 = 1.3335306766E-04 scalar b3 = 1.0188022528E+02 scalar seb3 = 5.9217315772E-01 scalar b4 = 1.0703095519E+02 scalar seb4 = 1.5006798316E-01 scalar b5 = 2.3578584029E+01 scalar seb5 = 2.2695595067E-01 scalar b6 = 7.2045589471E+01 scalar seb6 = 6.1721965884E-01 scalar b7 = 1.5327010194E+02 scalar seb7 = 1.9466674341E-01 scalar b8 = 1.9525972636E+01 scalar seb8 = 2.6416549393E-01 qui input double (y x) 97.58776 1.000000 97.76344 2.000000 96.56705 3.000000 92.52037 4.000000 91.15097 5.000000 95.21728 6.000000 90.21355 7.000000 89.29235 8.000000 91.51479 9.000000 89.60966 10.000000 86.56187 11.00000 85.55316 12.00000 87.13054 13.00000 85.67940 14.00000 80.04851 15.00000 82.18925 16.00000 87.24081 17.00000 80.79407 18.00000 81.28570 19.00000 81.56940 20.00000 79.22715 21.00000 79.43275 22.00000 77.90195 23.00000 76.75468 24.00000 77.17377 25.00000 74.27348 26.00000 73.11900 27.00000 73.84826 28.00000 72.47870 29.00000 71.92292 30.00000 66.92176 31.00000 67.93835 32.00000 69.56207 33.00000 69.07066 34.00000 66.53983 35.00000 63.87883 36.00000 69.71537 37.00000 63.60588 38.00000 63.37154 39.00000 60.01835 40.00000 62.67481 41.00000 65.80666 42.00000 59.14304 43.00000 56.62951 44.00000 61.21785 45.00000 54.38790 46.00000 62.93443 47.00000 56.65144 48.00000 57.13362 49.00000 58.29689 50.00000 58.91744 51.00000 58.50172 52.00000 55.22885 53.00000 58.30375 54.00000 57.43237 55.00000 51.69407 56.00000 49.93132 57.00000 53.70760 58.00000 55.39712 59.00000 52.89709 60.00000 52.31649 61.00000 53.98720 62.00000 53.54158 63.00000 56.45046 64.00000 51.32276 65.00000 53.11676 66.00000 53.28631 67.00000 49.80555 68.00000 54.69564 69.00000 56.41627 70.00000 54.59362 71.00000 54.38520 72.00000 60.15354 73.00000 59.78773 74.00000 60.49995 75.00000 65.43885 76.00000 60.70001 77.00000 63.71865 78.00000 67.77139 79.00000 64.70934 80.00000 70.78193 81.00000 70.38651 82.00000 77.22359 83.00000 79.52665 84.00000 80.13077 85.00000 85.67823 86.00000 85.20647 87.00000 90.24548 88.00000 93.61953 89.00000 95.86509 90.00000 93.46992 91.00000 105.8137 92.00000 107.8269 93.00000 114.0607 94.00000 115.5019 95.00000 118.5110 96.00000 119.6177 97.00000 122.1940 98.00000 126.9903 99.00000 125.7005 100.00000 123.7447 101.00000 130.6543 102.00000 129.7168 103.00000 131.8240 104.00000 131.8759 105.00000 131.9994 106.0000 132.1221 107.0000 133.4414 108.0000 133.8252 109.0000 133.6695 110.0000 128.2851 111.0000 126.5182 112.0000 124.7550 113.0000 118.4016 114.0000 122.0334 115.0000 115.2059 116.0000 118.7856 117.0000 110.7387 118.0000 110.2003 119.0000 105.17290 120.0000 103.44720 121.0000 94.54280 122.0000 94.40526 123.0000 94.57964 124.0000 88.76605 125.0000 87.28747 126.0000 92.50443 127.0000 86.27997 128.0000 82.44307 129.0000 80.47367 130.0000 78.36608 131.0000 78.74307 132.0000 76.12786 133.0000 79.13108 134.0000 76.76062 135.0000 77.60769 136.0000 77.76633 137.0000 81.28220 138.0000 79.74307 139.0000 81.97964 140.0000 80.02952 141.0000 85.95232 142.0000 85.96838 143.0000 79.94789 144.0000 87.17023 145.0000 90.50992 146.0000 93.23373 147.0000 89.14803 148.0000 93.11492 149.0000 90.34337 150.0000 93.69421 151.0000 95.74256 152.0000 91.85105 153.0000 96.74503 154.0000 87.60996 155.0000 90.47012 156.0000 88.11690 157.0000 85.70673 158.0000 85.01361 159.0000 78.53040 160.0000 81.34148 161.0000 75.19295 162.0000 72.66115 163.0000 69.85504 164.0000 66.29476 165.0000 63.58502 166.0000 58.33847 167.0000 57.50766 168.0000 52.80498 169.0000 50.79319 170.0000 47.03490 171.0000 46.47090 172.0000 43.09016 173.0000 34.11531 174.0000 39.28235 175.0000 32.68386 176.0000 30.44056 177.0000 31.98932 178.0000 23.63330 179.0000 23.69643 180.0000 20.26812 181.0000 19.07074 182.0000 17.59544 183.0000 16.08785 184.0000 18.94267 185.0000 18.61354 186.0000 17.25800 187.0000 16.62285 188.0000 13.48367 189.0000 15.37647 190.0000 13.47208 191.0000 15.96188 192.0000 12.32547 193.0000 16.33880 194.0000 10.438330 195.0000 9.628715 196.0000 13.12268 197.0000 8.772417 198.0000 11.76143 199.0000 12.55020 200.0000 11.33108 201.0000 11.20493 202.0000 7.816916 203.0000 6.800675 204.0000 14.26581 205.0000 10.66285 206.0000 8.911574 207.0000 11.56733 208.0000 11.58207 209.0000 11.59071 210.0000 9.730134 211.0000 11.44237 212.0000 11.22912 213.0000 10.172130 214.0000 12.50905 215.0000 6.201493 216.0000 9.019605 217.0000 10.80607 218.0000 13.09625 219.0000 3.914271 220.0000 9.567886 221.0000 8.038448 222.0000 10.231040 223.0000 9.367410 224.0000 7.695971 225.0000 6.118575 226.0000 8.793207 227.0000 7.796692 228.0000 12.45065 229.0000 10.61601 230.0000 6.001003 231.0000 6.765098 232.0000 8.764653 233.0000 4.586418 234.0000 8.390783 235.0000 7.209202 236.0000 10.012090 237.0000 7.327461 238.0000 6.525136 239.0000 2.840065 240.0000 10.323710 241.0000 4.790035 242.0000 8.376431 243.0000 6.263980 244.0000 2.705892 245.0000 8.362109 246.0000 8.983507 247.0000 3.362469 248.0000 1.182678 249.0000 4.875312 250.0000 end #delimit ; nl ( y = {b1}*exp( -{b2}*x ) + {b3}*exp( -(x-{b4})^2 / {b5}^2 ) + {b6}*exp( -(x-{b7})^2 / {b8}^2 ) ), init(b1 96 b2 0.009 b3 103 b4 106 b5 18 b6 72 b7 151 b8 18) eps(1e-10) ; #delimit cr assert N == e(N) assert df_r == e(df_r) assert df_m == e(df_m) lrecomp [b1]_b[_cons] b1 [b2]_b[_cons] b2 [b3]_b[_cons] b3 /* */ [b4]_b[_cons] b4 [b5]_b[_cons] b5 [b6]_b[_cons] b6 /* */ [b7]_b[_cons] b7 [b8]_b[_cons] b8 () /* */ [b1]_se[_cons] seb1 [b2]_se[_cons] seb2 [b3]_se[_cons] seb3 /* */ [b4]_se[_cons] seb4 [b5]_se[_cons] seb5 [b6]_se[_cons] seb6 /* */ [b7]_se[_cons] seb7 [b8]_se[_cons] seb8 () /* */ e(rmse) rmse e(rss) rss