Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
calc_reciprocal_similarity_map [2013/07/23 17:50]
admin [Optional Inputs]
calc_reciprocal_similarity_map [2015/10/13 19:39]
admin
Line 7: Line 7:
 ===== Inputs ===== ===== Inputs =====
  
-^ Name         ​^ Type                                        ^ Description ​                                 +^ Name  ^ Type  ^ Description ​ 
-| First Map    | [[Categorical Map Type|Categorical Map  ​]]  | A map consisting of classes or categories. ​  ​+| First Map  | [[Categorical Map Type]] ​ | A map consisting of classes or categories. ​ 
-| Second Map   ​| [[Categorical Map Type|Categorical Map  ​]]  | A map consisting of classes or categories. ​  ​|+| Second Map  | [[Categorical Map Type]] ​ | A map consisting of classes or categories. ​ |
  
 ===== Optional Inputs ===== ===== Optional Inputs =====
  
 ^ Name  ^ Type  ^ Description ​ ^ Default Value  ^ ^ Name  ^ Type  ^ Description ​ ^ Default Value  ^
-| Window Size  | [[Positive ​Int Type|Positive Int]]  | Window size with equal number of lines and columns. Only odd numbers are acceptable. ​ | 5  | +| Window Size  | [[Positive ​Integer Value Type]] ​ | Window size with equal number of lines and columns. Only odd numbers are acceptable. ​ | 5  | 
-| Use Exponential Decay  | [[Bool Type|Bool]]  | If true, the similarity is calculated using an exponential decay function truncated by the window size. Otherwise, a constant function is used within the specified window. ​  | True  | +| Use Exponential Decay  | [[Boolean Value Type]] ​ | If true, the similarity is calculated using an exponential decay function truncated by the window size. Otherwise, a constant function is used within the specified window. ​  | True  | 
-| Cell Type  | [[Cell Type Type|Cell ​Type]] ​ | Data cell type.  | Signed 8 Bit Integer ​ | +| Cell Type  | [[Cell Type Type]] ​ | Data cell type.  | Signed 8 Bit Integer ​ | 
-| Null Value  | [[Null Value Type|Null Value]]  | Null value. ​ | -128  | +| Null Value  | [[Null Value Type]] ​ | Null value. ​ | Default ​ | 
-| Exponential Decay Divisor ​ | [[Double ​Type|Double]]  | Value used to attenuate the distance in the exponential decay function. ​ | 2  |+| Exponential Decay Divisor ​ | [[Real Value Type]] ​ | Value used to attenuate the distance in the exponential decay function. ​ This value must be increased when the "Use Exponential Decay" is greater the 11.((See the [[calc_reciprocal_similarity_map#​exponential_decay_function|exponential decay function documentation]] for more details.)) ​ | 2  | 
 ===== Output ===== ===== Output =====
  
-^ Name               ​^ Type                     ​^ Description ​                                                                                                                                                                   +^ Name  ^ Type  ^ Description ​ 
-| First Similarity ​  ​| [[Map Type|Map ]]        | Map showing the degree of spatial match from the first to the second input map. Similarity varies from zero (no match) to 1 (perfect match) within the specified window size.  | +| First Similarity ​ | [[Map Type]] ​ | Map showing the degree of spatial match from the first to the second input map. Similarity varies from zero (no match) to 1 (perfect match) within the specified window size.  | 
-| Second Similarity ​ | [[Map Type|Map ]]        | Map showing the degree of spatial match from the second to the first input map. Similarity varies from zero (no match) to 1 (perfect match) within the specified window size.  | +| Second Similarity ​ | [[Map Type]] ​ | Map showing the degree of spatial match from the second to the first input map. Similarity varies from zero (no match) to 1 (perfect match) within the specified window size.  | 
-| First Mean         ​| [[Double ​Type|Double ​]]  | The mean similarity index for the given window size comparing the first map to the second. ​                                                                                    ​+| First Mean  | [[Real Value Type]] ​ | The mean similarity index for the given window size comparing the first map to the second. ​ 
-| Second Mean        | [[Double ​Type|Double ​]]  | The mean similarity index for the given window size comparing the second map to the first. ​                                                                                    ​|+| Second Mean  | [[Real Value Type]] ​ | The mean similarity index for the given window size comparing the second map to the first. ​ |
  
 ===== Group ===== ===== Group =====
Line 39: Line 40:
 <​m>​V_{nbhood}=(matrix{4}{1}{mu_{nbhood}_{1} mu_{nbhood}_{2} vdots mu_{nbhood}_{C}})</​m>​ (11) @@@@@@@@@@@@ <​m>​V_{mbhood}=(matrix{4}{1}{mu_{mbhood}_{1} mu_{mbhood}_{2} vdots mu_{mbhood}_{C}})</​m>​ (12) <​m>​V_{nbhood}=(matrix{4}{1}{mu_{nbhood}_{1} mu_{nbhood}_{2} vdots mu_{nbhood}_{C}})</​m>​ (11) @@@@@@@@@@@@ <​m>​V_{mbhood}=(matrix{4}{1}{mu_{mbhood}_{1} mu_{mbhood}_{2} vdots mu_{mbhood}_{C}})</​m>​ (12)
  
-where //​mnbhood<​sub>​i</​sub>//​ represents the membership for category //i// within a neighborhood of //N// cells (usually //N = n<​sup>​2</​sup>//​);​ //​mcrisp<​sub>​i,​j</​sub>//​ is the membership of category //i// for neighboring cell //j//, assuming, as in a crisp vector, 1 for //i// and 0 for categories other than //i// (<​m>​i ​ in  C</​m>​) and //​m<​sub>​j</​sub>//​ is the distance based membership of neighboring cell //j//. //m// represents a distance decay function, for instance, an exponential decay (//​m=2<​sup>​-d/​2</​sup>//​). Although spatially continuous, to facilitate computation this decay function most often becomes truncated outside of the neighborhood window //n x n//. Which function is most appropriate and the size of the window depends on the vagueness of the data and the allowed tolerance for spatial error (Hagen, 2003). As we want to assess the model’s spatial fit at various resolutions,​ in addition to an exponential decay, a constant function equal to 1 inside the neighborhood window and 0 outside of it is also applied. Equation (14) sets the category membership for the central cell, assuming the highest contribution found within a neighborhood window //n x n//. Next, a similarity measure for a pair of maps can be obtained through a cell-by-cell fuzzy set intersection between their fuzzy and crisp vectors using the following equations:+where //​mnbhood<​sub>​i</​sub>//​ represents the membership for category //i// within a neighborhood of //N// cells (usually //N = n<​sup>​2</​sup>//​);​ //​mcrisp<​sub>​i,​j</​sub>//​ is the membership of category //i// for neighboring cell //j//, assuming, as in a crisp vector, 1 for //i// and 0 for categories other than //i// (<​m>​i ​ in  C</​m>​) and //​m<​sub>​j</​sub>//​ is the distance based membership of neighboring cell //j//. //m// represents a distance decay function, for instance, an exponential decay (//​m=2<​sup>​-d/​A</​sup>// ​where //d// is the distance and //A// is the distance attenuation). Although spatially continuous, to facilitate computation this decay function most often becomes truncated outside of the neighborhood window //n x n//. Which function is most appropriate and the size of the window depends on the vagueness of the data and the allowed tolerance for spatial error (Hagen, 2003). As we want to assess the model’s spatial fit at various resolutions,​ in addition to an exponential decay, a constant function equal to 1 inside the neighborhood window and 0 outside of it is also applied. Equation (14) sets the category membership for the central cell, assuming the highest contribution found within a neighborhood window //n x n//. Next, a similarity measure for a pair of maps can be obtained through a cell-by-cell fuzzy set intersection between their fuzzy and crisp vectors using the following equations:
  
 <​m>​S(V_A,​V_B)=delim{[}{delim{|}{mu_{A,​1},​mu_{B,​1}}{|}_{Min},​ delim{|}{mu_{A,​2},​mu_{B,​2}}{|}_{Min},​ cdots, delim{|}{mu_{A,​i},​mu_{B,​i}}{|}_{Min}}{]}_{Max}</​m>​ (13) <​m>​S(V_A,​V_B)=delim{[}{delim{|}{mu_{A,​1},​mu_{B,​1}}{|}_{Min},​ delim{|}{mu_{A,​2},​mu_{B,​2}}{|}_{Min},​ cdots, delim{|}{mu_{A,​i},​mu_{B,​i}}{|}_{Min}}{]}_{Max}</​m>​ (13)
Line 48: Line 49:
  
 The overall similarity of a pair of maps can be calculated by averaging the two-way similarity values for all map cells. As random maps tend to score higher, it is recommended picking up the minimum fit value from the two-way comparison. The overall similarity of a pair of maps can be calculated by averaging the two-way similarity values for all map cells. As random maps tend to score higher, it is recommended picking up the minimum fit value from the two-way comparison.
 +
 +==== Exponential Decay Function ====
 +
 +The exponential decay function used to calculate similarity can be seen below:
 +
 +<​m>​S=1/​2^(d/​A)</​m>​
 +where //d// is the distance from the window center and //A// is the attenuation factor [Exponential Decay Divisor].
 +
 +The attenuation parameter can be used to control how fast the exponential function value decreases. The graphs below illustrates:​
 +
 +[{{ :​exponential_decay_function_x_1.png?​direct&​450 |Exponential Decay Function with A=1 }}]
 +
 +[{{ :​exponential_decay_function_x_2.png?​direct&​450 |Exponential Decay Function with A=2 }}]
 +
 +[{{ :​exponential_decay_function_x_4.png?​direct&​450 |Exponential Decay Function with A=4 }}]
 +
 +[{{ :​exponential_decay_function_x_10.png?​direct&​450 |Exponential Decay Function with A=10 }}]
  
 ==== References ==== ==== References ====