Would you tell me the code for Fisher Pearson skewness?
2 views (last 30 days)
David Goodmanson on 21 Sep 2022
Edited: David Goodmanson on 21 Sep 2022
y = rand(1,100); % some data
m = mean(y);
n = numel(y);
scalc = (sum((y-m).^3)/n)/var(y,1)^(3/2)
s = skewness(y)
scalc agrees with Matlab's skewness function.
You have to be careful using the variance here (or the standard deviation). The var default is
but for variance as used in Matlab's skewness function, you divide by n instead of (n-1). That means using var(y,1) rather than the default var(y). Same idea for std if that were used.