forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkAutoCorrelativeStatistics.h
131 lines (111 loc) · 4.37 KB
/
vtkAutoCorrelativeStatistics.h
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAutoCorrelativeStatistics.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkAutoCorrelativeStatistics
* @brief A class for univariate auto-correlative statistics
*
*
* Given a selection of columns of interest in an input data table, this
* class provides the following functionalities, depending on the chosen
* execution options:
* * Learn: calculate sample mean and M2 aggregates for each variable w.r.t. itself
* (cf. P. Pebay, Formulas for robust, one-pass parallel computation of covariances
* and Arbitrary-Order Statistical Moments, Sandia Report SAND2008-6212, Sep 2008,
* http://infoserve.sandia.gov/sand_doc/2008/086212.pdf for details)
* for each specified time lag.
* * Derive: calculate unbiased autocovariance matrix estimators and its determinant,
* linear regressions, and Pearson correlation coefficient, for each specified
* time lag.
* * Assess: given an input data set, two means and a 2x2 covariance matrix,
* mark each datum with corresponding relative deviation (2-dimensional Mahlanobis
* distance).
*
*
* @par Thanks:
* This class was written by Philippe Pebay, Kitware SAS 2012
*/
#ifndef vtkAutoCorrelativeStatistics_h
#define vtkAutoCorrelativeStatistics_h
#include "vtkFiltersStatisticsModule.h" // For export macro
#include "vtkStatisticsAlgorithm.h"
class vtkMultiBlockDataSet;
class vtkStringArray;
class vtkTable;
class vtkVariant;
class vtkDoubleArray;
class VTKFILTERSSTATISTICS_EXPORT vtkAutoCorrelativeStatistics : public vtkStatisticsAlgorithm
{
public:
vtkTypeMacro(vtkAutoCorrelativeStatistics, vtkStatisticsAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
static vtkAutoCorrelativeStatistics* New();
//@{
/**
* Set/get the cardinality of the data set at given time, i.e., of
* any given time slice. It cannot be negative.
* The input data set is assumed to have a cardinality which
* is a multiple of this value.
* The default is 0, meaning that the user must specify a value
* that is consistent with the input data set.
*/
vtkSetClampMacro(SliceCardinality,vtkIdType,0,VTK_ID_MAX);
vtkGetMacro(SliceCardinality,vtkIdType);
//@}
/**
* Given a collection of models, calculate aggregate model
*/
void Aggregate( vtkDataObjectCollection*,
vtkMultiBlockDataSet* ) VTK_OVERRIDE;
protected:
vtkAutoCorrelativeStatistics();
~vtkAutoCorrelativeStatistics() VTK_OVERRIDE;
/**
* Execute the calculations required by the Learn option, given some input Data
* NB: input parameters are unused.
*/
void Learn( vtkTable*,
vtkTable*,
vtkMultiBlockDataSet* ) VTK_OVERRIDE;
/**
* Execute the calculations required by the Derive option.
*/
void Derive( vtkMultiBlockDataSet* ) VTK_OVERRIDE;
/**
* Execute the calculations required by the Test option.
*/
void Test( vtkTable*,
vtkMultiBlockDataSet*,
vtkTable* ) VTK_OVERRIDE { return; };
/**
* Execute the calculations required by the Assess option.
*/
void Assess( vtkTable* inData,
vtkMultiBlockDataSet* inMeta,
vtkTable* outData ) VTK_OVERRIDE
{ this->Superclass::Assess( inData, inMeta, outData, 1 ); }
/**
* Calculate p-value. This will be overridden using the object factory with an
* R implementation if R is present.
*/
virtual vtkDoubleArray* CalculatePValues(vtkDoubleArray*);
/**
* Provide the appropriate assessment functor.
*/
void SelectAssessFunctor( vtkTable* outData,
vtkDataObject* inMeta,
vtkStringArray* rowNames,
AssessFunctor*& dfunc ) VTK_OVERRIDE;
vtkIdType SliceCardinality;
private:
vtkAutoCorrelativeStatistics( const vtkAutoCorrelativeStatistics& ) VTK_DELETE_FUNCTION;
void operator = ( const vtkAutoCorrelativeStatistics& ) VTK_DELETE_FUNCTION;
};
#endif