Use the genfit function to find fitting parameters for a general nonlinear fit.
1. Define a data set.
2. Construct the function to be fed to the genfit function. Enter the fitting function, and then add the derivatives with respect to each parameter. For the derivatives, use the exp function instead of e.
The parameters must be specified as elements in a vector of parameters, using the index operator.
3. Provide guess values.
4. Call the genfit function.
5. Plot the data set and the general nonlinear fit.
6. Use function corr to check the correlation between vy and GNfit.
The fit is perfect, as is confirmed by the above result.
Reference
The data for this example is drawn from Lanczos, C., Applied Analysis, Prentice Hall, 1956, pages 272-280, as documented in the NIST Statistical Reference Dataset Archive, http://www.itl.nist.gov/div898/strd/