Home > atmlab > circular > circ_axialmean.m

circ_axialmean

PURPOSE ^

SYNOPSIS ^

function [r mu] = circ_axialmean(alphas, m, dim)

DESCRIPTION ^

 mu = circ_axialmean(alpha, w)
   Computes the mean direction for circular data with axial 
   correction.

   Input:
     alpha    sample of angles in radians
     [m        axial correction (2,3,4,...)]
     [dim      statistic computed along this dimension, 1]

   Output:
     r        mean resultant length
     mu        mean direction

 PHB 7/6/2008

 References:
   Statistical analysis of circular data, N. I. Fisher
   Topics in circular statistics, S. R. Jammalamadaka et al. 
   Biostatistical Analysis, J. H. Zar

 Circular Statistics Toolbox for Matlab

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

circ_axialmean.m

SOURCE CODE ^

0001 function [r mu] = circ_axialmean(alphas, m, dim)
0002 %
0003 % mu = circ_axialmean(alpha, w)
0004 %   Computes the mean direction for circular data with axial
0005 %   correction.
0006 %
0007 %   Input:
0008 %     alpha    sample of angles in radians
0009 %     [m        axial correction (2,3,4,...)]
0010 %     [dim      statistic computed along this dimension, 1]
0011 %
0012 %   Output:
0013 %     r        mean resultant length
0014 %     mu        mean direction
0015 %
0016 % PHB 7/6/2008
0017 %
0018 % References:
0019 %   Statistical analysis of circular data, N. I. Fisher
0020 %   Topics in circular statistics, S. R. Jammalamadaka et al.
0021 %   Biostatistical Analysis, J. H. Zar
0022 %
0023 % Circular Statistics Toolbox for Matlab
0024 
0025 % By Philipp Berens, 2009
0026 % berens@tuebingen.mpg.de - www.kyb.mpg.de/~berens/circStat.html
0027 % Distributed under Open Source BSD License
0028 
0029 if nargin < 3
0030   dim = 1;
0031 end
0032 
0033 if nargin < 2 || isempty(m)
0034     m = 1;
0035 end
0036 
0037 zbarm = mean(exp(i*alphas*m),dim);
0038 
0039 r = abs(zbarm);
0040 mu = angle(zbarm)/m;
0041

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