CLsqFit:GetSigmaFit


The GetSigmaFit method returns the standard deviation of the fit. The value is adjusted for the number of free parameters and the point weights used in the fit.

Syntax

nStdDev = CLsqFit:GetSigmaFit()

bullet.gif    nStdDev is the returned value of the fit standard deviation.

Remarks

The standard deviation of the fit is a gross measurement of the precision of the fit to the sample data. You also can assess the precision of each calculated coefficient using the GetCoefErr method or determine the independence of individual coefficients using GetCovar to examine the covariance matrix.

Example

The following script fits a 2x2 polynomial, then retrieves the standard deviation of the fit.

L = new_lsqfit()

-- create a CLsqFit object

L:SetNumCoefs( {2.2} )

-- set 2x2 coefficients to fit a warped plane

L:AddPt( {3, 5}, 5.15 )

-- add a point with x = 3, y = 5, z = 5.15

-- add more points to the fit

 

L:Fit()

-- Fit the polynomial

sd = L:GetSigmaFit()

-- fetch the standard deviation of the fit

Printf( "StdDev= %lg\n", sd )

-- list the standard deviation

Related Topics

CLsqFit class, GetCoefErr, GetCovar


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.