CStats:Skewness
The Skewness method computes the skewness parameter for a data sample. The sample may be a Lua table or a class object of type CImage, CArray, or CMatrix. For CImage and CMatrix objects, an optional CRect object can be used to define the points used in the calculation.
Skewness measures the assymmetry of a sample distribution. A distribution with Skewness=0 is symmetric. Skewness > 0 indicates that the distribution has a larger tail in the positive direction.
nSkewness = CStats:Skewness( table ) nSkewness = CStats:Skewness( CImage, ) nSkewness = CStats:Skewness( CImage, CRect ) nSkewness = CStats:Skewness( CArray ) nSkewness = CStats:Skewness( CArray, CRect ) nSkewness = CStats:Skewness( CMatrix ) where |
table is a lua table containing the data.
CImage, CArray, and CMatrix are class objects containing the data to measure,
CRect is a CRect rectangle object that defines the region to measure.
nSkewness is the skewness of the data distribution. On failure, 0 is returned.
The following script computes the skewness parameter for a table of numbers:
|
-- create a CStats object |
|
-- create a table to measure |
|
-- returns the Skewness parameter |
|
-- list the result |
The following script computes the skewness parameter for a table of numbers:
|
-- create a CStats object |
|
-- create a table to measure |
|
-- list the result |