Home > atmlab > circular > circ_kurtosis.m

circ_kurtosis

PURPOSE ^

[k k0] = circ_kurtosis(alpha,w,dim)

SYNOPSIS ^

function [k k0] = circ_kurtosis(alpha, w, dim)

DESCRIPTION ^

 [k k0] = circ_kurtosis(alpha,w,dim)
   Calculates a measure of angular kurtosis.

   Input:
     alpha     sample of angles
     [w        weightings in case of binned angle data]
     [dim      statistic computed along this dimension, 1]

     If dim argument is specified, all other optional arguments can be
     left empty: circ_kurtosis(alpha, [], dim)

   Output:
     k         kurtosis (from Pewsey)
     k0        kurtosis (from Fisher)

   References:
     Pewsey, Metrika, 2004
     Fisher, Circular Statistics, p. 34

 Circular Statistics Toolbox for Matlab

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

circ_kurtosis.m

SOURCE CODE ^

0001 function [k k0] = circ_kurtosis(alpha, w, dim)
0002 
0003 % [k k0] = circ_kurtosis(alpha,w,dim)
0004 %   Calculates a measure of angular kurtosis.
0005 %
0006 %   Input:
0007 %     alpha     sample of angles
0008 %     [w        weightings in case of binned angle data]
0009 %     [dim      statistic computed along this dimension, 1]
0010 %
0011 %     If dim argument is specified, all other optional arguments can be
0012 %     left empty: circ_kurtosis(alpha, [], dim)
0013 %
0014 %   Output:
0015 %     k         kurtosis (from Pewsey)
0016 %     k0        kurtosis (from Fisher)
0017 %
0018 %   References:
0019 %     Pewsey, Metrika, 2004
0020 %     Fisher, Circular Statistics, p. 34
0021 %
0022 % Circular Statistics Toolbox for Matlab
0023 
0024 % By Philipp Berens, 2009
0025 % berens@tuebingen.mpg.de
0026 
0027 if nargin < 3
0028   dim = 1;
0029 end
0030 
0031 if nargin < 2 || isempty(w)
0032   % if no specific weighting has been specified
0033   % assume no binning has taken place
0034     w = ones(size(alpha));
0035 else
0036   if size(w,2) ~= size(alpha,2) || size(w,1) ~= size(alpha,1) 
0037     error('Input dimensions do not match');
0038   end 
0039 end
0040 
0041 % compute mean direction
0042 R = circ_r(alpha,w,[],dim);
0043 theta = circ_mean(alpha,w,dim);
0044 [foo rho2] = circ_moment(alpha,w,2,true,dim);
0045 [foo foo2 mu2] = circ_moment(alpha,w,2,false,dim);
0046 
0047 % compute skewness
0048 theta2 = repmat(theta, size(alpha)./size(theta));
0049 k = sum(w.*(cos(2*(circ_dist(alpha,theta2)))),dim)./sum(w,dim);
0050 k0 = (rho2.*cos(circ_dist(mu2,2*theta))-R.^4)./(1-R).^2;    % (formula 2.30)
0051

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005