___ ____ ____ ____ ____ tm /__ / ____/ / ____/ ___/ / /___/ / /___/ 9.0 Copyright 1984-2005 Statistics/Data Analysis StataCorp 4905 Lakeway Drive College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 stata@stata.com 979-696-4601 (fax) 3-user Stata for Linux64 (network) perpetual license: Serial number: 999 Licensed to: Brian P. Poi, Ph.D. StataCorp LP Notes: 1. (-m# option or -set memory-) 1.00 MB allocated to data 2. Command line editing disabled 3. Stata running in batch mode running /home/bpp/bin/profile.do ... . 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) (obs = 16) Iteration 0: residual SS = 1.69e+09 Iteration 1: residual SS = 1.22e+09 Iteration 2: residual SS = 9.63e+08 Iteration 3: residual SS = 1.35e+08 Iteration 4: residual SS = 1.25e+08 Iteration 5: residual SS = 1.05e+07 Iteration 6: residual SS = 5533.259 Iteration 7: residual SS = 87.9459 Iteration 8: residual SS = 87.94586 Iteration 9: residual SS = 87.94586 Source | SS df MS Number of obs = 16 -------------+------------------------------ F( 3, 13) = 1.92e+08 Model | 3.8908e+09 3 1.2969e+09 Prob > F = 0.0000 Residual | 87.9458552 13 6.76506578 R-squared = 1.0000 -------------+------------------------------ Adj R-squared = 1.0000 Total | 3.8908e+09 16 243172772 Root MSE = 2.600974 Res. dev. = 72.67215 ------------------------------------------------------------------------------ y | Coef. 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 ------------------------------------------------------------------------------ (SEs, P values, CIs, and correlations are asymptotic approximations) . . assert N == e(N) . assert df_r == e(df_r) . assert df_m == e(df_m) . . lrecomp _b[b1] b1 _b[b2] b2 _b[b3] b3 () /* > */ _se[b1] seb1 _se[b2] seb2 _se[b3] seb3 () /* > */ e(rmse) rmse e(rss) rss _b[b1] 7.7 _b[b2] 8.5 _b[b3] 8.8 ------------------------- min 7.7 _se[b1] 5.1 _se[b2] 5.0 _se[b3] 4.7 ------------------------- min 4.7 e(rmse) 11.0 e(rss) 11.4 . . end of do-file