% % Written by: % -- % John L. Weatherwax 2008-02-20 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- % the sample sizes: theNs = 10.^[ 1:7 ]; for ni=1:length(theNs), n = theNs(ni); x = rand(1,n); mu = mean(x); % the numerator and denominator of gamma_1: num = mean((x-mu).^3); den = mean((x-mu).^2); gam1 = num/(den^(3/2)); % the numerator and denominator of gamma_2: num = mean((x-mu).^4); %den = mean((x-mu).^2); gam2 = num/(den^2); fprintf('empirical coefficient of skewness=%10.5f and kurtosis=%10.5f with %10d samples\n',gam1,gam2,n); end