-
Notifications
You must be signed in to change notification settings - Fork 0
/
Quick Test
100 lines (64 loc) · 2.84 KB
/
Quick Test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
This is the test script of the codes used in this project
Why should data be random?
The simplest random sample allows all the units in the population to have an equal chance of being selected
**Bartels Test of Randomness
H0: Randomness
H1: Not random data
Results:
> w<-read.csv("G:/Gazvin/Azmoon/week.csv",header=TRUE)
> x<-read.csv("G:/Gazvin//Azmoon/fortnight.csv",header=TRUE)
> bartels.test(w$Q) for weekly data
Bartels Test - Two sided
data: w$Q
Standardized Bartels Statistic = -47.746, RVN Ratio = 0.15954,
p-value < 2.2e-16
> bartels.test(x$Q) for fortnight data
Bartels Test - Two sided
data: x$Q
Standardized Bartels Statistic = -31.912, RVN Ratio = 0.26035,
p-value < 2.2e-16
Both weekly and fortnight data are not random (We reject the null hypothesis)
#------------------------------------------------------------------------------------------------------------
Run test
H0: The distribution of the two stramflow series are the same
H1: The distribution of the two stream flow series are not the same
Results:
Runs Test - Two sided
data: w$Q for weekly data
Standardized Runs Statistic = -43.489, p-value < 2.2e-16
> runs.test(x$Q) for fortnight data
Runs Test - Two sided
data: x$Q
Standardized Runs Statistic = -28.194, p-value < 2.2e-16
We found out that the distribution of two stream flow series in both weekly and fortnight are not the same.
#--------------------------------------------------------------------------------------------------------------------
Pettitt test for homogenity test in time series
H0: The T variables follow one or more distributions that have the same location parameter.
H1: The variables have not the same distribution
Results for weekly data they have not the same distribution because of the null hypothesis rejection
Pettitt's test for single change-point detection
data: W
U* = 3816, p-value < 2.2e-16
alternative hypothesis: two.sided
sample estimates:
probable change point at time K
1
-----------------
Results for fortnight they have not the same distribution because of the null hypothesis rejection
Pettitt's test for single change-point detection
data: W
U* = 1970, p-value < 2.2e-16
alternative hypothesis: two.sided
sample estimates:
probable change point at time K
1
#------------------------------------------------------------------------------------------
Mann kendall
H0: There is trend
H0: There is no trend
Reults of mankendall test for weekly stream flow data there is no trend
tau = -0.18, 2-sided pvalue =< 2.22e-16
Reults of mankendall test for fortnight stream flow data there is no trend
tau = -0.18, 2-sided pvalue =< 2.22e-16
#-----------------------------------------------------------------------------------------------
The results of Weekly and fortnight CEEMDAN are all in the main repository (with their plots)