CLsqFit:GetCovar
The GetCovar method returns the covariance between fit coefficients. The covariance measures the degree of relationship between the calculated coefficients. A lower value indicates greater significance in the independence between coefficient values.
| 
 nCovar = CLsqFit:GetCovar( nIndex1, nIndex2 ) nCovar = CLsqFit:GetCovar( nIndex1, nIndex2, nChannel ) nC1, nC2, nC3, nC4 = CLsqFit:GetCovar( nIndex1, nIndex2 )  | 
    nIndex1 and nIndex2 are the
coefficient indices. Both are numbers between 1 and GetNumCoefs.
    nCovar is the returned value of the
covariance.
    nChannel is an optional argument that
specifies the channel for multi-channel (RGB) data.
    nC1, nC2, nC3, and nC4 are the covariance values returned for
multi-channel data when no channel is specified.
This function returns the covariance between coefficients at two indices, nIndex1 and nIndex2. If multi-channel data has been enabled, then values are returned for all channels unless you specifically specify a channel. The errors of the coefficients can be obtained using GetCoefErr and the coefficients themselves can be obtained using GetCoef.
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 fits a 2x2 polynomial, then retrieves the covariance between coefficients at 1, 1 and at 2, 2.
| 
 | 
 -- 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  | 
| 
 | 
 -- fetch the index of the coefficient at 1, 1  | 
| 
 | 
 -- fetch the index of the coefficient at 2, 2  | 
| 
 | 
 -- fetch the covariance between 1,1 and 2,2  | 
| 
 | 
 -- list the covariance  | 
CLsqFit class, GetCoef, GetCoefErr, SetNumCoefs, GetPolyCoefIndex
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.