CStats:Kurtosis


The Kurtosis method computes the kurtosis 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.

Kurtosis measures the flatness of the sample distribution in comparison with a Guassian Normal population. A distribution with kurtosis = 0 has the degree of central peakness of a Gaussian normal distribution. Kurtosis > 0 indicates that the distribution is more centrally peaked than a Gaussian distribution, and vice versa. A uniform distribution has Kurtosis = –1.2.

Syntax

nKurtosis = CStats:Kurtosis( table )

nKurtosis = CStats:Kurtosis( CImage, )

nKurtosis = CStats:Kurtosis( CImage, CRect )

nKurtosis = CStats:Kurtosis( CArray )

nKurtosis = CStats:Kurtosis( CArray, CRect )

nKurtosis = CStats:Kurtosis( 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..

    nKurtosis is the kurtosis parameter of the data distribution. On failure, 0 is returned.

Examples

Suppose that CImage object I and CRect object R exist. The following script returns the kurtosis parameter for values inside a rectangle on the image:

S = CStats:new()

-- create a CStats object

nKurt = S:Kurtosis( I, R )

-- returns the kurtosis parameter

Printf("Kurtosis=%lg\n", nKurt )

-- list the result

The following script computes the kurtosis parameter for a table of numbers:

S = CStats:new()

-- create a CStats object

t = { 5, 6, 7, 8, 9, 10.5 }

-- create a table to measure

Printf("Kurtosis=%lg\n", S:Kurtosis(t) )

-- list the result

Related Topics

Mean

Skewness

CStats Class