Geoscience Reference
In-Depth Information
same distribution, against the alternative that they come from distributions
that have the same median and shapes but dif erent dispersions (Ansari and
Bradley 1960, Lepage 1971).
h e example below demonstrates the Mann-Whitney and Ansari-Bradley
tests on two synthetic records that contain signii cant changes in the central
tendency (mean, median, mode) and dispersion (range, variance, quantiles)
in the middle of the time series (Fig. 5.18). h e time axis runs from 0.1 to 500
kyr at sampling intervals of 0.1 kyr. At 250 kyr the mean of the log-normal
distributed data changes abruptly from 1.0 to 1.5 and the standard deviation
changes from 0.5 to 1.3 (Fig. 5.18 a).
clear
rng(0)
t = 0.1 : 0.1 : 500;
y1 = 0.1 * random('logn',1, 0.5, 1, length(t),1);
y2 = 0.1 * random('logn',1.5, 1.3, 1, length(t),1);
y = y1(1:length(t)/2);
y(length(t)/2+1:length(t)) = y2(length(t)/2+1:length(t));
We i rst use a Mann-Whitney test with paired sliding windows of three
dif erent lengths, in order to detect any abrupt change in the mean. We
choose sliding window lengths of 300, 500, and 1,000 data points, i.e., in each
step we apply the Mann-Whitney test to two samples of 150 data points, two
samples of 250 data points, and two samples of 500 data points. Note that
when running a Mann-Whitney test on dif erent sets of data the length of
the window needs to be adjusted to the length of the time series, and to the
required accuracy with which the transition in the mean is to be identii ed.
w = [300 500 1000];
We use the function ranksum introduced in Section 3.11 to perform the
Mann-Whitney test.
for j = 1:length(w)
na = w(j);
nb = w(j);
for i = w(j)/2+1:length(y)-w(j)/2
[p,h] = ranksum(y(i-w(j)/2:i-1),y(i+1:i+w(j)/2));
mwreal(j,i) = p;
end
mwreal(j,1:w(j)/2) = mwreal(j,w(j)/2+1) * ones(1,w(j)/2);
mwreal(j,length(y)-w(j)/2+1:length(y)) = ...
mwreal(j,length(y)-w(j)/2) * ones(1,w(j)/2);
end
We then display the results.
subplot(2,1,1)
Search WWH ::




Custom Search