Monday, November 24, 2008

math




Covariance matrix
Math in Ruby
Matrix in Ruby
Matrix multiplication

I found that Ruby was very nice for doing some statistics with a Gaussian classifier:


covariance_matrix = Matrix.diagonal(var_x,var_y)
inv_covariance_matrix = covariance_matrix.inverse
determinant_covariance_matrix = covariance_matrix.determinant