To calculate the skewness of a vector in Matlab, we use the skewness
function from the Statistics and Machine Learning Toolbox. The skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. A positive skewness indicates a longer or fatter tail on the right-hand side of the distribution, while a negative skewness indicates a longer or fatter tail on the left-hand side of the distribution.
Here's the syntax of the skewness
function in Matlab:
main.m16 chars2 lines
where X
is the input vector and S
is the sample skewness of X
.
Example:
main.m54 chars4 lines
Output:
main.m2 chars2 lines
In this example, the input vector X
has a skewness of zero, which indicates it is a symmetric distribution.
gistlibby LogSnag