7017
|
1 ## Copyright (C) 2006, 2007 John W. Eaton |
7016
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
|
18 |
5590
|
19 %% Automatically generated from DejaGNU files |
|
20 |
|
21 %% test/octave.test/stats/mean-1.m |
|
22 %!test |
|
23 %! x = -10:10; |
|
24 %! y = x'; |
|
25 %! z = [y, y+10]; |
|
26 %! assert(mean (x) == 0 && mean (y) == 0 && mean (z) == [0, 10]); |
|
27 |
|
28 %% test/octave.test/stats/mean-2.m |
|
29 %!error mean (); |
|
30 |
|
31 %% test/octave.test/stats/mean-3.m |
|
32 %!error mean (1, 2, 3); |
|
33 |
|
34 %% test/octave.test/stats/median-1.m |
|
35 %!test |
|
36 %! x = [1, 2, 3, 4, 5, 6]; |
|
37 %! x2 = x'; |
|
38 %! y = [1, 2, 3, 4, 5, 6, 7]; |
|
39 %! y2 = y'; |
|
40 %! |
|
41 %! assert((median (x) == median (x2) && median (x) == 3.5 |
|
42 %! && median (y) == median (y2) && median (y) == 4 |
|
43 %! && median ([x2, 2*x2]) == [3.5, 7] |
|
44 %! && median ([y2, 3*y2]) == [4, 12])); |
|
45 |
|
46 %% test/octave.test/stats/median-2.m |
|
47 %!error median (); |
|
48 |
|
49 %% test/octave.test/stats/median-3.m |
|
50 %!error median (1, 2, 3); |
|
51 |
|
52 %% test/octave.test/stats/std-1.m |
|
53 %!test |
|
54 %! x = ones (10, 2); |
|
55 %! y = [1, 3]; |
|
56 %! assert(std (x) == [0, 0] && abs (std (y) - sqrt (2)) < sqrt (eps)); |
|
57 |
|
58 %% test/octave.test/stats/std-2.m |
|
59 %!error std (); |
|
60 |
|
61 %% test/octave.test/stats/std-3.m |
|
62 %!error std (1, 2, 3, 4); |
|
63 |
|
64 %% test/octave.test/stats/cov-1.m |
|
65 %!test |
|
66 %! x = rand (10); |
|
67 %! cx1 = cov (x); |
|
68 %! cx2 = cov (x, x); |
|
69 %! assert(size (cx1) == [10, 10] && size (cx2) == [10, 10] && cx1 == cx2); |
|
70 |
|
71 %% test/octave.test/stats/cov-2.m |
|
72 %!error cov (); |
|
73 |
|
74 %% test/octave.test/stats/cov-3.m |
|
75 %!error cov (1, 2, 3); |
|
76 |
|
77 %% test/octave.test/stats/corrcoef-1.m |
|
78 %!test |
|
79 %! x = rand (10); |
|
80 %! cc1 = corrcoef (x); |
|
81 %! cc2 = corrcoef (x, x); |
|
82 %! assert((size (cc1) == [10, 10] && size (cc2) == [10, 10] |
|
83 %! && abs (cc1 - cc2) < sqrt (eps))); |
|
84 |
|
85 %% test/octave.test/stats/corrcoef-2.m |
|
86 %!error corrcoef (); |
|
87 |
|
88 %% test/octave.test/stats/corrcoef-3.m |
|
89 %!error corrcoef (1, 2, 3); |
|
90 |
|
91 %% test/octave.test/stats/kurtosis-1.m |
|
92 %!test |
|
93 %! x = [-1; 0; 0; 0; 1]; |
|
94 %! y = [x, 2*x]; |
|
95 %! assert(all (abs (kurtosis (y) - [-1.4, -1.4]) < sqrt (eps))); |
|
96 |
|
97 %% test/octave.test/stats/kurtosis-2.m |
|
98 %!error kurtosis (); |
|
99 |
|
100 %% test/octave.test/stats/kurtosis-3.m |
|
101 %!error kurtosis (1, 2, 3); |
|
102 |
|
103 %% test/octave.test/stats/mahalanobis-2.m |
|
104 %!error mahalanobis (); |
|
105 |
|
106 %% test/octave.test/stats/mahalanobis-3.m |
|
107 %!error mahalanobis (1, 2, 3); |
|
108 |
|
109 %% test/octave.test/stats/skewness-2.m |
|
110 %!error skewness (); |
|
111 |
|
112 %% test/octave.test/stats/skewness-3.m |
|
113 %!error skewness (1, 2, 3); |
|
114 |