* * Example 14.1, page 570 * Non-linear least squares * data(org=columns,unit=input) 1 12 fee asset 0.5200 0.5 0.5080 5.0 0.4840 10.0 0.4600 15.0 0.4398 20.0 0.4238 25.0 0.4115 30.0 0.4020 35.0 0.3944 40.0 0.3880 45.0 0.3825 55.0 0.3738 60.0 nonlin b1 b2 frml exgrowth = b1*exp(b2*asset) nlls(frml=exgrowth) fee * * Try again with different guess values * compute b1=.45,b2=.01 nlls(frml=exgrowth) fee * * Compute dy/dx at asset=20. The number in the book seems to be incorrect. * disp b2*b1*exp(b2*20) * * From Appendix 14A.3. Linearized regression. ystar and x1 in table 14.4 are * incorrect. (x1 clearly so, since it's supposed to be exp(positive number) for * all t, and thus has to be >1.0). The regression below is correct. * compute b1=.45,b2=.01 set ystar = fee-exgrowth set x1 = exp(b2*asset) set x2 = b1*asset*exp(b2*asset) linreg ystar # x1 x2 disp b1+%beta(1) b2+%beta(2)