___ ____ ____ ____ ____ (R) /__ / ____/ / ____/ ___/ / /___/ / /___/ 13.0 Copyright 1985-2013 StataCorp LP 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 compute server perpetual license: Serial number: 999 Licensed to: Brian Poi StataCorp LP Notes: 1. Command line editing disabled 2. Stata running in batch mode running /home/bpp/bin/profile.do ... . do lanczos3.do . /* NIST StRD benchmark from http://www.nist.gov/itl/div898/strd/ > > Nonlinear Regression > > Difficulty=Lower Exponential k=6 N=24 Generated > > Dataset Name: Lanczos3 (Lanczos3.dat) > > Procedure: Nonlinear Least Squares Regression > > Description: These data are taken from an example discussed in > Lanczos (1956). The data were generated to 5-digits > of accuracy using > f(x) = 0.0951*exp(-x) + 0.8607*exp(-3*x) > + 1.5576*exp(-5*x). > > Reference: Lanczos, C. (1956). > Applied Analysis. > Englewood Cliffs, NJ: Prentice Hall, pp. 272-280. > > Data: 1 Response (y) > 1 Predictor (x) > 24 Observations > Lower Level of Difficulty > Generated Data > > Model: Exponential Class > 6 Parameters (b1 to b6) > > y = b1*exp(-b2*x) + b3*exp(-b4*x) + b5*exp(-b6*x) + e > > > Starting values Certified Values > > Start 1 Start 2 Parameter Standard Deviation > b1 = 1.2 0.5 8.6816414977E-02 1.7197908859E-02 > b2 = 0.3 0.7 9.5498101505E-01 9.7041624475E-02 > b3 = 5.6 3.6 8.4400777463E-01 4.1488663282E-02 > b4 = 5.5 4.2 2.9515951832E+00 1.0766312506E-01 > b5 = 6.5 4 1.5825685901E+00 5.8371576281E-02 > b6 = 7.6 6.3 4.9863565084E+00 3.4436403035E-02 > > Residual Sum of Squares: 1.6117193594E-08 > Residual Standard Deviation: 2.9923229172E-05 > Degrees of Freedom: 18 > Number of Observations: 24 > */ . . clear . . scalar N = 24 . scalar df_r = 18 . scalar df_m = 6 . . scalar rss = 1.6117193594E-08 . scalar rmse = 2.9923229172E-05 . . scalar b1 = 8.6816414977E-02 . scalar seb1 = 1.7197908859E-02 . scalar b2 = 9.5498101505E-01 . scalar seb2 = 9.7041624475E-02 . scalar b3 = 8.4400777463E-01 . scalar seb3 = 4.1488663282E-02 . scalar b4 = 2.9515951832E+00 . scalar seb4 = 1.0766312506E-01 . scalar b5 = 1.5825685901E+00 . scalar seb5 = 5.8371576281E-02 . scalar b6 = 4.9863565084E+00 . scalar seb6 = 3.4436403035E-02 . . qui input double (y x) . . nl ( y = {b1}*exp(-{b2}*x) + {b3}*exp(-{b4}*x) + {b5}*exp(-{b6}*x) ), /// > init(b1 1.2 b2 0.3 b3 5.6 b4 5.5 b5 6.5 b6 7.6) eps(1e-10) (obs = 24) Iteration 0: residual SS = 12.13419 Iteration 1: residual SS = .0169777 Iteration 2: residual SS = .0000493 Iteration 3: residual SS = .0000438 Iteration 4: residual SS = .0000428 Iteration 5: residual SS = .0000383 Iteration 6: residual SS = 4.71e-06 Iteration 7: residual SS = 3.21e-06 Iteration 8: residual SS = 3.01e-06 Iteration 9: residual SS = 1.56e-06 Iteration 10: residual SS = 1.61e-08 Iteration 11: residual SS = 1.61e-08 Iteration 12: residual SS = 1.61e-08 Iteration 13: residual SS = 1.61e-08 Iteration 14: residual SS = 1.61e-08 Iteration 15: residual SS = 1.61e-08 Iteration 16: residual SS = 1.61e-08 Iteration 17: residual SS = 1.61e-08 Source | SS df MS -------------+------------------------------ Number of obs = 24 Model | 19.2783499 6 3.21305831 R-squared = 1.0000 Residual | 1.6117e-08 18 8.9540e-10 Adj R-squared = 1.0000 -------------+------------------------------ Root MSE = .0000299 Total | 19.2783499 24 .803264579 Res. dev. = -438.8053 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1 | .0868164 .0171979 5.05 0.000 .0506849 .1229479 /b2 | .954981 .0970417 9.84 0.000 .7511039 1.158858 /b3 | .8440078 .0414887 20.34 0.000 .7568433 .9311723 /b4 | 2.951595 .1076632 27.42 0.000 2.725403 3.177787 /b5 | 1.582569 .0583716 27.11 0.000 1.459934 1.705203 /b6 | 4.986356 .0344364 144.80 0.000 4.914008 5.058705 ------------------------------------------------------------------------------ . . 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 () /* > */ [b1]_se[_cons] seb1 [b2]_se[_cons] seb2 [b3]_se[_cons] seb3 /* > */ [b4]_se[_cons] seb4 [b5]_se[_cons] seb5 [b6]_se[_cons] seb6 () /* > */ e(rmse) rmse e(rss) rss [b1]_b[_cons] 7.2 [b2]_b[_cons] 7.5 [b3]_b[_cons] 7.9 [b4]_b[_cons] 8.0 [b5]_b[_cons] 8.0 [b6]_b[_cons] 8.7 ------------------------- min 7.2 [b1]_se[_cons] 6.5 [b2]_se[_cons] 6.0 [b3]_se[_cons] 6.3 [b4]_se[_cons] 6.0 [b5]_se[_cons] 6.3 [b6]_se[_cons] 6.5 ------------------------- min 6.0 e(rmse) 11.4 e(rss) 10.6 . end of do-file