/* nllsqt1.sas -- demonstration of nonlinear least squares */ /* Fuller example */ /* */ options ls = 80 ; * easier to read output ; data a ; infile '~/www/aug00/chap9/fulnls.dat' ; input y x ; run ; /* */ /* write out the data */ proc print data=a ; title 'nllsqt1 -- nonlinear least squares problem' ; title2 'Fuller example -- default method is Gauss-Newton' ; run ; /* */ /* nonlinear regression */ proc nlin data=a ; model y = th1 + th2*exp(-th3*x) ; * model gives mean function ; der.th1 = 1 ; * derivatives wrto parameters ; der.th2 = exp(-th3*x) ; der.th3 = -x * th2 * exp(-th3*x) ; parameters th1 = 140 /* initial values */ th2 = -85 th3 = 1.5 ; run ;