CLsqFit:GetCoefErr
The GetCoefErr method returns the statistical error, or uncertainty, in the value of a fit coefficient.
nValue = CLsqFit:GetCoefErr( nIndex ) nValue = CLsqFit:GetCoefErr( nIndex, nChannel ) nV1, nV2, nV3, nV4 = CLsqFit:GetCoefErr( nIndex ) |
nIndex is a number between 1 and GetNumCoefs.
nValue is the returned value of the coefficient error.
nChannel is an optional argument that specifies the channel for multi-channel (RGB) data.
nV1, nV2, nV3, and nV4 are the error values returned for multi-channel data when no channel is specified.
This function returns the coefficient error at the specified index. If multi-channel data has been enabled, then values are returned for all channels unless you specifically specify a channel. The coefficient values can be obtained using GetCoer and the covariance between coefficients can be obtained using GetCovar.
If using the built-in n-dimensional polynomial basis function with n > 1, then the index of the coefficient must be determined by calculating it from the polynomial dimensions or by using GetPolyCoefIndex.
The following script retrieves the error in the constant valued coefficient at index 1,1 after doing a 2x2 polynomial fit. The n-dimensional polynomial is selected by default and no other basis function is specified using SetBasisFunc. As with all sample scripts, this script is very wordy for for purposes of clarity and the statements near the end could be more tightly coded.
|
-- create a CLsqFit object |
|
-- set 2x2 coefficients to fit a warped plane |
|
-- add a point with x = 3, y = 5, z = 5.15 |
-- add more points to the fit |
|
|
-- Fit the polynomial |
|
-- select coefficient at 1, 1 |
|
-- fetch the index of the coefficient at i, j |
|
|
|
-- list the statistical error in the coefficient |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.