___ ____ ____ ____ ____ ® /__ / ____/ / ____/ 18.0 ___/ / /___/ / /___/ SE—Standard Edition Statistics and Data Science Copyright 1985-2023 StataCorp LLC StataCorp 4905 Lakeway Drive College Station, Texas 77845 USA 800-STATA-PC https://www.stata.com 979-696-4600 stata@stata.com Stata license: 10-user network perpetual Serial number: 1 Licensed to: Stata Developer StataCorp LLC Notes: 1. Stata is running in batch mode. 2. Unicode is supported; see help unicode_advice. 3. Maximum number of variables is set to 5,000 but can be increased; see help set_maxvar. Running /home/krg/bin/profile.do ... Compile number 180110 . do mgh09.do . /* NIST/ITL StRD > Dataset Name: MGH09 (MGH09.dat) > > File Format: ASCII > Starting Values (lines 41 to 44) > Certified Values (lines 41 to 49) > Data (lines 61 to 71) > > Procedure: Nonlinear Least Squares Regression > > Description: This problem was found to be difficult for some very > good algorithms. There is a local minimum at (+inf, > -14.07..., -inf, -inf) with final sum of squares > 0.00102734.... > > See More, J. J., Garbow, B. S., and Hillstrom, K. E. > (1981). Testing unconstrained optimization software. > ACM Transactions on Mathematical Software. 7(1): > pp. 17-41. > > Reference: Kowalik, J.S., and M. R. Osborne, (1978). > Methods for Unconstrained Optimization Problems. > New York, NY: Elsevier North-Holland. > > Data: 1 Response (y) > 1 Predictor (x) > 11 Observations > Higher Level of Difficulty > Generated Data > > Model: Rational Class (linear/quadratic) > 4 Parameters (b1 to b4) > > y = b1*(x**2+x*b2) / (x**2+x*b3+b4) + e > > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 25 0.25 1.9280693458E-01 1.1435312227E-02 > b2 = 39 0.39 1.9128232873E-01 1.9633220911E-01 > b3 = 41.5 0.415 1.2305650693E-01 8.0842031232E-02 > b4 = 39 0.39 1.3606233068E-01 9.0025542308E-02 > > Residual Sum of Squares: 3.0750560385E-04 > Residual Standard Deviation: 6.6279236551E-03 > Degrees of Freedom: 7 > Number of Observations: 11 > */ . . clear . . scalar N = 11 . scalar df_r = 7 . scalar df_m = 4 . . scalar rss = 3.0750560385E-04 . scalar rmse = 6.6279236551E-03 . . scalar b1 = 1.9280693458E-01 . scalar seb1 = 1.1435312227E-02 . scalar b2 = 1.9128232873E-01 . scalar seb2 = 1.9633220911E-01 . scalar b3 = 1.2305650693E-01 . scalar seb3 = 8.0842031232E-02 . scalar b4 = 1.3606233068E-01 . scalar seb4 = 9.0025542308E-02 . . qui input double(y x) . . /* The following starting values led to convergence problems: > > nl ( y = {b1}*(x^2 + x*{b2}) / (x^2 + x*{b3} + {b4}) ), /// > init(b1 25 b2 39 b3 41.5 b4 39) > > */ . . nl ( y = {b1}*(x^2 + x*{b2}) / (x^2 + x*{b3} + {b4}) ), /// > init(b1 0.25 b2 0.39 b3 0.415 b4 0.39) eps(1e-10) Iteration 0: Residual SS = .0052326 Iteration 1: Residual SS = .0015957 Iteration 2: Residual SS = .0010585 Iteration 3: Residual SS = .0003847 Iteration 4: Residual SS = .0003105 Iteration 5: Residual SS = .0003095 Iteration 6: Residual SS = .000308 Iteration 7: Residual SS = .0003077 Iteration 8: Residual SS = .0003076 Iteration 9: Residual SS = .0003075 Iteration 10: Residual SS = .0003075 Iteration 11: Residual SS = .0003075 Iteration 12: Residual SS = .0003075 Iteration 13: Residual SS = .0003075 Iteration 14: Residual SS = .0003075 Iteration 15: Residual SS = .0003075 Iteration 16: Residual SS = .0003075 Iteration 17: Residual SS = .0003075 Iteration 18: Residual SS = .0003075 Iteration 19: Residual SS = .0003075 Iteration 20: Residual SS = .0003075 Iteration 21: Residual SS = .0003075 Iteration 22: Residual SS = .0003075 Iteration 23: Residual SS = .0003075 Iteration 24: Residual SS = .0003075 Iteration 25: Residual SS = .0003075 Iteration 26: Residual SS = .0003075 Iteration 27: Residual SS = .0003075 Iteration 28: Residual SS = .0003075 Iteration 29: Residual SS = .0003075 Iteration 30: Residual SS = .0003075 Iteration 31: Residual SS = .0003075 Iteration 32: Residual SS = .0003075 Iteration 33: Residual SS = .0003075 Iteration 34: Residual SS = .0003075 Iteration 35: Residual SS = .0003075 Iteration 36: Residual SS = .0003075 Iteration 37: Residual SS = .0003075 Iteration 38: Residual SS = .0003075 Iteration 39: Residual SS = .0003075 Source | SS df MS -------------+---------------------------------- Number of obs = 11 Model | .14810567 4 .037026419 R-squared = 0.9979 Residual | .00030751 7 .000043929 Adj R-squared = 0.9967 -------------+---------------------------------- Root MSE = .0066279 Total | .14841318 11 .013492107 Res. dev. = -84.11739 ------------------------------------------------------------------------------ y | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- /b1 | .1928069 .0114353 16.86 0.000 .1657667 .2198472 /b2 | .1912823 .1963322 0.97 0.362 -.2729695 .6555341 /b3 | .1230565 .080842 1.52 0.172 -.0681045 .3142175 /b4 | .1360623 .0900255 1.51 0.174 -.0768143 .3489389 ------------------------------------------------------------------------------ . . 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 ( > ) /* > */ [b1]_se[_cons] seb1 [b2]_se[_cons] seb2 [b3]_se[_cons] seb3 [b4]_se[_cons] > seb4 () /* > */ e(rmse) rmse e(rss) rss [b1]_b[_cons] 8.4 [b2]_b[_cons] 7.0 [b3]_b[_cons] 7.6 [b4]_b[_cons] 7.2 ------------------------- min 7.0 [b1]_se[_cons] 7.5 [b2]_se[_cons] 6.5 [b3]_se[_cons] 6.5 [b4]_se[_cons] 7.1 ------------------------- min 6.5 e(rmse) 11.1 e(rss) 11.6 . . end of do-file