Skip to content

Commit

Permalink
Added __repr__ to Moran I
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaura committed Oct 23, 2014
1 parent da9bb46 commit c003745
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions pysal/esda/moran.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,40 @@ def __init__(self, y, w, transformation="r", permutations=PERMUTATIONS,
self.p_z_sim = 1 - stats.norm.cdf(self.z_sim)
else:
self.p_z_sim = stats.norm.cdf(self.z_sim)

def __repr__(self):
return '''
Moran's I: {}
Normality Assumption
--------------------
Expected Value: {}
Variance of I: {}
Standard Dev. of I: {}
Z-Value: {}
P-Value: {}
Randomization Assumption
------------------------
Variance of I: {}
Standard Dev. of I: {}
Z-Value: {}
P-Value: {}
Permutation Results
-------------------
Number of Permutations: {}
Average Expected Value: {}
Variance of I: {}
Standard Dev. of I: {}
Standardized I: {}
P-Value: {}
'''.format(self.I, self.EI, self.VI_norm, self.seI_norm,
self.z_norm, self.p_norm, self.VI_rand, self.seI_rand,
self.z_rand, self.p_rand, self.permutations,
self.EI_sim, self.VI_sim, self.seI_sim, self.z_sim,
self.p_z_sim)


def __moments(self):
self.n = len(self.y)
Expand Down

0 comments on commit c003745

Please sign in to comment.