___ ____ ____ ____ ____ (R) /__ / ____/ / ____/ ___/ / /___/ / /___/ 15.1 Copyright 1985-2017 StataCorp LLC Statistics/Data Analysis StataCorp 4905 Lakeway Drive Special Edition College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 stata@stata.com 979-696-4601 (fax) Single-user Stata perpetual license: Serial number: 15 Licensed to: Kreshna Gopal 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 5000; see help set_maxvar. running /home/krg/bin/profile.do ... Compile number 629 . do gauss3.do . /* NIST/ITL StRD > Dataset Name: Gauss3 (Gauss3.dat) > > File Format: ASCII > Starting Values (lines 41 to 48) > Certified Values (lines 41 to 53) > Data (lines 61 to 310) > > Procedure: Nonlinear Least Squares Regression > > Description: The data are two strongly-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 > Average 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 = 94.9 96.0 9.8940368970E+01 5.3005192833E-01 > b2 = 0.009 0.0096 1.0945879335E-02 1.2554058911E-04 > b3 = 90.1 80.0 1.0069553078E+02 8.1256587317E-01 > b4 = 113.0 110.0 1.1163619459E+02 3.5317859757E-01 > b5 = 20.0 25.0 2.3300500029E+01 3.6584783023E-01 > b6 = 73.8 74.0 7.3705031418E+01 1.2091239082E+00 > b7 = 140.0 139.0 1.4776164251E+02 4.0488183351E-01 > b8 = 20.0 25.0 1.9668221230E+01 3.7806634336E-01 > > Residual Sum of Squares: 1.2444846360E+03 > Residual Standard Deviation: 2.2677077625E+00 > Degrees of Freedom: 242 > Number of Observations: 250 > */ . . clear . . scalar N = 250 . scalar df_r = 242 . scalar df_m = 8 . . scalar rss = 1.2444846360E+03 . scalar rmse = 2.2677077625E+00 . . scalar b1 = 9.8940368970E+01 . scalar seb1 = 5.3005192833E-01 . scalar b2 = 1.0945879335E-02 . scalar seb2 = 1.2554058911E-04 . scalar b3 = 1.0069553078E+02 . scalar seb3 = 8.1256587317E-01 . scalar b4 = 1.1163619459E+02 . scalar seb4 = 3.5317859757E-01 . scalar b5 = 2.3300500029E+01 . scalar seb5 = 3.6584783023E-01 . scalar b6 = 7.3705031418E+01 . scalar seb6 = 1.2091239082E+00 . scalar b7 = 1.4776164251E+02 . scalar seb7 = 4.0488183351E-01 . scalar b8 = 1.9668221230E+01 . scalar seb8 = 3.7806634336E-01 . . qui input double(y x) . . #delimit ; delimiter now ; . nl ( y = {b1}*exp( -{b2}*x ) + {b3}*exp( -(x-{b4})^2 / {b5}^2 ) > + {b6}*exp( -(x-{b7})^2 / {b8}^2 ) ) , > init(b1 94.9 b2 0.009 b3 90.1 b4 113.0 b5 20.0 b6 73.8 b7 140.0 b8 20 > ) > eps(1e-10); (obs = 250) Iteration 0: residual SS = 4278.011 Iteration 1: residual SS = 1476.725 Iteration 2: residual SS = 1245.232 Iteration 3: residual SS = 1244.485 Iteration 4: residual SS = 1244.485 Iteration 5: residual SS = 1244.485 Iteration 6: residual SS = 1244.485 Iteration 7: residual SS = 1244.485 Iteration 8: residual SS = 1244.485 Source | SS df MS -------------+---------------------------------- Number of obs = 250 Model | 1316109.3 8 164513.657 R-squared = 0.9991 Residual | 1244.4846 242 5.1424985 Adj R-squared = 0.9990 -------------+---------------------------------- Root MSE = 2.267708 Total | 1317353.7 250 5269.41496 Res. dev. = 1110.723 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1 | 98.94037 .530052 186.66 0.000 97.89626 99.98447 /b2 | .0109459 .0001255 87.19 0.000 .0106986 .0111932 /b3 | 100.6955 .8125678 123.92 0.000 99.09492 102.2961 /b4 | 111.6362 .3531785 316.09 0.000 110.9405 112.3319 /b5 | 23.3005 .3658472 63.69 0.000 22.57985 24.02115 /b6 | 73.70503 1.20912 60.96 0.000 71.32329 76.08677 /b7 | 147.7616 .4048817 364.95 0.000 146.9641 148.5592 /b8 | 19.66822 .3780672 52.02 0.000 18.9235 20.41294 ------------------------------------------------------------------------------ . #delimit cr delimiter now 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 [b1]_b[_cons] 10.1 [b2]_b[_cons] 9.1 [b3]_b[_cons] 9.0 [b4]_b[_cons] 9.0 [b5]_b[_cons] 8.2 [b6]_b[_cons] 8.3 [b7]_b[_cons] 9.1 [b8]_b[_cons] 8.4 ------------------------- min 8.2 [b1]_se[_cons] 6.9 [b2]_se[_cons] 6.3 [b3]_se[_cons] 5.6 [b4]_se[_cons] 6.6 [b5]_se[_cons] 5.8 [b6]_se[_cons] 5.5 [b7]_se[_cons] 6.5 [b8]_se[_cons] 5.6 ------------------------- min 5.5 e(rmse) 10.8 e(rss) 11.0 . . end of do-file