Method: Statsample::Factor.anti_image_correlation_matrix

Defined in:
lib/statsample/factor.rb

.anti_image_correlation_matrix(matrix) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/statsample/factor.rb', line 43

def self.anti_image_correlation_matrix(matrix)
  matrix=matrix.to_matrix
  s=Matrix.diagonal(*(matrix.inverse.diagonal)).sqrt.inverse
  aicm=s*matrix.inverse*s
  
  aicm.extend(Statsample::CovariateMatrix)
  aicm.fields=matrix.fields if matrix.respond_to? :fields
  aicm
end