Start a nonlinear fitting session for multiple independent/dependent variables
Minimum Origin Version Required: 8.1 SR0
nlbeginr irng:=2 func:=gauss nltree:=tt option:=change_data;
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input | irng |
Input Range |
|
Specify the data to be fitted. |
Fitting Function Name | func |
Input string |
|
Specify the fitting function name. |
NLFit Tree | nltree |
Input/Output TreeNode |
|
The tree that contains the information of fitting such as parameter values, standard error, etc. For more details, please refer to here. |
Fitting Mode | mode |
Input int |
|
Specify the method to treat the input data for fitting.
Option list:
|
Dialog Theme | theme |
Input string |
|
Specify a theme. The settings saved in it will be loaded to customize the fitting. |
Notation of Parameters | pnotation |
Input int |
|
Specify the notation of parameters in the output tree.
Option list:
|
Parameter Initialization | init |
Input int |
|
Specify the status of parameter initialization.
Option list:
|
How to Initialize the NLFit Object | option |
Input int |
|
Specify how to initialize the NLFit Object.
Option list:
|
This X-Function is used to start a nonlinear fitting session. Different from the nlbegin X-Function, whose input is XYRange, you can fit multiple independent/dependent variables function by nlbeginr. For example, the input can be XXYYYY, XYYY, XXXXY, etc.
This example uses nlbeginr to fit with a built-in GaussianLorentz function, which is a combination of the Gaussian and Lorentz functions, input data is (x, y1, y2), sharing y0 and xc:
newbook; string fname$ = system.path.program$ + "Samples\Curve Fitting\Lorentzian.dat"; impasc; // Specify the input range, which follows // the independent/dependent order in FDF nlbeginr (1,3,4) GaussianLorentz tt; // Perform fitting nlfit; // Output results tt.y0=; tt.xc=; tt.A1=; tt.A2=; tt.w1=; tt.w2=; // End the fitting session nlend;
Fitted parameters are shown as follows:
Parameter | y0 | xc | A1 | A2 | w1 | w2 |
---|---|---|---|---|---|---|
Value | -2.18829 | 25.01942 | 141.39931 | 95.83519 | 10.02691 | 1.92878 |
You can also see this tutorial.
This example uses nlbeginr to fit with a built-in HillBurk function, which is a combination of the Hill and Burk functions, input data is (x1, x2, v1, v2):
newbook; string fname$ = system.path.program$ + "Samples\Curve Fitting\Enzyme2.dat"; impasc; wks.col3.type=4; // Specify the input range, which follows // the independent/dependent order in FDF (x1, x2, v1, v2) nlbeginr (1,3,2,4) HillBurk tt; // Perform fitting nlfit; // Output results tt.Vm1=; tt.Km1=; tt.Vm2=; tt.Km2=; // End the fitting session nlend;
Fitted parameters are shown as follows:
Parameter | Vm1 | Km1 | Vm2 | Km2 |
---|---|---|---|---|
Value | 2.11846 | 1.66487 | 2.22927 | 4.65260 |
nlfit, nlend, nlgui, nlpara, nlfn, nlbegin, nlbeginz, nlbeginm
Keywords:regression, NLFit