CLsqFit Class Description
The CLsqFit class performs least squares analysis of sample data. This class uses the linear least squares method to fit up to 100 coefficients for 1 to 10 independent variables. Options include fitting single channel or RGB data, built-in or user-defined basis functions, iterative data rejection, point editing, and forcing coefficients to specified values.
Despite the power and versatility of this class, its user interface is remarkably simple. For example, the AddPt method adds data points to the sample; using various argument lists, the same method is used to specify 1 to 10 values of the independent variables as well as the observed value for either numeric data or RGB data.
Using Multiple Independent Variables
Rejecting Outliers from the Fit
Using CLsqFit with Image Pixels
Construction |
Object = new_lsqfit() Object = CLsqFit:new() |
Destruction |
Object:delete() |
This function is normally used to create a new CLsqFit object as an alternative to the class-based new method.
Creates a new instance of the CLsqFit class. |
Creates a new instance of the CLsqFit class. |
|
Deletes the instance of the CLsqFit object. |
Fits a polynomial to (x,y) where y = f(x) and returns a new CLsqFit object to access it. The data may also use weights. |
|
Fits a polynomial to (x,y,z) where z = f(x,y) and returns a new CLsqFit object to access it. The data may also use weights. |
Sets the number of coefficients and, optionally, the number of independent variables, or "basis dimensions". |
|
Returns the number of coefficients in total or for the specified basis dimension. |
|
Specifies the basis function. The options are an n-dimensional "polynomial" (the default), an n-dimensional "hyperplane", or the name of a user-specified function declared in a script. |
|
Returns the basis function that is selected. |
|
Returns the number of independent variables, or "basis dimensions". |
|
Sets the number of data channels to fit. The options are 1 (the default), 3, or 4. |
|
Returns the number of channels being fit. |
Computes the fit. |
|
Initializes the fit data by deleting all points that have been added. |
|
Enables (the default) or disables iterative data rejection. |
|
Forces a coefficient to a specified value and does not estimate it in the fit. |
|
Restores a forced coefficient to the pool of coefficients being fit. |
|
Returns the state of a coefficient (estimated or forced). |
|
Resets all forced coefficients so they all will be estimated by the fit. |
|
Returns the return code of the least squares fit. |
|
Returns an error message if the fit fails. |
|
Returns the channel number where the fit failed. |
Returns a coefficient value from the fit. |
|
Returns the error in the coefficient value from the fit. |
|
Returns a covariance from the fit covariance matrix. |
|
Returns the standard deviation of the fit. |
|
Evaluates the predicted value of a coordinate point using the fit coefficients. |
|
Returns the residual for a point used in the fit. |
|
Returns the mean value for the specified basis dimension. |
|
Returns the min and max values of the independent variable(s). |
|
Returns the min and max values of the observations. |
|
Returns the number of points added to the sample. |
|
Returns the number of points used in the fit. |
|
Returns the number of points rejected from the fit when data rejection is enabled. |
|
Returns the number of points that were manually deleted. |
|
Returns the index of a coefficient based on its dimensional index (used only for the default n-dimensional polynomial basis function). |
Adds a point to the sample data. The point is added at the next point index. |
|
Adds a point to the sample data with a point weight. The point is added at the next point index. |
|
Returns both the independent and dependent variables for a point. |
|
Returns the values of the independent variable for a point. |
|
Sets the values of the independent variables. |
|
Returns the observed value of a sample point. |
|
Sets the observed value of an existing point. |
|
Returns the weight of a point. |
|
Sets the weight of a point. |
|
Returns the status code of a sample point. This is a number 0, 1, or 2 for used, deleted, or rejected. It is useful when data rejection is enabled. |
|
Returns the status string of a sample point as "use", "rej", or "del" (used, deleted, or rejected). It is useful when data rejection is enabled. |
|
Returns an table containing all the point X (basis) values for one of the basis dimensions. |
|
Returns a table containing all the point Y (observed) values. |
|
Rreturns a table containing all the point weights. |
|
Sets the status of an existing data point to used, rejected, or deleted. |
|
Returns the index of a point based on a match to its values. |
|
Manually deletes a point from the fit. |
|
Undeletes a point that was deleted from the fit. |
Enables (the default) or disables iterative data rejection. |
|
Sets default values for data rejection parameters. |
|
Sets the high sigma value used for Rejecting Outliers having residuals above the fit. |
|
Returns the high sigma value used for Rejecting Outliers having residuals above the fit. |
|
Sets the low sigma value used for Rejecting Outliers having residuals below the fit. |
|
Returns the low sigma value used for Rejecting Outliers having residuals below the fit. |
|
Sets the number of cycles used for Rejecting Outliers from the fit. |
|
Returns the number of cycles used for Rejecting Outliers from the fit. |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.