# 2.4.11 funcRank

Analysis:Fitting:Rank Models

## Brief Information

Fit and rank multiple fitting functions

Minimum Origin Version Required: 9.1 SR0

This feature is OriginPro only

## Command Line Usage

 1.funcRank funsel.category:=Exponential funsel.funclist:={20, 21, 22, 23, 24, 25} adjrsq:=1 ssr:=1 rcs:=1 stat:=1;//Fit the active data with selected functions in the Exponential category 

## Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Data Form form

Input

int

0
Specify the input data form.
• 0: XY Data
• 1: XYZ Data
Input Data data

Input

XYRange

<active>
Input data range. If the input data form is XY Data, you can select X, Y and Y error columns using the triangle button at the right of edit box. Optionally, just select the Y column and the XF will find the X column automatically.
Input Data iz

Input

XYZRange

<active>
Input data range. If the input data form is XYZ Data, you can select X, Y and Z columns using the triangle button at the right of edit box. Optionally, just select the Z column and the XF will find the X,Y column automatically.
Functions Selection funsel

Input

TreeNode

<unassigned>
Functions selection in a specific category. Use the tree variable funsel.category to determine the category and funsel.funclist to determine which functions to use in this category. See the command line usage example for details.
• Both categories and functions are listed in the Fitting Function Organizer (Tools: Fitting Function Organizer).
• Within a given category, functions are sorted alphanumerically and assigned an index number corresponding to sort order, starting from 0 (e.g. under category = Exponential, Asymptotic1 = 0, BoxLucas1=1, and so on).
Max. Number of Iterations iter

Input

int

100
Specify the max number of iterations performed.

Input

int

0
Check to output adjusted R-square in the result report sheet.
Residual Sum of Squares ssr

Input

int

0
Check to output residual sum of squares in the result report sheet.
Reduced Chi-Sqr rcs

Input

int

0
Check to output reduced Chi-square in the result report sheet.
Fitting Outcome String stat

Input

int

0
Check this item to return a detailed fitting procedure report. It may help to determine why a fit procedure failed.
Report Data rdRes

Output

ReportData

[<input>]<new>
The result work sheet with data stored in it. You can make a recalculation simply by clicking on the lock in the upper-left corner of the report sheet and selecting the change parameters item.

## Description

You can fit and rank multiple functions in a specified category for one dataset.

## Goodness of Fit

• AIC
Recommended criteria for nonlinear curve fitting. The model with smaller AIC value is more likely to be correct
• BIC
Recommended criteria for nonlinear curve fitting. The model with smaller BIC value is more likely to be correct
The model with smaller Adj R-Square value is more likely to be correct. But please note that usually Adj R-square is a recommended criteria for linear or multiple linear models instead of nonlinear curve models.
• Residual Sum of Squares
If there are two independent variables in the regression model, the model with smaller residual sum of squares is more likely to be correct.
• Reduced Chi-Sqr
You can refer to this FAQ page to understand the criteria well.

## Examples

1. Create an empty workbook and select Data: Import from File: Single ASCII to import the file Exponential Decay.dat under <Origin EXE Folder>\Samples\Curve Fitting.
2. Highlight column A and B and select Analysis:Fitting:Rank Models to open the funcRank dialog.
3. Select Exponential for Category, and then select the functions ExpDec1, ExpDec2, ExpDec3, ExpDecay1, ExpDecay2 and ExpDecay3 in the Function List (hold CTRL key and click for multi-selection).
4. Select all four check boxes under the Fitting Results Options branch and click OK to generate the result.
5. You can see the comparison and ranking of all selected functions in the RankResults1 report sheet.

## Related X-Functions

Keywords:compare models