15.5.8.6 Nonlinear Implicit Curve Fitting (Pro Only)FittingImplicit
Origin's NLFit tool supports implicit fitting using the Orthogonal Distance Regression (ODR) algorithm, including fitting with X and/or Y error data.
To fit your data with implicit fitting functions, you may use the builtin functions of nonlinear implicit curve fitting, or create your own implicit fitting functions.
Fit with the Implicit Functions
To fit with an implicit function,
 Select from top menu Analysis:Fitting:Nonlinear Implicit Curve Fit to open the dialog.
 Select a function under the Implicit category.
Notes: Implicit fit functions use Orthogonal Distance Regression.


Mini Tutorial:Fit for Ellipse
 Import the Ellipse.dat file as single ASCII, which can be found under \Samples\Curve Fitting
 Highlight column A and B, select "Analysis:Fitting:Nonlinear Implicit Curve Fitting" to open the NLFit dialog
 Choose "Ellipse" as the function type
 Go to "Data Selection", make sure "Use Each Range's Setting" is chosen for Weight
 In "Data Selection", expand the "Input" branch, and further expand "Range 1"
 Under branch "x", choose "Arbitrary Dataset" for Weight, and choose column C(Weight X) as the dataset
 Do the similar for "y", this time choose column D(Weight Y) as the dataset
 Click "Fit" to fit the data and generate report sheet

Implicit Fit with More Than Two Variables
Please note the following when you carry out implicit fit with more than 2 independent variables:
 It is required to have worksheet data as the input data, i.e. you cannot carry out the fitting from a data plot in this case.
 Only the data type Fitted Point for Input Data is supported for all variables. To modify this setting in the NLFit dialog, go to the Settings taband select Fitted Curves. Expand the Fitted Curves Plot branch set Data Type of variable to be Fitted Point for Input Data.
 It is not supported to generate a fitted curve automatically, however you could get the data for fitted curve in the report sheet.
Create a UserDefined Implicit Function for Fitting
To create your own implicit fitting function, you need to first open the Fitting Function Builder either by:
 Select Analysis:Fitting:Nonlinear Implicit Curve Fit to open the NLFit dialog.
 Select <New...> in the dropdown menu of Function.
or
Choose Tools:Fitting Function Builder or press F8.
When the Fitting Function Builder is open,
 Choose the Create a New Function radio button and click Next.
 Choose the Implicit radio button for Function Model.
or
 Select Tools:Fitting Function Organizer or press F9 to open the Fitting Function Organizer
 Create a new function under the Implicit category.
Note that you can only do implicit fitting with functions in the Implicit category, so you need to move any created implicit functions to the Implicit category in Fitting Function Organizer.
Refer to the Origin help file for how to define a userdefined fitting function.

This is a short tutorial showing how to create a userdefined implicit fitting function and fit data with it.
 Choose Tools:Fitting Function Organizer or press F9 to open the Fitting Function Organizer.
 Choose the Implicit category and click the New Function button.
 Type Hyperbolic as Function Name, set the Function Model to Implicit and Function Form as Equations.
 Type x,y in the Variables box, a,b,c,d,e in the Parameters box.
 In the Function Body, type
f=a*x^2+b*x*y+c*y^2+d*x+e*y1; Note that the value f is estimated as 0.
 Click Save to save the function and click OK to close the dialog.
 Prepare some test data following a hyperbolic trend and import into Origin. You can use the Simulate button in the Fitting Function Organizer to generate data with added noise.
 Set column A as x and column B as y.
 Select column A and B and choose Analysis:Fitting:Nonlinear Implicit Fitting to open the NLFit dialog.
 In the Function dropdown menu, choose Hyperbolic(User) and click Fit.

Note: Fitting with any User Defined function requires parameter initialization. A value of 1 for each parameter should be sufficient for a Hyperbolic function.

Fit Explicit Functions with ODR
The default iteration algorithm is LevenbergMarquardt (LM) for explicit fitting functions. It is also possible to use Orthogonal Distance Regression (ODR) algorithm for explicit functions. To do so:
 Select Analysis:Fitting:Nonlinear Curve Fit or press Ctrl+Y to open the NLFit dialog.
 After selecting a function, choose Orthogonal Distance Regression (Pro) in the dropdown menu of Iteration Algorithm.
Iteration Algorithm
ODR Algorithm
The ODR (Orthogonal Distance Regression) algorithm minimizes the residual sum of squares by adjusting both fitting parameters and values of the independent variable in the iterative process. The residual in ODR is not the difference between the observed value and the predicted value for the dependent variable, but the orthogonal distance from the data to the fitted curve.
Origin uses the ODR algorithm in ODRPACK95. ODR method can be used for both implicit functions and explicit functions.
For a 2D explict function , the ODR algorithm could be expressed as:
subject to the constraints:
where and are the user input weights of and , and are the residual of the corresponding and , and is the fitting parameter.
Origin uses the ODR algorithm in ODRPACK95.
For a 2D implicit function , the ODR algorithm could be expressed as:
subject to:
where and are the user input weights of and , and are the residual of the corresponding and , and is the fitting parameter.
LM Algorithm
LM(LevenbergMarquardt) algorithm minimizes the residual sum of squares by adjusting fitting parameters in the iterative process. The residual in LM is the difference between the observed value and the predicted value of the dependent variable. And the algorithm combines the GaussNewton method and the steepest descent method. It can be used only in explicit functions.
The LM algorithm works for most cases based on general Theory of Nonlinear Curve Fitting.
For a 2D explicit function , the LM algorithm could be expressed as:
where and are the weight and the residual of , respectively.
And the residual is calculated as:
Comparison between ODR and LM
To choose the ODR or LM algorithm for your fitting, you may refer to the following table for information:

Orthogonal Distance Regression

LevenbergMarquardt

Application

Both implicit and explicit functions

Only explicit functions

Weight

Support both x weight and y weight

Support only y weight

Residual Source

The orthogonal distance from the data to the fitted curve

The difference between the observed value and the predicted value

Iteration Process

Adjusting the values of fitting parameters and independent variables

Adjusting the values of fitting parameters

Reference
"J. W. Zwolak, P.T. Boggs, and L.T. Watson, ``Algorithm 869: ODRPACK95: A weighted orthogonal distance regression code with bound constraints, ACM Transactions on Mathematical Software Vol. 33, Issue 4, August 2007."
