Code covered by the BSD License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

### Highlights from gkurtosis

Be the first to rate this file! 0 Downloads (last 30 days) File Size: 2.91 KB File ID: #38321 Version: 1.3

# gkurtosis

### Antonio Trujillo-Ortiz (view profile)

24 Sep 2012 (Updated )

Kurtosis of a grouped sample.

File Information
Description

In some scientific works, once the data have been gathered from a population of interest, it is often difficult to get a sense of what the data indicate when they are presented in an unorganized fashion.

Assembling the raw data into a meaningful form, such as a frequency distribution, makes the data easier to understand and interpret. It is in the context of frequency distributions that the importance of conveying in a succinct way numerical information contained in the data is encountered.

So, grouped data is data that has been organized into groups known as classes. The raw dataset can be organized by constructing a table showing the frequency distribution of the variable (whose values are given in the raw dataset). Such a frequency table is often referred to as grouped data.

Here, we developed a m-code to calculate the kurtosis and excess of kurtosis of a grouped data.

One can input the returns or modified vectors n and xout containing the frequency counts and the bin locations of the hist m-function, in a column form matrix.

GKURTOSIS(X,0) adjusts the kurtosis for bias (correction by small sample size). GKURTOSIS(X,1) is the same as GKURTOSIS(X), and does not adjust for bias.

Kurtosis calculation uses the formula,

g2 = m4/m2^2, do not adjusted for bias
g2 = g2 - 3, excess kurtosis do not adjusted for bias

G2 = ((N+1)*g2 - 3*(N-1))*(N-1)/((N-2)*(N-3)) + 3, adjusted for bias
G2 = ((N+1)*g2 - 3*(N-1))*(N-1)/((N-2)*(N-3)), excess kurtosis adjusted for bias

where:
m2 = second moment of the sample about its mean
m4 = fourth moment of the sample about its mean
N = sample size

Syntax: function y = gkurtosis(x,n)

Inputs:
x - data matrix (Size of matrix must be n-by-2; absolut frequency=column 1, class mark=column 2)
n - adjusted for bias = 0 (default), do not adjust for bias = 1

Outputs:
y - kurtosis and excess of kurtosis values in x

Required Products Statistics and Machine Learning Toolbox
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
 Please login to add a comment or rating.
Comments and Ratings (1)
26 Sep 2012 Antonio Trujillo-Ortiz

### Antonio Trujillo-Ortiz (view profile)

Bug was removed.

Comment only
Updates
24 Sep 2012 1.1

It was added an appropriate format to cite this file.

26 Sep 2012 1.3

Text was improved.

Contact us