2.4.15 nlbegino


Menu Information

Analysis: Fitting: Nonlinear Implicit Curve Fit...

Brief Information

Start a nonlinear implicit curve fitting session

Additional Information

Minimum Origin Version Required: 9.0 SR0 (Pro Only)

X-Function not designed for Auto GetN Dialog.

Command Line Usage

  1. nlbegino iy:=1 func:=ellipse; //initialize fitting the active plot using ellipse function
  2. nlbegino iy:=(1,2) func:=circle nltree:=mytree;//initialize to fit data with column 1 as X and column 2 as Y with circle function
  3. nlbegino iy:=(1,2,3,4) func:=hyperbola weight:=1;//initialize to fit data with column 1 as X, column 2 as Y, column 3 as Y error and column 4 as X error with user-defined function "hypobola", this would require you to construct a fitting function named hyperbola under implicit category first

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input iy

Input

XYRange

<active>
The data to be fitted
Fitting Function Name func

Input

string

<unassigned>
The fitting function used to fit data
NLFit Tree nltree

Input/Output

TreeNode

nlt
Tree containing the information of fitting such as parameter values, standard error, etc.
Fitting Mode mode

Input

int

0
The method to treat the input data for fitting.

Option list:

  • auto:Auto
    The input dataset is fitted use the model
  • concat:Concatenate Fit
    All input datasets are concatenated and fitted as one curve.
  • global:Global Fit
    All datasets are fitted globally. This mode should be used when you want to fit one model to multiple datasets with shared parameters.
  • cons:Independent Fit - Consolidated Report
    All datasets are fitted independently. This mode should be used when you want to fit one model to multiple datasets without shared parameters and create the consolidated reports.
Dialog Theme theme

Input

string

<optional>
The theme is used to store the special settings that user often use.
Notation of Parameters pnotation

Input

int

0
Notation of parameters in the output tree.

Option list:

  • para:ParaName
    Use name of parameter as notation.
  • abbr:Abbreviation
    Use abbreviation of parameter as notation.
  • both:Both
    Use both name and abbreviation of parameter as notation.
Parameter Initialization init

Input

int

0
Specify the status of Parameter Initialization.

Option list:

  • auto:Auto
    Origin automatically decides whether to enable parameter initialization according to the FDF file of the fitting function.
  • enable:Enable
    Enable parameter initialization.
  • disable:Disable
    Disable parameter initialization.
Global Weight Method weight

Input

int

-1

Option list:

  • -1=auto
    Weight is Instrumental if error data are co-selected.
  • 0=none: No Weights
    No weight is used.
  • 1=ins:Instrumental (=1/ei^2)
    Use instrumental weight method.
  • 2=stat:Statistical (=1/yi)
    Use statistical weight method.
How to Initialize the NLFit Object option

Input

int

0

Option list:

  • init_all:Init All Parameters
    Initialize all parameters and then do the fitting with these parameters.
  • change_data:Only Change Data
    Keep the former settings and only change dataset, then do the fitting to the new dataset.


Description

Start a nonlinear implicit fitting session, including option settings and parameter initialization.

The nltree is a TreeNode variable, which can control many fitting settings and allows you to read fitting results such as the parameter values, standard error, etc.

For details please refer to this.

Note that only the fitting functions under the Implicit category in Fitting Function Organizer are available with this x-function.

Algorithm

The nonlinear implicit fitting uses the orthogonal distance regression (ODR) iteration algorithm.

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."

Examples

This example shows to fit an implicit ellipse function with X Y error.

string fn$=system.path.program$ + "Samples\Curve Fitting\ellipse.dat";//prepare data
newbook;
impasc fname:=fn$;//import data into new workbook 
nlbegino iy:=(1,2,4,3) func:=Ellipse weight:=1;//Start the implicit fit with x y instrumental error, column 4 is the y error and column 3 is the x error.
nlfit;
nlend 1 1;

The parameter control in nlbegino is similar to nlbegin, you could refer to more examples.

Related X-Functions

nlbegin nlfit nlend nlpara



Keywords:regression, NLFit