/* nllsqt2.sas -- demonstration of nonlinear least squares */ /* Gallant example */ /* */ options ls = 80 ; * easier to read output ; data a ; infile '~/www/aug00/chap9/gallant.dat' ; input @4 y x1 x2 x3 ; run ; /* */ /* write out the data */ proc print data=a ; title 'nllsqt2 -- nonlinear least squares problem' ; title2 'Gallant example -- default method is Gauss-Newton' ; run ; /* */ /* nonlinear regression */ proc nlin data=a ; model y = th1*x1 + th2*x2 + th4*exp(th3*x3) ; * model gives mean function ; der.th1 = x1 ; * derivatives wrto parameters ; der.th2 = x2 ; der.th3 = x3 * th4 * exp(th3*x3) ; der.th4 = exp(th3*x3) ; parameters th1 = -.05 /* initial values */ th2 = 1.04 th3 = -1.20 th4 = -.53 ; run ;