statistics.h

Go to the documentation of this file.
1 /*************************************************************************
2 ALGLIB 3.11.0 (source code generated 2017-05-11)
3 Copyright (c) Sergey Bochkanov (ALGLIB project).
4 
5 >>> SOURCE LICENSE >>>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation (www.fsf.org); either version 2 of the
9 License, or (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 A copy of the GNU General Public License is available at
17 http://www.fsf.org/licensing/licenses
18 >>> END OF LICENSE >>>
19 *************************************************************************/
20 #ifndef _statistics_pkg_h
21 #define _statistics_pkg_h
22 #include "ap.h"
23 #include "alglibinternal.h"
24 #include "linalg.h"
25 #include "specialfunctions.h"
26 #include "alglibmisc.h"
27 
29 //
30 // THIS SECTION CONTAINS COMPUTATIONAL CORE DECLARATIONS (DATATYPES)
31 //
33 namespace alglib_impl
34 {
35 
36 }
37 
39 //
40 // THIS SECTION CONTAINS C++ INTERFACE
41 //
43 namespace alglib
44 {
45 
46 
47 /*************************************************************************
48 Calculation of the distribution moments: mean, variance, skewness, kurtosis.
49 
50 INPUT PARAMETERS:
51  X - sample
52  N - N>=0, sample size:
53  * if given, only leading N elements of X are processed
54  * if not given, automatically determined from size of X
55 
56 OUTPUT PARAMETERS
57  Mean - mean.
58  Variance- variance.
59  Skewness- skewness (if variance<>0; zero otherwise).
60  Kurtosis- kurtosis (if variance<>0; zero otherwise).
61 
62 NOTE: variance is calculated by dividing sum of squares by N-1, not N.
63 
64  -- ALGLIB --
65  Copyright 06.09.2006 by Bochkanov Sergey
66 *************************************************************************/
67 void samplemoments(const real_1d_array &x, const ae_int_t n, double &mean, double &variance, double &skewness, double &kurtosis);
68 void samplemoments(const real_1d_array &x, double &mean, double &variance, double &skewness, double &kurtosis);
69 
70 
71 /*************************************************************************
72 Calculation of the mean.
73 
74 INPUT PARAMETERS:
75  X - sample
76  N - N>=0, sample size:
77  * if given, only leading N elements of X are processed
78  * if not given, automatically determined from size of X
79 
80 NOTE:
81 
82 This function return result which calculated by 'SampleMoments' function
83 and stored at 'Mean' variable.
84 
85 
86  -- ALGLIB --
87  Copyright 06.09.2006 by Bochkanov Sergey
88 *************************************************************************/
89 double samplemean(const real_1d_array &x, const ae_int_t n);
90 double samplemean(const real_1d_array &x);
91 
92 
93 /*************************************************************************
94 Calculation of the variance.
95 
96 INPUT PARAMETERS:
97  X - sample
98  N - N>=0, sample size:
99  * if given, only leading N elements of X are processed
100  * if not given, automatically determined from size of X
101 
102 NOTE:
103 
104 This function return result which calculated by 'SampleMoments' function
105 and stored at 'Variance' variable.
106 
107 
108  -- ALGLIB --
109  Copyright 06.09.2006 by Bochkanov Sergey
110 *************************************************************************/
111 double samplevariance(const real_1d_array &x, const ae_int_t n);
112 double samplevariance(const real_1d_array &x);
113 
114 
115 /*************************************************************************
116 Calculation of the skewness.
117 
118 INPUT PARAMETERS:
119  X - sample
120  N - N>=0, sample size:
121  * if given, only leading N elements of X are processed
122  * if not given, automatically determined from size of X
123 
124 NOTE:
125 
126 This function return result which calculated by 'SampleMoments' function
127 and stored at 'Skewness' variable.
128 
129 
130  -- ALGLIB --
131  Copyright 06.09.2006 by Bochkanov Sergey
132 *************************************************************************/
133 double sampleskewness(const real_1d_array &x, const ae_int_t n);
134 double sampleskewness(const real_1d_array &x);
135 
136 
137 /*************************************************************************
138 Calculation of the kurtosis.
139 
140 INPUT PARAMETERS:
141  X - sample
142  N - N>=0, sample size:
143  * if given, only leading N elements of X are processed
144  * if not given, automatically determined from size of X
145 
146 NOTE:
147 
148 This function return result which calculated by 'SampleMoments' function
149 and stored at 'Kurtosis' variable.
150 
151 
152  -- ALGLIB --
153  Copyright 06.09.2006 by Bochkanov Sergey
154 *************************************************************************/
155 double samplekurtosis(const real_1d_array &x, const ae_int_t n);
156 double samplekurtosis(const real_1d_array &x);
157 
158 
159 /*************************************************************************
160 ADev
161 
162 Input parameters:
163  X - sample
164  N - N>=0, sample size:
165  * if given, only leading N elements of X are processed
166  * if not given, automatically determined from size of X
167 
168 Output parameters:
169  ADev- ADev
170 
171  -- ALGLIB --
172  Copyright 06.09.2006 by Bochkanov Sergey
173 *************************************************************************/
174 void sampleadev(const real_1d_array &x, const ae_int_t n, double &adev);
175 void sampleadev(const real_1d_array &x, double &adev);
176 
177 
178 /*************************************************************************
179 Median calculation.
180 
181 Input parameters:
182  X - sample (array indexes: [0..N-1])
183  N - N>=0, sample size:
184  * if given, only leading N elements of X are processed
185  * if not given, automatically determined from size of X
186 
187 Output parameters:
188  Median
189 
190  -- ALGLIB --
191  Copyright 06.09.2006 by Bochkanov Sergey
192 *************************************************************************/
193 void samplemedian(const real_1d_array &x, const ae_int_t n, double &median);
194 void samplemedian(const real_1d_array &x, double &median);
195 
196 
197 /*************************************************************************
198 Percentile calculation.
199 
200 Input parameters:
201  X - sample (array indexes: [0..N-1])
202  N - N>=0, sample size:
203  * if given, only leading N elements of X are processed
204  * if not given, automatically determined from size of X
205  P - percentile (0<=P<=1)
206 
207 Output parameters:
208  V - percentile
209 
210  -- ALGLIB --
211  Copyright 01.03.2008 by Bochkanov Sergey
212 *************************************************************************/
213 void samplepercentile(const real_1d_array &x, const ae_int_t n, const double p, double &v);
214 void samplepercentile(const real_1d_array &x, const double p, double &v);
215 
216 
217 /*************************************************************************
218 2-sample covariance
219 
220 Input parameters:
221  X - sample 1 (array indexes: [0..N-1])
222  Y - sample 2 (array indexes: [0..N-1])
223  N - N>=0, sample size:
224  * if given, only N leading elements of X/Y are processed
225  * if not given, automatically determined from input sizes
226 
227 Result:
228  covariance (zero for N=0 or N=1)
229 
230  -- ALGLIB --
231  Copyright 28.10.2010 by Bochkanov Sergey
232 *************************************************************************/
233 double cov2(const real_1d_array &x, const real_1d_array &y, const ae_int_t n);
234 double cov2(const real_1d_array &x, const real_1d_array &y);
235 
236 
237 /*************************************************************************
238 Pearson product-moment correlation coefficient
239 
240 Input parameters:
241  X - sample 1 (array indexes: [0..N-1])
242  Y - sample 2 (array indexes: [0..N-1])
243  N - N>=0, sample size:
244  * if given, only N leading elements of X/Y are processed
245  * if not given, automatically determined from input sizes
246 
247 Result:
248  Pearson product-moment correlation coefficient
249  (zero for N=0 or N=1)
250 
251  -- ALGLIB --
252  Copyright 28.10.2010 by Bochkanov Sergey
253 *************************************************************************/
254 double pearsoncorr2(const real_1d_array &x, const real_1d_array &y, const ae_int_t n);
255 double pearsoncorr2(const real_1d_array &x, const real_1d_array &y);
256 
257 
258 /*************************************************************************
259 Spearman's rank correlation coefficient
260 
261 Input parameters:
262  X - sample 1 (array indexes: [0..N-1])
263  Y - sample 2 (array indexes: [0..N-1])
264  N - N>=0, sample size:
265  * if given, only N leading elements of X/Y are processed
266  * if not given, automatically determined from input sizes
267 
268 Result:
269  Spearman's rank correlation coefficient
270  (zero for N=0 or N=1)
271 
272  -- ALGLIB --
273  Copyright 09.04.2007 by Bochkanov Sergey
274 *************************************************************************/
275 double spearmancorr2(const real_1d_array &x, const real_1d_array &y, const ae_int_t n);
276 double spearmancorr2(const real_1d_array &x, const real_1d_array &y);
277 
278 
279 /*************************************************************************
280 Covariance matrix
281 
282 SMP EDITION OF ALGLIB:
283 
284  ! This function can utilize multicore capabilities of your system. In
285  ! order to do this you have to call version with "smp_" prefix, which
286  ! indicates that multicore code will be used.
287  !
288  ! This note is given for users of SMP edition; if you use GPL edition,
289  ! or commercial edition of ALGLIB without SMP support, you still will
290  ! be able to call smp-version of this function, but all computations
291  ! will be done serially.
292  !
293  ! We recommend you to carefully read ALGLIB Reference Manual, section
294  ! called 'SMP support', before using parallel version of this function.
295  !
296  ! You should remember that starting/stopping worker thread always have
297  ! non-zero cost. Although multicore version is pretty efficient on
298  ! large problems, we do not recommend you to use it on small problems -
299  ! with covariance matrices smaller than 128*128.
300 
301 INPUT PARAMETERS:
302  X - array[N,M], sample matrix:
303  * J-th column corresponds to J-th variable
304  * I-th row corresponds to I-th observation
305  N - N>=0, number of observations:
306  * if given, only leading N rows of X are used
307  * if not given, automatically determined from input size
308  M - M>0, number of variables:
309  * if given, only leading M columns of X are used
310  * if not given, automatically determined from input size
311 
312 OUTPUT PARAMETERS:
313  C - array[M,M], covariance matrix (zero if N=0 or N=1)
314 
315  -- ALGLIB --
316  Copyright 28.10.2010 by Bochkanov Sergey
317 *************************************************************************/
318 void covm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c);
319 void smp_covm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c);
320 void covm(const real_2d_array &x, real_2d_array &c);
322 
323 
324 /*************************************************************************
325 Pearson product-moment correlation matrix
326 
327 SMP EDITION OF ALGLIB:
328 
329  ! This function can utilize multicore capabilities of your system. In
330  ! order to do this you have to call version with "smp_" prefix, which
331  ! indicates that multicore code will be used.
332  !
333  ! This note is given for users of SMP edition; if you use GPL edition,
334  ! or commercial edition of ALGLIB without SMP support, you still will
335  ! be able to call smp-version of this function, but all computations
336  ! will be done serially.
337  !
338  ! We recommend you to carefully read ALGLIB Reference Manual, section
339  ! called 'SMP support', before using parallel version of this function.
340  !
341  ! You should remember that starting/stopping worker thread always have
342  ! non-zero cost. Although multicore version is pretty efficient on
343  ! large problems, we do not recommend you to use it on small problems -
344  ! with correlation matrices smaller than 128*128.
345 
346 INPUT PARAMETERS:
347  X - array[N,M], sample matrix:
348  * J-th column corresponds to J-th variable
349  * I-th row corresponds to I-th observation
350  N - N>=0, number of observations:
351  * if given, only leading N rows of X are used
352  * if not given, automatically determined from input size
353  M - M>0, number of variables:
354  * if given, only leading M columns of X are used
355  * if not given, automatically determined from input size
356 
357 OUTPUT PARAMETERS:
358  C - array[M,M], correlation matrix (zero if N=0 or N=1)
359 
360  -- ALGLIB --
361  Copyright 28.10.2010 by Bochkanov Sergey
362 *************************************************************************/
363 void pearsoncorrm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c);
364 void smp_pearsoncorrm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c);
367 
368 
369 /*************************************************************************
370 Spearman's rank correlation matrix
371 
372 SMP EDITION OF ALGLIB:
373 
374  ! This function can utilize multicore capabilities of your system. In
375  ! order to do this you have to call version with "smp_" prefix, which
376  ! indicates that multicore code will be used.
377  !
378  ! This note is given for users of SMP edition; if you use GPL edition,
379  ! or commercial edition of ALGLIB without SMP support, you still will
380  ! be able to call smp-version of this function, but all computations
381  ! will be done serially.
382  !
383  ! We recommend you to carefully read ALGLIB Reference Manual, section
384  ! called 'SMP support', before using parallel version of this function.
385  !
386  ! You should remember that starting/stopping worker thread always have
387  ! non-zero cost. Although multicore version is pretty efficient on
388  ! large problems, we do not recommend you to use it on small problems -
389  ! with correlation matrices smaller than 128*128.
390 
391 INPUT PARAMETERS:
392  X - array[N,M], sample matrix:
393  * J-th column corresponds to J-th variable
394  * I-th row corresponds to I-th observation
395  N - N>=0, number of observations:
396  * if given, only leading N rows of X are used
397  * if not given, automatically determined from input size
398  M - M>0, number of variables:
399  * if given, only leading M columns of X are used
400  * if not given, automatically determined from input size
401 
402 OUTPUT PARAMETERS:
403  C - array[M,M], correlation matrix (zero if N=0 or N=1)
404 
405  -- ALGLIB --
406  Copyright 28.10.2010 by Bochkanov Sergey
407 *************************************************************************/
408 void spearmancorrm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c);
409 void smp_spearmancorrm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c);
412 
413 
414 /*************************************************************************
415 Cross-covariance matrix
416 
417 SMP EDITION OF ALGLIB:
418 
419  ! This function can utilize multicore capabilities of your system. In
420  ! order to do this you have to call version with "smp_" prefix, which
421  ! indicates that multicore code will be used.
422  !
423  ! This note is given for users of SMP edition; if you use GPL edition,
424  ! or commercial edition of ALGLIB without SMP support, you still will
425  ! be able to call smp-version of this function, but all computations
426  ! will be done serially.
427  !
428  ! We recommend you to carefully read ALGLIB Reference Manual, section
429  ! called 'SMP support', before using parallel version of this function.
430  !
431  ! You should remember that starting/stopping worker thread always have
432  ! non-zero cost. Although multicore version is pretty efficient on
433  ! large problems, we do not recommend you to use it on small problems -
434  ! with covariance matrices smaller than 128*128.
435 
436 INPUT PARAMETERS:
437  X - array[N,M1], sample matrix:
438  * J-th column corresponds to J-th variable
439  * I-th row corresponds to I-th observation
440  Y - array[N,M2], sample matrix:
441  * J-th column corresponds to J-th variable
442  * I-th row corresponds to I-th observation
443  N - N>=0, number of observations:
444  * if given, only leading N rows of X/Y are used
445  * if not given, automatically determined from input sizes
446  M1 - M1>0, number of variables in X:
447  * if given, only leading M1 columns of X are used
448  * if not given, automatically determined from input size
449  M2 - M2>0, number of variables in Y:
450  * if given, only leading M1 columns of X are used
451  * if not given, automatically determined from input size
452 
453 OUTPUT PARAMETERS:
454  C - array[M1,M2], cross-covariance matrix (zero if N=0 or N=1)
455 
456  -- ALGLIB --
457  Copyright 28.10.2010 by Bochkanov Sergey
458 *************************************************************************/
459 void covm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c);
460 void smp_covm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c);
461 void covm2(const real_2d_array &x, const real_2d_array &y, real_2d_array &c);
462 void smp_covm2(const real_2d_array &x, const real_2d_array &y, real_2d_array &c);
463 
464 
465 /*************************************************************************
466 Pearson product-moment cross-correlation matrix
467 
468 SMP EDITION OF ALGLIB:
469 
470  ! This function can utilize multicore capabilities of your system. In
471  ! order to do this you have to call version with "smp_" prefix, which
472  ! indicates that multicore code will be used.
473  !
474  ! This note is given for users of SMP edition; if you use GPL edition,
475  ! or commercial edition of ALGLIB without SMP support, you still will
476  ! be able to call smp-version of this function, but all computations
477  ! will be done serially.
478  !
479  ! We recommend you to carefully read ALGLIB Reference Manual, section
480  ! called 'SMP support', before using parallel version of this function.
481  !
482  ! You should remember that starting/stopping worker thread always have
483  ! non-zero cost. Although multicore version is pretty efficient on
484  ! large problems, we do not recommend you to use it on small problems -
485  ! with correlation matrices smaller than 128*128.
486 
487 INPUT PARAMETERS:
488  X - array[N,M1], sample matrix:
489  * J-th column corresponds to J-th variable
490  * I-th row corresponds to I-th observation
491  Y - array[N,M2], sample matrix:
492  * J-th column corresponds to J-th variable
493  * I-th row corresponds to I-th observation
494  N - N>=0, number of observations:
495  * if given, only leading N rows of X/Y are used
496  * if not given, automatically determined from input sizes
497  M1 - M1>0, number of variables in X:
498  * if given, only leading M1 columns of X are used
499  * if not given, automatically determined from input size
500  M2 - M2>0, number of variables in Y:
501  * if given, only leading M1 columns of X are used
502  * if not given, automatically determined from input size
503 
504 OUTPUT PARAMETERS:
505  C - array[M1,M2], cross-correlation matrix (zero if N=0 or N=1)
506 
507  -- ALGLIB --
508  Copyright 28.10.2010 by Bochkanov Sergey
509 *************************************************************************/
510 void pearsoncorrm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c);
511 void smp_pearsoncorrm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c);
514 
515 
516 /*************************************************************************
517 Spearman's rank cross-correlation matrix
518 
519 SMP EDITION OF ALGLIB:
520 
521  ! This function can utilize multicore capabilities of your system. In
522  ! order to do this you have to call version with "smp_" prefix, which
523  ! indicates that multicore code will be used.
524  !
525  ! This note is given for users of SMP edition; if you use GPL edition,
526  ! or commercial edition of ALGLIB without SMP support, you still will
527  ! be able to call smp-version of this function, but all computations
528  ! will be done serially.
529  !
530  ! We recommend you to carefully read ALGLIB Reference Manual, section
531  ! called 'SMP support', before using parallel version of this function.
532  !
533  ! You should remember that starting/stopping worker thread always have
534  ! non-zero cost. Although multicore version is pretty efficient on
535  ! large problems, we do not recommend you to use it on small problems -
536  ! with correlation matrices smaller than 128*128.
537 
538 INPUT PARAMETERS:
539  X - array[N,M1], sample matrix:
540  * J-th column corresponds to J-th variable
541  * I-th row corresponds to I-th observation
542  Y - array[N,M2], sample matrix:
543  * J-th column corresponds to J-th variable
544  * I-th row corresponds to I-th observation
545  N - N>=0, number of observations:
546  * if given, only leading N rows of X/Y are used
547  * if not given, automatically determined from input sizes
548  M1 - M1>0, number of variables in X:
549  * if given, only leading M1 columns of X are used
550  * if not given, automatically determined from input size
551  M2 - M2>0, number of variables in Y:
552  * if given, only leading M1 columns of X are used
553  * if not given, automatically determined from input size
554 
555 OUTPUT PARAMETERS:
556  C - array[M1,M2], cross-correlation matrix (zero if N=0 or N=1)
557 
558  -- ALGLIB --
559  Copyright 28.10.2010 by Bochkanov Sergey
560 *************************************************************************/
561 void spearmancorrm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c);
562 void smp_spearmancorrm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c);
565 
566 
567 /*************************************************************************
568 This function replaces data in XY by their ranks:
569 * XY is processed row-by-row
570 * rows are processed separately
571 * tied data are correctly handled (tied ranks are calculated)
572 * ranking starts from 0, ends at NFeatures-1
573 * sum of within-row values is equal to (NFeatures-1)*NFeatures/2
574 
575 SMP EDITION OF ALGLIB:
576 
577  ! This function can utilize multicore capabilities of your system. In
578  ! order to do this you have to call version with "smp_" prefix, which
579  ! indicates that multicore code will be used.
580  !
581  ! This note is given for users of SMP edition; if you use GPL edition,
582  ! or commercial edition of ALGLIB without SMP support, you still will
583  ! be able to call smp-version of this function, but all computations
584  ! will be done serially.
585  !
586  ! We recommend you to carefully read ALGLIB Reference Manual, section
587  ! called 'SMP support', before using parallel version of this function.
588  !
589  ! You should remember that starting/stopping worker thread always have
590  ! non-zero cost. Although multicore version is pretty efficient on
591  ! large problems, we do not recommend you to use it on small problems -
592  ! ones where expected operations count is less than 100.000
593 
594 INPUT PARAMETERS:
595  XY - array[NPoints,NFeatures], dataset
596  NPoints - number of points
597  NFeatures- number of features
598 
599 OUTPUT PARAMETERS:
600  XY - data are replaced by their within-row ranks;
601  ranking starts from 0, ends at NFeatures-1
602 
603  -- ALGLIB --
604  Copyright 18.04.2013 by Bochkanov Sergey
605 *************************************************************************/
606 void rankdata(const real_2d_array &xy, const ae_int_t npoints, const ae_int_t nfeatures);
607 void smp_rankdata(const real_2d_array &xy, const ae_int_t npoints, const ae_int_t nfeatures);
610 
611 
612 /*************************************************************************
613 This function replaces data in XY by their CENTERED ranks:
614 * XY is processed row-by-row
615 * rows are processed separately
616 * tied data are correctly handled (tied ranks are calculated)
617 * centered ranks are just usual ranks, but centered in such way that sum
618  of within-row values is equal to 0.0.
619 * centering is performed by subtracting mean from each row, i.e it changes
620  mean value, but does NOT change higher moments
621 
622 SMP EDITION OF ALGLIB:
623 
624  ! This function can utilize multicore capabilities of your system. In
625  ! order to do this you have to call version with "smp_" prefix, which
626  ! indicates that multicore code will be used.
627  !
628  ! This note is given for users of SMP edition; if you use GPL edition,
629  ! or commercial edition of ALGLIB without SMP support, you still will
630  ! be able to call smp-version of this function, but all computations
631  ! will be done serially.
632  !
633  ! We recommend you to carefully read ALGLIB Reference Manual, section
634  ! called 'SMP support', before using parallel version of this function.
635  !
636  ! You should remember that starting/stopping worker thread always have
637  ! non-zero cost. Although multicore version is pretty efficient on
638  ! large problems, we do not recommend you to use it on small problems -
639  ! ones where expected operations count is less than 100.000
640 
641 INPUT PARAMETERS:
642  XY - array[NPoints,NFeatures], dataset
643  NPoints - number of points
644  NFeatures- number of features
645 
646 OUTPUT PARAMETERS:
647  XY - data are replaced by their within-row ranks;
648  ranking starts from 0, ends at NFeatures-1
649 
650  -- ALGLIB --
651  Copyright 18.04.2013 by Bochkanov Sergey
652 *************************************************************************/
653 void rankdatacentered(const real_2d_array &xy, const ae_int_t npoints, const ae_int_t nfeatures);
654 void smp_rankdatacentered(const real_2d_array &xy, const ae_int_t npoints, const ae_int_t nfeatures);
657 
658 
659 /*************************************************************************
660 Obsolete function, we recommend to use PearsonCorr2().
661 
662  -- ALGLIB --
663  Copyright 09.04.2007 by Bochkanov Sergey
664 *************************************************************************/
665 double pearsoncorrelation(const real_1d_array &x, const real_1d_array &y, const ae_int_t n);
666 
667 
668 /*************************************************************************
669 Obsolete function, we recommend to use SpearmanCorr2().
670 
671  -- ALGLIB --
672  Copyright 09.04.2007 by Bochkanov Sergey
673 *************************************************************************/
674 double spearmanrankcorrelation(const real_1d_array &x, const real_1d_array &y, const ae_int_t n);
675 
676 /*************************************************************************
677 Wilcoxon signed-rank test
678 
679 This test checks three hypotheses about the median of the given sample.
680 The following tests are performed:
681  * two-tailed test (null hypothesis - the median is equal to the given
682  value)
683  * left-tailed test (null hypothesis - the median is greater than or
684  equal to the given value)
685  * right-tailed test (null hypothesis - the median is less than or
686  equal to the given value)
687 
688 Requirements:
689  * the scale of measurement should be ordinal, interval or ratio (i.e.
690  the test could not be applied to nominal variables).
691  * the distribution should be continuous and symmetric relative to its
692  median.
693  * number of distinct values in the X array should be greater than 4
694 
695 The test is non-parametric and doesn't require distribution X to be normal
696 
697 Input parameters:
698  X - sample. Array whose index goes from 0 to N-1.
699  N - size of the sample.
700  Median - assumed median value.
701 
702 Output parameters:
703  BothTails - p-value for two-tailed test.
704  If BothTails is less than the given significance level
705  the null hypothesis is rejected.
706  LeftTail - p-value for left-tailed test.
707  If LeftTail is less than the given significance level,
708  the null hypothesis is rejected.
709  RightTail - p-value for right-tailed test.
710  If RightTail is less than the given significance level
711  the null hypothesis is rejected.
712 
713 To calculate p-values, special approximation is used. This method lets us
714 calculate p-values with two decimal places in interval [0.0001, 1].
715 
716 "Two decimal places" does not sound very impressive, but in practice the
717 relative error of less than 1% is enough to make a decision.
718 
719 There is no approximation outside the [0.0001, 1] interval. Therefore, if
720 the significance level outlies this interval, the test returns 0.0001.
721 
722  -- ALGLIB --
723  Copyright 08.09.2006 by Bochkanov Sergey
724 *************************************************************************/
725 void wilcoxonsignedranktest(const real_1d_array &x, const ae_int_t n, const double e, double &bothtails, double &lefttail, double &righttail);
726 
727 /*************************************************************************
728 Sign test
729 
730 This test checks three hypotheses about the median of the given sample.
731 The following tests are performed:
732  * two-tailed test (null hypothesis - the median is equal to the given
733  value)
734  * left-tailed test (null hypothesis - the median is greater than or
735  equal to the given value)
736  * right-tailed test (null hypothesis - the median is less than or
737  equal to the given value)
738 
739 Requirements:
740  * the scale of measurement should be ordinal, interval or ratio (i.e.
741  the test could not be applied to nominal variables).
742 
743 The test is non-parametric and doesn't require distribution X to be normal
744 
745 Input parameters:
746  X - sample. Array whose index goes from 0 to N-1.
747  N - size of the sample.
748  Median - assumed median value.
749 
750 Output parameters:
751  BothTails - p-value for two-tailed test.
752  If BothTails is less than the given significance level
753  the null hypothesis is rejected.
754  LeftTail - p-value for left-tailed test.
755  If LeftTail is less than the given significance level,
756  the null hypothesis is rejected.
757  RightTail - p-value for right-tailed test.
758  If RightTail is less than the given significance level
759  the null hypothesis is rejected.
760 
761 While calculating p-values high-precision binomial distribution
762 approximation is used, so significance levels have about 15 exact digits.
763 
764  -- ALGLIB --
765  Copyright 08.09.2006 by Bochkanov Sergey
766 *************************************************************************/
767 void onesamplesigntest(const real_1d_array &x, const ae_int_t n, const double median, double &bothtails, double &lefttail, double &righttail);
768 
769 /*************************************************************************
770 Pearson's correlation coefficient significance test
771 
772 This test checks hypotheses about whether X and Y are samples of two
773 continuous distributions having zero correlation or whether their
774 correlation is non-zero.
775 
776 The following tests are performed:
777  * two-tailed test (null hypothesis - X and Y have zero correlation)
778  * left-tailed test (null hypothesis - the correlation coefficient is
779  greater than or equal to 0)
780  * right-tailed test (null hypothesis - the correlation coefficient is
781  less than or equal to 0).
782 
783 Requirements:
784  * the number of elements in each sample is not less than 5
785  * normality of distributions of X and Y.
786 
787 Input parameters:
788  R - Pearson's correlation coefficient for X and Y
789  N - number of elements in samples, N>=5.
790 
791 Output parameters:
792  BothTails - p-value for two-tailed test.
793  If BothTails is less than the given significance level
794  the null hypothesis is rejected.
795  LeftTail - p-value for left-tailed test.
796  If LeftTail is less than the given significance level,
797  the null hypothesis is rejected.
798  RightTail - p-value for right-tailed test.
799  If RightTail is less than the given significance level
800  the null hypothesis is rejected.
801 
802  -- ALGLIB --
803  Copyright 09.04.2007 by Bochkanov Sergey
804 *************************************************************************/
805 void pearsoncorrelationsignificance(const double r, const ae_int_t n, double &bothtails, double &lefttail, double &righttail);
806 
807 
808 /*************************************************************************
809 Spearman's rank correlation coefficient significance test
810 
811 This test checks hypotheses about whether X and Y are samples of two
812 continuous distributions having zero correlation or whether their
813 correlation is non-zero.
814 
815 The following tests are performed:
816  * two-tailed test (null hypothesis - X and Y have zero correlation)
817  * left-tailed test (null hypothesis - the correlation coefficient is
818  greater than or equal to 0)
819  * right-tailed test (null hypothesis - the correlation coefficient is
820  less than or equal to 0).
821 
822 Requirements:
823  * the number of elements in each sample is not less than 5.
824 
825 The test is non-parametric and doesn't require distributions X and Y to be
826 normal.
827 
828 Input parameters:
829  R - Spearman's rank correlation coefficient for X and Y
830  N - number of elements in samples, N>=5.
831 
832 Output parameters:
833  BothTails - p-value for two-tailed test.
834  If BothTails is less than the given significance level
835  the null hypothesis is rejected.
836  LeftTail - p-value for left-tailed test.
837  If LeftTail is less than the given significance level,
838  the null hypothesis is rejected.
839  RightTail - p-value for right-tailed test.
840  If RightTail is less than the given significance level
841  the null hypothesis is rejected.
842 
843  -- ALGLIB --
844  Copyright 09.04.2007 by Bochkanov Sergey
845 *************************************************************************/
846 void spearmanrankcorrelationsignificance(const double r, const ae_int_t n, double &bothtails, double &lefttail, double &righttail);
847 
848 /*************************************************************************
849 One-sample t-test
850 
851 This test checks three hypotheses about the mean of the given sample. The
852 following tests are performed:
853  * two-tailed test (null hypothesis - the mean is equal to the given
854  value)
855  * left-tailed test (null hypothesis - the mean is greater than or
856  equal to the given value)
857  * right-tailed test (null hypothesis - the mean is less than or equal
858  to the given value).
859 
860 The test is based on the assumption that a given sample has a normal
861 distribution and an unknown dispersion. If the distribution sharply
862 differs from normal, the test will work incorrectly.
863 
864 INPUT PARAMETERS:
865  X - sample. Array whose index goes from 0 to N-1.
866  N - size of sample, N>=0
867  Mean - assumed value of the mean.
868 
869 OUTPUT PARAMETERS:
870  BothTails - p-value for two-tailed test.
871  If BothTails is less than the given significance level
872  the null hypothesis is rejected.
873  LeftTail - p-value for left-tailed test.
874  If LeftTail is less than the given significance level,
875  the null hypothesis is rejected.
876  RightTail - p-value for right-tailed test.
877  If RightTail is less than the given significance level
878  the null hypothesis is rejected.
879 
880 NOTE: this function correctly handles degenerate cases:
881  * when N=0, all p-values are set to 1.0
882  * when variance of X[] is exactly zero, p-values are set
883  to 1.0 or 0.0, depending on difference between sample mean and
884  value of mean being tested.
885 
886 
887  -- ALGLIB --
888  Copyright 08.09.2006 by Bochkanov Sergey
889 *************************************************************************/
890 void studentttest1(const real_1d_array &x, const ae_int_t n, const double mean, double &bothtails, double &lefttail, double &righttail);
891 
892 
893 /*************************************************************************
894 Two-sample pooled test
895 
896 This test checks three hypotheses about the mean of the given samples. The
897 following tests are performed:
898  * two-tailed test (null hypothesis - the means are equal)
899  * left-tailed test (null hypothesis - the mean of the first sample is
900  greater than or equal to the mean of the second sample)
901  * right-tailed test (null hypothesis - the mean of the first sample is
902  less than or equal to the mean of the second sample).
903 
904 Test is based on the following assumptions:
905  * given samples have normal distributions
906  * dispersions are equal
907  * samples are independent.
908 
909 Input parameters:
910  X - sample 1. Array whose index goes from 0 to N-1.
911  N - size of sample.
912  Y - sample 2. Array whose index goes from 0 to M-1.
913  M - size of sample.
914 
915 Output parameters:
916  BothTails - p-value for two-tailed test.
917  If BothTails is less than the given significance level
918  the null hypothesis is rejected.
919  LeftTail - p-value for left-tailed test.
920  If LeftTail is less than the given significance level,
921  the null hypothesis is rejected.
922  RightTail - p-value for right-tailed test.
923  If RightTail is less than the given significance level
924  the null hypothesis is rejected.
925 
926 NOTE: this function correctly handles degenerate cases:
927  * when N=0 or M=0, all p-values are set to 1.0
928  * when both samples has exactly zero variance, p-values are set
929  to 1.0 or 0.0, depending on difference between means.
930 
931  -- ALGLIB --
932  Copyright 18.09.2006 by Bochkanov Sergey
933 *************************************************************************/
934 void studentttest2(const real_1d_array &x, const ae_int_t n, const real_1d_array &y, const ae_int_t m, double &bothtails, double &lefttail, double &righttail);
935 
936 
937 /*************************************************************************
938 Two-sample unpooled test
939 
940 This test checks three hypotheses about the mean of the given samples. The
941 following tests are performed:
942  * two-tailed test (null hypothesis - the means are equal)
943  * left-tailed test (null hypothesis - the mean of the first sample is
944  greater than or equal to the mean of the second sample)
945  * right-tailed test (null hypothesis - the mean of the first sample is
946  less than or equal to the mean of the second sample).
947 
948 Test is based on the following assumptions:
949  * given samples have normal distributions
950  * samples are independent.
951 Equality of variances is NOT required.
952 
953 Input parameters:
954  X - sample 1. Array whose index goes from 0 to N-1.
955  N - size of the sample.
956  Y - sample 2. Array whose index goes from 0 to M-1.
957  M - size of the sample.
958 
959 Output parameters:
960  BothTails - p-value for two-tailed test.
961  If BothTails is less than the given significance level
962  the null hypothesis is rejected.
963  LeftTail - p-value for left-tailed test.
964  If LeftTail is less than the given significance level,
965  the null hypothesis is rejected.
966  RightTail - p-value for right-tailed test.
967  If RightTail is less than the given significance level
968  the null hypothesis is rejected.
969 
970 NOTE: this function correctly handles degenerate cases:
971  * when N=0 or M=0, all p-values are set to 1.0
972  * when both samples has zero variance, p-values are set
973  to 1.0 or 0.0, depending on difference between means.
974  * when only one sample has zero variance, test reduces to 1-sample
975  version.
976 
977  -- ALGLIB --
978  Copyright 18.09.2006 by Bochkanov Sergey
979 *************************************************************************/
980 void unequalvariancettest(const real_1d_array &x, const ae_int_t n, const real_1d_array &y, const ae_int_t m, double &bothtails, double &lefttail, double &righttail);
981 
982 /*************************************************************************
983 Mann-Whitney U-test
984 
985 This test checks hypotheses about whether X and Y are samples of two
986 continuous distributions of the same shape and same median or whether
987 their medians are different.
988 
989 The following tests are performed:
990  * two-tailed test (null hypothesis - the medians are equal)
991  * left-tailed test (null hypothesis - the median of the first sample
992  is greater than or equal to the median of the second sample)
993  * right-tailed test (null hypothesis - the median of the first sample
994  is less than or equal to the median of the second sample).
995 
996 Requirements:
997  * the samples are independent
998  * X and Y are continuous distributions (or discrete distributions well-
999  approximating continuous distributions)
1000  * distributions of X and Y have the same shape. The only possible
1001  difference is their position (i.e. the value of the median)
1002  * the number of elements in each sample is not less than 5
1003  * the scale of measurement should be ordinal, interval or ratio (i.e.
1004  the test could not be applied to nominal variables).
1005 
1006 The test is non-parametric and doesn't require distributions to be normal.
1007 
1008 Input parameters:
1009  X - sample 1. Array whose index goes from 0 to N-1.
1010  N - size of the sample. N>=5
1011  Y - sample 2. Array whose index goes from 0 to M-1.
1012  M - size of the sample. M>=5
1013 
1014 Output parameters:
1015  BothTails - p-value for two-tailed test.
1016  If BothTails is less than the given significance level
1017  the null hypothesis is rejected.
1018  LeftTail - p-value for left-tailed test.
1019  If LeftTail is less than the given significance level,
1020  the null hypothesis is rejected.
1021  RightTail - p-value for right-tailed test.
1022  If RightTail is less than the given significance level
1023  the null hypothesis is rejected.
1024 
1025 To calculate p-values, special approximation is used. This method lets us
1026 calculate p-values with satisfactory accuracy in interval [0.0001, 1].
1027 There is no approximation outside the [0.0001, 1] interval. Therefore, if
1028 the significance level outlies this interval, the test returns 0.0001.
1029 
1030 Relative precision of approximation of p-value:
1031 
1032 N M Max.err. Rms.err.
1033 5..10 N..10 1.4e-02 6.0e-04
1034 5..10 N..100 2.2e-02 5.3e-06
1035 10..15 N..15 1.0e-02 3.2e-04
1036 10..15 N..100 1.0e-02 2.2e-05
1037 15..100 N..100 6.1e-03 2.7e-06
1038 
1039 For N,M>100 accuracy checks weren't put into practice, but taking into
1040 account characteristics of asymptotic approximation used, precision should
1041 not be sharply different from the values for interval [5, 100].
1042 
1043 NOTE: P-value approximation was optimized for 0.0001<=p<=0.2500. Thus,
1044  P's outside of this interval are enforced to these bounds. Say, you
1045  may quite often get P equal to exactly 0.25 or 0.0001.
1046 
1047  -- ALGLIB --
1048  Copyright 09.04.2007 by Bochkanov Sergey
1049 *************************************************************************/
1050 void mannwhitneyutest(const real_1d_array &x, const ae_int_t n, const real_1d_array &y, const ae_int_t m, double &bothtails, double &lefttail, double &righttail);
1051 
1052 /*************************************************************************
1053 Jarque-Bera test
1054 
1055 This test checks hypotheses about the fact that a given sample X is a
1056 sample of normal random variable.
1057 
1058 Requirements:
1059  * the number of elements in the sample is not less than 5.
1060 
1061 Input parameters:
1062  X - sample. Array whose index goes from 0 to N-1.
1063  N - size of the sample. N>=5
1064 
1065 Output parameters:
1066  P - p-value for the test
1067 
1068 Accuracy of the approximation used (5<=N<=1951):
1069 
1070 p-value relative error (5<=N<=1951)
1071 [1, 0.1] < 1%
1072 [0.1, 0.01] < 2%
1073 [0.01, 0.001] < 6%
1074 [0.001, 0] wasn't measured
1075 
1076 For N>1951 accuracy wasn't measured but it shouldn't be sharply different
1077 from table values.
1078 
1079  -- ALGLIB --
1080  Copyright 09.04.2007 by Bochkanov Sergey
1081 *************************************************************************/
1082 void jarqueberatest(const real_1d_array &x, const ae_int_t n, double &p);
1083 
1084 /*************************************************************************
1085 Two-sample F-test
1086 
1087 This test checks three hypotheses about dispersions of the given samples.
1088 The following tests are performed:
1089  * two-tailed test (null hypothesis - the dispersions are equal)
1090  * left-tailed test (null hypothesis - the dispersion of the first
1091  sample is greater than or equal to the dispersion of the second
1092  sample).
1093  * right-tailed test (null hypothesis - the dispersion of the first
1094  sample is less than or equal to the dispersion of the second sample)
1095 
1096 The test is based on the following assumptions:
1097  * the given samples have normal distributions
1098  * the samples are independent.
1099 
1100 Input parameters:
1101  X - sample 1. Array whose index goes from 0 to N-1.
1102  N - sample size.
1103  Y - sample 2. Array whose index goes from 0 to M-1.
1104  M - sample size.
1105 
1106 Output parameters:
1107  BothTails - p-value for two-tailed test.
1108  If BothTails is less than the given significance level
1109  the null hypothesis is rejected.
1110  LeftTail - p-value for left-tailed test.
1111  If LeftTail is less than the given significance level,
1112  the null hypothesis is rejected.
1113  RightTail - p-value for right-tailed test.
1114  If RightTail is less than the given significance level
1115  the null hypothesis is rejected.
1116 
1117  -- ALGLIB --
1118  Copyright 19.09.2006 by Bochkanov Sergey
1119 *************************************************************************/
1120 void ftest(const real_1d_array &x, const ae_int_t n, const real_1d_array &y, const ae_int_t m, double &bothtails, double &lefttail, double &righttail);
1121 
1122 
1123 /*************************************************************************
1124 One-sample chi-square test
1125 
1126 This test checks three hypotheses about the dispersion of the given sample
1127 The following tests are performed:
1128  * two-tailed test (null hypothesis - the dispersion equals the given
1129  number)
1130  * left-tailed test (null hypothesis - the dispersion is greater than
1131  or equal to the given number)
1132  * right-tailed test (null hypothesis - dispersion is less than or
1133  equal to the given number).
1134 
1135 Test is based on the following assumptions:
1136  * the given sample has a normal distribution.
1137 
1138 Input parameters:
1139  X - sample 1. Array whose index goes from 0 to N-1.
1140  N - size of the sample.
1141  Variance - dispersion value to compare with.
1142 
1143 Output parameters:
1144  BothTails - p-value for two-tailed test.
1145  If BothTails is less than the given significance level
1146  the null hypothesis is rejected.
1147  LeftTail - p-value for left-tailed test.
1148  If LeftTail is less than the given significance level,
1149  the null hypothesis is rejected.
1150  RightTail - p-value for right-tailed test.
1151  If RightTail is less than the given significance level
1152  the null hypothesis is rejected.
1153 
1154  -- ALGLIB --
1155  Copyright 19.09.2006 by Bochkanov Sergey
1156 *************************************************************************/
1157 void onesamplevariancetest(const real_1d_array &x, const ae_int_t n, const double variance, double &bothtails, double &lefttail, double &righttail);
1158 }
1159 
1161 //
1162 // THIS SECTION CONTAINS COMPUTATIONAL CORE DECLARATIONS (FUNCTIONS)
1163 //
1165 namespace alglib_impl
1166 {
1167 void samplemoments(/* Real */ ae_vector* x,
1168  ae_int_t n,
1169  double* mean,
1170  double* variance,
1171  double* skewness,
1172  double* kurtosis,
1173  ae_state *_state);
1174 double samplemean(/* Real */ ae_vector* x,
1175  ae_int_t n,
1176  ae_state *_state);
1177 double samplevariance(/* Real */ ae_vector* x,
1178  ae_int_t n,
1179  ae_state *_state);
1180 double sampleskewness(/* Real */ ae_vector* x,
1181  ae_int_t n,
1182  ae_state *_state);
1183 double samplekurtosis(/* Real */ ae_vector* x,
1184  ae_int_t n,
1185  ae_state *_state);
1186 void sampleadev(/* Real */ ae_vector* x,
1187  ae_int_t n,
1188  double* adev,
1189  ae_state *_state);
1190 void samplemedian(/* Real */ ae_vector* x,
1191  ae_int_t n,
1192  double* median,
1193  ae_state *_state);
1194 void samplepercentile(/* Real */ ae_vector* x,
1195  ae_int_t n,
1196  double p,
1197  double* v,
1198  ae_state *_state);
1199 double cov2(/* Real */ ae_vector* x,
1200  /* Real */ ae_vector* y,
1201  ae_int_t n,
1202  ae_state *_state);
1203 double pearsoncorr2(/* Real */ ae_vector* x,
1204  /* Real */ ae_vector* y,
1205  ae_int_t n,
1206  ae_state *_state);
1207 double spearmancorr2(/* Real */ ae_vector* x,
1208  /* Real */ ae_vector* y,
1209  ae_int_t n,
1210  ae_state *_state);
1211 void covm(/* Real */ ae_matrix* x,
1212  ae_int_t n,
1213  ae_int_t m,
1214  /* Real */ ae_matrix* c,
1215  ae_state *_state);
1216 void _pexec_covm(/* Real */ ae_matrix* x,
1217  ae_int_t n,
1218  ae_int_t m,
1219  /* Real */ ae_matrix* c, ae_state *_state);
1220 void pearsoncorrm(/* Real */ ae_matrix* x,
1221  ae_int_t n,
1222  ae_int_t m,
1223  /* Real */ ae_matrix* c,
1224  ae_state *_state);
1225 void _pexec_pearsoncorrm(/* Real */ ae_matrix* x,
1226  ae_int_t n,
1227  ae_int_t m,
1228  /* Real */ ae_matrix* c, ae_state *_state);
1229 void spearmancorrm(/* Real */ ae_matrix* x,
1230  ae_int_t n,
1231  ae_int_t m,
1232  /* Real */ ae_matrix* c,
1233  ae_state *_state);
1234 void _pexec_spearmancorrm(/* Real */ ae_matrix* x,
1235  ae_int_t n,
1236  ae_int_t m,
1237  /* Real */ ae_matrix* c, ae_state *_state);
1238 void covm2(/* Real */ ae_matrix* x,
1239  /* Real */ ae_matrix* y,
1240  ae_int_t n,
1241  ae_int_t m1,
1242  ae_int_t m2,
1243  /* Real */ ae_matrix* c,
1244  ae_state *_state);
1245 void _pexec_covm2(/* Real */ ae_matrix* x,
1246  /* Real */ ae_matrix* y,
1247  ae_int_t n,
1248  ae_int_t m1,
1249  ae_int_t m2,
1250  /* Real */ ae_matrix* c, ae_state *_state);
1251 void pearsoncorrm2(/* Real */ ae_matrix* x,
1252  /* Real */ ae_matrix* y,
1253  ae_int_t n,
1254  ae_int_t m1,
1255  ae_int_t m2,
1256  /* Real */ ae_matrix* c,
1257  ae_state *_state);
1258 void _pexec_pearsoncorrm2(/* Real */ ae_matrix* x,
1259  /* Real */ ae_matrix* y,
1260  ae_int_t n,
1261  ae_int_t m1,
1262  ae_int_t m2,
1263  /* Real */ ae_matrix* c, ae_state *_state);
1264 void spearmancorrm2(/* Real */ ae_matrix* x,
1265  /* Real */ ae_matrix* y,
1266  ae_int_t n,
1267  ae_int_t m1,
1268  ae_int_t m2,
1269  /* Real */ ae_matrix* c,
1270  ae_state *_state);
1272  /* Real */ ae_matrix* y,
1273  ae_int_t n,
1274  ae_int_t m1,
1275  ae_int_t m2,
1276  /* Real */ ae_matrix* c, ae_state *_state);
1277 void rankdata(/* Real */ ae_matrix* xy,
1278  ae_int_t npoints,
1279  ae_int_t nfeatures,
1280  ae_state *_state);
1281 void _pexec_rankdata(/* Real */ ae_matrix* xy,
1282  ae_int_t npoints,
1283  ae_int_t nfeatures, ae_state *_state);
1284 void rankdatacentered(/* Real */ ae_matrix* xy,
1285  ae_int_t npoints,
1286  ae_int_t nfeatures,
1287  ae_state *_state);
1289  ae_int_t npoints,
1290  ae_int_t nfeatures, ae_state *_state);
1291 double pearsoncorrelation(/* Real */ ae_vector* x,
1292  /* Real */ ae_vector* y,
1293  ae_int_t n,
1294  ae_state *_state);
1295 double spearmanrankcorrelation(/* Real */ ae_vector* x,
1296  /* Real */ ae_vector* y,
1297  ae_int_t n,
1298  ae_state *_state);
1300  ae_int_t n,
1301  double e,
1302  double* bothtails,
1303  double* lefttail,
1304  double* righttail,
1305  ae_state *_state);
1306 void onesamplesigntest(/* Real */ ae_vector* x,
1307  ae_int_t n,
1308  double median,
1309  double* bothtails,
1310  double* lefttail,
1311  double* righttail,
1312  ae_state *_state);
1314  ae_int_t n,
1315  double* bothtails,
1316  double* lefttail,
1317  double* righttail,
1318  ae_state *_state);
1320  ae_int_t n,
1321  double* bothtails,
1322  double* lefttail,
1323  double* righttail,
1324  ae_state *_state);
1325 void studentttest1(/* Real */ ae_vector* x,
1326  ae_int_t n,
1327  double mean,
1328  double* bothtails,
1329  double* lefttail,
1330  double* righttail,
1331  ae_state *_state);
1332 void studentttest2(/* Real */ ae_vector* x,
1333  ae_int_t n,
1334  /* Real */ ae_vector* y,
1335  ae_int_t m,
1336  double* bothtails,
1337  double* lefttail,
1338  double* righttail,
1339  ae_state *_state);
1340 void unequalvariancettest(/* Real */ ae_vector* x,
1341  ae_int_t n,
1342  /* Real */ ae_vector* y,
1343  ae_int_t m,
1344  double* bothtails,
1345  double* lefttail,
1346  double* righttail,
1347  ae_state *_state);
1348 void mannwhitneyutest(/* Real */ ae_vector* x,
1349  ae_int_t n,
1350  /* Real */ ae_vector* y,
1351  ae_int_t m,
1352  double* bothtails,
1353  double* lefttail,
1354  double* righttail,
1355  ae_state *_state);
1356 void jarqueberatest(/* Real */ ae_vector* x,
1357  ae_int_t n,
1358  double* p,
1359  ae_state *_state);
1360 void ftest(/* Real */ ae_vector* x,
1361  ae_int_t n,
1362  /* Real */ ae_vector* y,
1363  ae_int_t m,
1364  double* bothtails,
1365  double* lefttail,
1366  double* righttail,
1367  ae_state *_state);
1369  ae_int_t n,
1370  double variance,
1371  double* bothtails,
1372  double* lefttail,
1373  double* righttail,
1374  ae_state *_state);
1375 
1376 }
1377 #endif
1378 
void studentttest2(const real_1d_array &x, const ae_int_t n, const real_1d_array &y, const ae_int_t m, double &bothtails, double &lefttail, double &righttail)
void covm2(ae_matrix *x, ae_matrix *y, ae_int_t n, ae_int_t m1, ae_int_t m2, ae_matrix *c, ae_state *_state)
void samplepercentile(const real_1d_array &x, const ae_int_t n, const double p, double &v)
void studentttest1(const real_1d_array &x, const ae_int_t n, const double mean, double &bothtails, double &lefttail, double &righttail)
double samplevariance(const real_1d_array &x, const ae_int_t n)
void studentttest2(ae_vector *x, ae_int_t n, ae_vector *y, ae_int_t m, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
void onesamplesigntest(const real_1d_array &x, const ae_int_t n, const double median, double &bothtails, double &lefttail, double &righttail)
void pearsoncorrm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c)
void _pexec_spearmancorrm(ae_matrix *x, ae_int_t n, ae_int_t m, ae_matrix *c, ae_state *_state)
void _pexec_covm2(ae_matrix *x, ae_matrix *y, ae_int_t n, ae_int_t m1, ae_int_t m2, ae_matrix *c, ae_state *_state)
void _pexec_rankdata(ae_matrix *xy, ae_int_t npoints, ae_int_t nfeatures, ae_state *_state)
void pearsoncorrelationsignificance(const double r, const ae_int_t n, double &bothtails, double &lefttail, double &righttail)
double pearsoncorr2(const real_1d_array &x, const real_1d_array &y, const ae_int_t n)
void covm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c)
void spearmanrankcorrelationsignificance(const double r, const ae_int_t n, double &bothtails, double &lefttail, double &righttail)
void _pexec_pearsoncorrm2(ae_matrix *x, ae_matrix *y, ae_int_t n, ae_int_t m1, ae_int_t m2, ae_matrix *c, ae_state *_state)
void sampleadev(ae_vector *x, ae_int_t n, double *adev, ae_state *_state)
void jarqueberatest(ae_vector *x, ae_int_t n, double *p, ae_state *_state)
double samplevariance(ae_vector *x, ae_int_t n, ae_state *_state)
void smp_spearmancorrm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c)
void pearsoncorrm(ae_matrix *x, ae_int_t n, ae_int_t m, ae_matrix *c, ae_state *_state)
void samplemoments(const real_1d_array &x, const ae_int_t n, double &mean, double &variance, double &skewness, double &kurtosis)
void smp_pearsoncorrm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c)
void onesamplevariancetest(ae_vector *x, ae_int_t n, double variance, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
double samplemean(ae_vector *x, ae_int_t n, ae_state *_state)
void spearmancorrm2(ae_matrix *x, ae_matrix *y, ae_int_t n, ae_int_t m1, ae_int_t m2, ae_matrix *c, ae_state *_state)
void pearsoncorrm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c)
void rankdatacentered(ae_matrix *xy, ae_int_t npoints, ae_int_t nfeatures, ae_state *_state)
void smp_pearsoncorrm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c)
void samplemoments(ae_vector *x, ae_int_t n, double *mean, double *variance, double *skewness, double *kurtosis, ae_state *_state)
void _pexec_spearmancorrm2(ae_matrix *x, ae_matrix *y, ae_int_t n, ae_int_t m1, ae_int_t m2, ae_matrix *c, ae_state *_state)
void _pexec_rankdatacentered(ae_matrix *xy, ae_int_t npoints, ae_int_t nfeatures, ae_state *_state)
void _pexec_pearsoncorrm(ae_matrix *x, ae_int_t n, ae_int_t m, ae_matrix *c, ae_state *_state)
void spearmancorrm(ae_matrix *x, ae_int_t n, ae_int_t m, ae_matrix *c, ae_state *_state)
double pearsoncorr2(ae_vector *x, ae_vector *y, ae_int_t n, ae_state *_state)
void ftest(const real_1d_array &x, const ae_int_t n, const real_1d_array &y, const ae_int_t m, double &bothtails, double &lefttail, double &righttail)
void pearsoncorrm2(ae_matrix *x, ae_matrix *y, ae_int_t n, ae_int_t m1, ae_int_t m2, ae_matrix *c, ae_state *_state)
void ftest(ae_vector *x, ae_int_t n, ae_vector *y, ae_int_t m, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
double samplekurtosis(const real_1d_array &x, const ae_int_t n)
void smp_spearmancorrm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c)
void spearmancorrm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c)
void wilcoxonsignedranktest(const real_1d_array &x, const ae_int_t n, const double e, double &bothtails, double &lefttail, double &righttail)
double pearsoncorrelation(const real_1d_array &x, const real_1d_array &y, const ae_int_t n)
double pearsoncorrelation(ae_vector *x, ae_vector *y, ae_int_t n, ae_state *_state)
void onesamplesigntest(ae_vector *x, ae_int_t n, double median, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
void studentttest1(ae_vector *x, ae_int_t n, double mean, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
double spearmancorr2(ae_vector *x, ae_vector *y, ae_int_t n, ae_state *_state)
void _pexec_covm(ae_matrix *x, ae_int_t n, ae_int_t m, ae_matrix *c, ae_state *_state)
double cov2(const real_1d_array &x, const real_1d_array &y, const ae_int_t n)
void smp_rankdata(const real_2d_array &xy, const ae_int_t npoints, const ae_int_t nfeatures)
double samplemean(const real_1d_array &x, const ae_int_t n)
void rankdata(ae_matrix *xy, ae_int_t npoints, ae_int_t nfeatures, ae_state *_state)
double samplekurtosis(ae_vector *x, ae_int_t n, ae_state *_state)
double spearmancorr2(const real_1d_array &x, const real_1d_array &y, const ae_int_t n)
void smp_rankdatacentered(const real_2d_array &xy, const ae_int_t npoints, const ae_int_t nfeatures)
double spearmanrankcorrelation(ae_vector *x, ae_vector *y, ae_int_t n, ae_state *_state)
void covm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c)
void onesamplevariancetest(const real_1d_array &x, const ae_int_t n, const double variance, double &bothtails, double &lefttail, double &righttail)
alglib_impl::ae_int_t ae_int_t
Definition: ap.h:965
double cov2(ae_vector *x, ae_vector *y, ae_int_t n, ae_state *_state)
void samplemedian(const real_1d_array &x, const ae_int_t n, double &median)
void wilcoxonsignedranktest(ae_vector *x, ae_int_t n, double e, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
void mannwhitneyutest(ae_vector *x, ae_int_t n, ae_vector *y, ae_int_t m, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
void unequalvariancettest(ae_vector *x, ae_int_t n, ae_vector *y, ae_int_t m, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
void rankdatacentered(const real_2d_array &xy, const ae_int_t npoints, const ae_int_t nfeatures)
double spearmanrankcorrelation(const real_1d_array &x, const real_1d_array &y, const ae_int_t n)
void rankdata(const real_2d_array &xy, const ae_int_t npoints, const ae_int_t nfeatures)
void covm(ae_matrix *x, ae_int_t n, ae_int_t m, ae_matrix *c, ae_state *_state)
double sampleskewness(const real_1d_array &x, const ae_int_t n)
double sampleskewness(ae_vector *x, ae_int_t n, ae_state *_state)
void samplepercentile(ae_vector *x, ae_int_t n, double p, double *v, ae_state *_state)
void smp_covm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c)
void smp_covm(const real_2d_array &x, const ae_int_t n, const ae_int_t m, real_2d_array &c)
void samplemedian(ae_vector *x, ae_int_t n, double *median, ae_state *_state)
void pearsoncorrelationsignificance(double r, ae_int_t n, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
void unequalvariancettest(const real_1d_array &x, const ae_int_t n, const real_1d_array &y, const ae_int_t m, double &bothtails, double &lefttail, double &righttail)
void jarqueberatest(const real_1d_array &x, const ae_int_t n, double &p)
void mannwhitneyutest(const real_1d_array &x, const ae_int_t n, const real_1d_array &y, const ae_int_t m, double &bothtails, double &lefttail, double &righttail)
void spearmancorrm2(const real_2d_array &x, const real_2d_array &y, const ae_int_t n, const ae_int_t m1, const ae_int_t m2, real_2d_array &c)
ptrdiff_t ae_int_t
Definition: ap.h:185
void spearmanrankcorrelationsignificance(double r, ae_int_t n, double *bothtails, double *lefttail, double *righttail, ae_state *_state)
void sampleadev(const real_1d_array &x, const ae_int_t n, double &adev)
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich