c this is from PP. 280 of IMSL stat. ** SUB RNLIN ** c The data may have been changed to Sam's data. integer ldr, nobs, nparm parameter (nobs=15, nparm=2, ldr=nparm) c integer ideriv,irank,nout real dfe, r(ldr,nparm), sse, theta (nparm) external exampl, rnlin,umach,wrrrn c data theta/60.0, -0.03/ c call umach (2, nout) c ideriv =0 call rnlin (exampl, nparm, ideriv ,theta, r, ldr, irank, def, & sse) write(nout,*) 'theta = ', theta write(nout,*) 'irank = ' , irank, 'def= ', ' sse = ', & sse call wrrrn ('R', nparm, nparm, r, ldr, 0) end subroutine exampl (nparm , theta, iopt,iobs, frq, wt,e, de, & iend) integer nparm, iopt, iobs, iend real theta(nparm),frq, wt,e, de(1) c integer nobs parameter (nobs=15) c real exp, xdata(nobs), ydata(nobs) c data ydata/54.0 , 50. , 45. , 37., 35. , 25. , 20. , 16., 18., % 13., 8., 11.0, 8.0, 4.0, 6.00/ data xdata/2.0, 5.0, 7.0, 10., 14.0, 19.0, 26.0, 31.0, 34.0, & 38.0, 45.0, 52.0, 53.0, 60., 65.0/ open(unit=6,file='imsl288.dat') c if ( iobs .le. nobs) then wt=1.0e0 frq=1.0e0 iend =0 write(6,110)xdata(iobs), ydata(iobs),e,iobs 110 format(3f10.4, 2x, i5) e = ydata(iobs) -theta(1)*exp(theta(2)*xdata(iobs)) else iend=1 end if return end