SpatialStatisticsFunctions.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/sa/core/SpatialStatisticsFunctions.h
22 
23  \brief Functions used to calculate spatial statistics operations.
24 
25  \reference Methods adapted from TerraLib4.
26 */
27 
28 #ifndef __TERRALIB_SA_INTERNAL_SPATIALSTATISTICSFUNCTIONS_H
29 #define __TERRALIB_SA_INTERNAL_SPATIALSTATISTICSFUNCTIONS_H
30 
31 // TerraLib
32 #include "../Config.h"
33 
34 // STL
35 #include <string>
36 
37 namespace te
38 {
39  namespace sa
40  {
41  // Forward declaration
42  class GeneralizedProximityMatrix;
43 
44  /*!
45  \brief The local spatial statistic G is calculated for each zone based on the spatial weights object used.
46  The value returned is a Z-value, and may be used as a diagnostic tool. High positive values indicate
47  the posibility of a local cluster of high values of the variable being analysed, very low relative
48  values a similar cluster of low values.
49 
50  \param gpm Pointer to the gpm
51  \param attrIdx Attribute index used to calculate the GStatistics.
52 
53  */
55 
56  /*!
57  \brief Function used to calculate the local mean of each vertex from gpm graph.
58 
59  \param gpm Pointer to the gpm.
60  \param attrIdx Attribute index used to calculate the local mean.
61 
62  */
64 
65  /*!
66  \brief Function used to calculate the standard deviation Z and local mean of the desviation Z (WZ).
67  of each vertex from gpm graph.
68 
69  \param gpm Pointer to the gpm.
70  \param attrIdx Attribute index used to calculate the Z and WZ.
71 
72  */
74 
75  /*!
76  \brief Function used to calculate the moran index, also calculates the local moran value.
77 
78  \param gpm Pointer to the gpm.
79 
80  \return Double value that represents the moran index.
81 
82  \note This functions only works if the gpm has the Z and WZ attributes calculated.
83  */
85 
86  /*!
87  \brief Function used to calculate the moran index to calculate the significance of the global moran index
88 
89  \param gpm Pointer to the gpm.
90  \param mean The mean of the original gpm of the attrIdx.
91  \param variance The variance of the original gpm of the attrIdx.
92  \param attrIdx Attribute selected to calculate the moran index.
93 
94  \return Double value that represents the moran index.
95 
96  \note This is a internal function used in GlobalMoranSignificance method.
97  */
98  TESAEXPORT double MoranIndex(te::sa::GeneralizedProximityMatrix* gpm, double mean, double variance, int attrIdx);
99 
100  /*!
101  \brief Function used to calculate the global moran significance.
102 
103  \param gpm Pointer to the gpm.
104  \param attrIdx Attribute index used to calculate the global moran significance.
105  \param permutationsNumber Value of pertumations.
106  \param moranIndex The global moran index value.
107 
108  \return Double value that represents the global moran significance.
109 
110  */
111  TESAEXPORT double GlobalMoranSignificance(te::sa::GeneralizedProximityMatrix* gpm, int attrIdx, int permutationsNumber, double moranIndex);
112 
113  /*!
114  \brief Function used to calculate LISA Statical Significance for each gpm element.
115 
116  \param gpm Pointer to the gpm.
117  \param int The number of permutations.
118 
119  \note This functions only works if the gpm has the Z, Local Moran and Number of Neighbours attributes calculated.
120  */
122 
123  /*!
124  \brief Function used to calculate the box map info for a gpm, classifies the objects in quadrants based in the scatterplot of moran index.
125 
126  \param gpm Pointer to the gpm.
127  \param mean Mean value
128 
129  \note This functions only works if the gpm has the Z and WZ attributes calculated.
130  */
131  TESAEXPORT void BoxMap(te::sa::GeneralizedProximityMatrix* gpm, double mean);
132 
133  /*!
134  \brief Function used to calculate the lisa map info for a gpm, classifies the objects based in the statistical significance
135  of the moran local indexes (LISA).
136 
137  \param gpm Pointer to the gpm.
138  \param int The number of permutations.
139 
140  \note This functions only works if the gpm has the LISASig (LisaStatisticalSignificance) attribute calculated.
141  */
142  TESAEXPORT void LISAMap(te::sa::GeneralizedProximityMatrix* gpm, int permutationsNumber);
143 
144  /*!
145  \brief Function used to calculate the moran map info for a gpm, classifies the objects based in the
146  scatterplot of Moran index and its statistical significance
147 
148  \param gpm Pointer to the gpm.
149 
150  \note This functions only works if the gpm has the LISAMap and BoxMAP attributes calculated.
151  */
153 
154  } // end namespace sa
155 } // end namespace te
156 
157 #endif // __TERRALIB_SA_INTERNAL_SPATIALSTATISTICSFUNCTIONS_H
158 
TESAEXPORT double GlobalMoranSignificance(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx, int permutationsNumber, double moranIndex)
Function used to calculate the global moran significance.
This class defines a Generalized Proximity Matrix.
TESAEXPORT void MoranMap(te::sa::GeneralizedProximityMatrix *gpm)
Function used to calculate the moran map info for a gpm, classifies the objects based in the scatterp...
TESAEXPORT void LocalMean(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
Function used to calculate the local mean of each vertex from gpm graph.
TESAEXPORT void ZAndWZ(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
Function used to calculate the standard deviation Z and local mean of the desviation Z (WZ)...
TESAEXPORT void LISAMap(te::sa::GeneralizedProximityMatrix *gpm, int permutationsNumber)
Function used to calculate the lisa map info for a gpm, classifies the objects based in the statistic...
TESAEXPORT void LisaStatisticalSignificance(te::sa::GeneralizedProximityMatrix *gpm, int permutationsNumber)
Function used to calculate LISA Statical Significance for each gpm element.
URI C++ Library.
TESAEXPORT void GStatistics(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
The local spatial statistic G is calculated for each zone based on the spatial weights object used...
TESAEXPORT void BoxMap(te::sa::GeneralizedProximityMatrix *gpm, double mean)
Function used to calculate the box map info for a gpm, classifies the objects in quadrants based in t...
#define TESAEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:133
TESAEXPORT double MoranIndex(te::sa::GeneralizedProximityMatrix *gpm)
Function used to calculate the moran index, also calculates the local moran value.