___ ____ ____ ____ ____ ® /__ / ____/ / ____/ 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 mgh10.do . /* NIST/ITL StRD > Dataset Name: MGH10 (MGH10.dat) > > File Format: ASCII > Starting Values (lines 41 to 43) > Certified Values (lines 41 to 48) > Data (lines 61 to 76) > > Procedure: Nonlinear Least Squares Regression > > Description: This problem was found to be difficult for some very > good algorithms. > > 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: Meyer, R. R. (1970). > Theoretical and computational aspects of nonlinear > regression. In Nonlinear Programming, Rosen, > Mangasarian and Ritter (Eds). > New York, NY: Academic Press, pp. 465-486. > > Data: 1 Response (y) > 1 Predictor (x) > 16 Observations > Higher Level of Difficulty > Generated Data > > Model: Exponential Class > 3 Parameters (b1 to b3) > > y = b1 * exp[b2/(x+b3)] + e > > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 2 0.02 5.6096364710E-03 1.5687892471E-04 > b2 = 400000 4000 6.1813463463E+03 2.3309021107E+01 > b3 = 25000 250 3.4522363462E+02 7.8486103508E-01 > > Residual Sum of Squares: 8.7945855171E+01 > Residual Standard Deviation: 2.6009740065E+00 > Degrees of Freedom: 13 > Number of Observations: 16 > */ . . clear . . scalar N = 16 . scalar df_r = 13 . scalar df_m = 3 . . scalar rss = 8.7945855171E+01 . scalar rmse = 2.6009740065E+00 . . scalar b1 = 5.6096364710E-03 . scalar seb1 = 1.5687892471E-04 . scalar b2 = 6.1813463463E+03 . scalar seb2 = 2.3309021107E+01 . scalar b3 = 3.4522363462E+02 . scalar seb3 = 7.8486103508E-01 . . qui input double(y x) . . /* The following starting values led to convergence problems: > > nl ( y = {b1} * exp({b2}/(x+{b3})) ), init(b1 2 b2 400000 b3 25000) eps(1e-10 > ) > > */ . . nl ( y = {b1} * exp({b2}/(x+{b3})) ), init(b1 0.02 b2 4000 b3 250) eps(1e-10) Iteration 0: Residual SS = 1.22e+09 Iteration 1: Residual SS = 9.63e+08 Iteration 2: Residual SS = 1.35e+08 Iteration 3: Residual SS = 1.25e+08 Iteration 4: Residual SS = 1.05e+07 Iteration 5: Residual SS = 5533.259 Iteration 6: Residual SS = 87.9459 Iteration 7: Residual SS = 87.94586 Iteration 8: Residual SS = 87.94586 Iteration 9: Residual SS = 87.94586 Source | SS df MS -------------+---------------------------------- Number of obs = 16 Model | 3.891e+09 3 1.2969e+09 R-squared = 1.0000 Residual | 87.945855 13 6.76506578 Adj R-squared = 1.0000 -------------+---------------------------------- Root MSE = 2.600974 Total | 3.891e+09 16 243172772 Res. dev. = 72.67215 ------------------------------------------------------------------------------ y | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- /b1 | .0056096 .0001569 35.76 0.000 .0052707 .0059486 /b2 | 6181.346 23.30926 265.19 0.000 6130.99 6231.703 /b3 | 345.2236 .7848779 439.84 0.000 343.528 346.9193 ------------------------------------------------------------------------------ . . 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 () /* > */ [b1]_se[_cons] seb1 [b2]_se[_cons] seb2 [b3]_se[_cons] seb3 () /* > */ e(rmse) rmse e(rss) rss [b1]_b[_cons] 7.7 [b2]_b[_cons] 8.5 [b3]_b[_cons] 8.8 ------------------------- min 7.7 [b1]_se[_cons] 5.1 [b2]_se[_cons] 5.0 [b3]_se[_cons] 4.7 ------------------------- min 4.7 e(rmse) 11.0 e(rss) 11.4 . . end of do-file