Watson's U2 statistic based permutation test for circular data
18 Sep 2013
19 Sep 2013)
Performs a permutation test based on Watson's U2 statistic for 2-sample testing of circular data.
% Computes the probability that two samples of circular data (angles) come
% from the same distribution, or from distributions with the same direction
% (null hypothesis), using a permutation test and Watson's U2 statistic.
% This function calls watsons_U2 to compute that statistic. The p values
% obtained with this code have been verified using the numerical examples
% 27.10 and 27.11 from Zar (1999).
% A1, A2: vectors containing angles (in degrees or radians, the unit does
% not matter)
% N: integer scalar containing the number of permutations to perform
% p: probability that the two samples come from the same
% U2_obs: observed value of Watson's U2 statistic
% U2_H0: distribution of Watson's U2 statistic under the null hypothesis
% Zar JH. Biostatistical Analysis. 4th ed., 1999.
% Chapter 27: Circular Distributions: Hypothesis Testing.
% Upper Saddle River, NJ: Prentice Hall.
% See also WATSONS_U2