___ ____ ____ ____ ____ ® /__ / ____/ / ____/ 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 gauss1.do . /* NIST/ITL StRD > > Nonlinear Regression > > Difficulty=Lower Exponential k=8 N=250 Generated > > Dataset Name: Gauss1 (Gauss1.dat) > > Procedure: Nonlinear Least Squares Regression > > Description: The data are two well-separated 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 > Lower 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 = 97.0 94.0 9.8778210871E+01 5.7527312730E-01 > b2 = 0.009 0.0105 1.0497276517E-02 1.1406289017E-04 > b3 = 100.0 99.0 1.0048990633E+02 5.8831775752E-01 > b4 = 65.0 63.0 6.7481111276E+01 1.0460593412E-01 > b5 = 20.0 25.0 2.3129773360E+01 1.7439951146E-01 > b6 = 70.0 71.0 7.1994503004E+01 6.2622793913E-01 > b7 = 178.0 180.0 1.7899805021E+02 1.2436988217E-01 > b8 = 16.5 20.0 1.8389389025E+01 2.0134312832E-01 > > Residual Sum of Squares: 1.3158222432E+03 > Residual Standard Deviation: 2.3317980180E+00 > Degrees of Freedom: 242 > Number of Observations: 250 > */ . . clear . . scalar N = 250 . scalar df_r = 242 . scalar df_m = 8 . . scalar rss = 1.3158222432E+03 . scalar rmse = 2.3317980180E+00 . . scalar b1 = 9.8778210871E+01 . scalar seb1 = 5.7527312730E-01 . scalar b2 = 1.0497276517E-02 . scalar seb2 = 1.1406289017E-04 . scalar b3 = 1.0048990633E+02 . scalar seb3 = 5.8831775752E-01 . scalar b4 = 6.7481111276E+01 . scalar seb4 = 1.0460593412E-01 . scalar b5 = 2.3129773360E+01 . scalar seb5 = 1.7439951146E-01 . scalar b6 = 7.1994503004E+01 . scalar seb6 = 6.2622793913E-01 . scalar b7 = 1.7899805021E+02 . scalar seb7 = 1.2436988217E-01 . scalar b8 = 1.8389389025E+01 . scalar seb8 = 2.0134312832E-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 97.0 b2 0.009 b3 100.0 b4 65.0 b5 20.0 > b6 70.0 b7 178.0 b8 16.5) eps(1e-10) ; Iteration 0: Residual SS = 1474.664 Iteration 1: Residual SS = 1315.939 Iteration 2: Residual SS = 1315.822 Iteration 3: Residual SS = 1315.822 Iteration 4: Residual SS = 1315.822 Iteration 5: Residual SS = 1315.822 Iteration 6: Residual SS = 1315.822 Source | SS df MS -------------+---------------------------------- Number of obs = 250 Model | 1347863.8 8 168482.971 R-squared = 0.9990 Residual | 1315.8222 242 5.437282 Adj R-squared = 0.9990 -------------+---------------------------------- Root MSE = 2.331798 Total | 1349179.6 250 5396.71837 Res. dev. = 1124.658 ------------------------------------------------------------------------------ y | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- /b1 | 98.77821 .5752732 171.71 0.000 97.64503 99.91139 /b2 | .0104973 .0001141 92.03 0.000 .0102726 .010722 /b3 | 100.4899 .5883178 170.81 0.000 99.33103 101.6488 /b4 | 67.48111 .1046059 645.10 0.000 67.27506 67.68717 /b5 | 23.12977 .1743995 132.63 0.000 22.78624 23.47331 /b6 | 71.9945 .6262279 114.97 0.000 70.76095 73.22806 /b7 | 178.9981 .1243699 1439.24 0.000 178.7531 179.243 /b8 | 18.38939 .2013432 91.33 0.000 17.99278 18.786 ------------------------------------------------------------------------------ . #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] 9.2 [b2]_b[_cons] 8.5 [b3]_b[_cons] 9.4 [b4]_b[_cons] 10.0 [b5]_b[_cons] 8.9 [b6]_b[_cons] 9.0 [b7]_b[_cons] 11.5 [b8]_b[_cons] 8.9 ------------------------- min 8.5 [b1]_se[_cons] 7.1 [b2]_se[_cons] 6.3 [b3]_se[_cons] 7.9 [b4]_se[_cons] 9.1 [b5]_se[_cons] 6.7 [b6]_se[_cons] 6.9 [b7]_se[_cons] 8.5 [b8]_se[_cons] 6.7 ------------------------- min 6.3 e(rmse) 11.4 e(rss) 11.6 . end of do-file