Learn About Calculating the Kurtosis
This tutorial describes how to calculate the KurtosisCalculating the Kurtosis
In data statistics, kurtosis is a phrase used to indicate how heavy or light the tails of our data are. By heavy tails, we mean that our data might be flatter around the edges. By light tails, it is the opposite. A dataset might be largely flat across the board. One reason we care about this is because as data is distributed in different ways, it can cause problems in data analysis. Put simply, we use kurtosis to make sure the distribution of our data is fairly balanced.
While one might assume that the equations for kurtosis are standardized, in practice different statistical packages provide slightly different answers. In our case, we document the equations we used in MathML. All statistical packages provide similar answers and our equations match those used in the Apache Commons mathematical packages.
The kurtosis can be calculated by calling the helper action, Kurtosis() contained within the DataFrame's class. To do this, we will use our 'frame' object and call the function Kurtosis(). In this case we will be calculating the mean of the area of dry bean classifications. Here is a brief description on how Kurtosis() works.
Function | Description | Usage |
---|---|---|
dataFrameObject:Skew() | This action takes the column that you have passed and calculates the kurtosis of that column. Note that it can only calculate the kurtosis of one column at a time. | frame:Kurtosis() |
Here is some code on how to calculate the kurtosis:
//We need the DataFrame class to load in files for Data Science operations.
use Libraries.Compute.Statistics.DataFrame
//Create a DataFrame, which is essentially a table that understands
//more information about the data that is being loaded.
//Using the default loader is enough for our purposes
DataFrame frame
frame:Load("../Data/Miscellaneous/DryBeans.csv")
//Tell the frame we want the first column selected
frame:AddSelectedColumn(0)
output frame:Kurtosis()
Try it Yourself!
Press the blue run button to execute the code in the code editor. Press the red stop button to end the program. Your program will work when the console outputs "Build Successful!"
Congrats! We have just learned how to calulate the kurtosis! To view the whole file, we can click here.
End of Lesson
You have reached the end of the lesson for Descriptive Statistics. To view more tutorials, press the button below or you can go back to the previous lesson pages.