I have a signal x that I want to classify in one of the classes A and B in which the means are

Ma=[0.5,0.6] and Mb=[2,2]

and with variances

Va=1 and Vb=2.

And to classify the signal I have to use the Mahalanobis distance which requires the covariance S that those classes share and have in common. Can I find it if there is only given the mean and variance between those classes?

P.S I know this looks like a homework exercise but I have been looking everywhere and I could not find anything

  • 3
    $\begingroup$ The two subclauses of your 'P.S.' are not logically connected. Is this a homework exercise? If so, please add the [self-study] tag & read its wiki. $\endgroup$ Jan 13, 2016 at 16:30
  • $\begingroup$ Thanks you for adding the tag. What would you do if you had the full covariance matrices? $\endgroup$ Jan 13, 2016 at 16:46
  • $\begingroup$ The mahalanobis distance formula requires the covariance matrice to be able to calculate the distances between the signal x to the classes A and B $\endgroup$
    – Izanagi
    Jan 13, 2016 at 16:49
  • 1
    $\begingroup$ The problem states that the two classes have a common covariance matrix that was produced by independent characteristics with variances Va=1 and Vb=2. $\endgroup$
    – Izanagi
    Jan 16, 2016 at 16:03
  • 1
    $\begingroup$ If we got the cov(A,B) right then I think I can solve it .Anyway thank you so much for your time that you spent helping me . $\endgroup$
    – Izanagi
    Jan 16, 2016 at 16:22

1 Answer 1


You have two classes of objects that exist within a two dimensional space defined by two characteristics $(x_1, x_2)$. The issue here is how the data covary within that space. That is, there is some value for the correlation between $x_1$ and $x_2$. If you know that $x_1$ and $x_2$ are independent, then you know the correlation that corresponds to independence. From there, you can calculate the covariance using the definition of correlation: $$ {\rm Cor}(x_1, x_2) = \frac{{\rm Cov(x_1, x_2)}}{{\rm Var(x_1)}{\rm Var(x_2)}} $$ Remember that a correlation matrix is symmetrical. That is, $s_{12}=s_{21}$. With that last piece, you should be able to construct the correlation matrix and solve the problem.

  • $\begingroup$ But what do you do if you don't have the correlation? I mean the original question, you have only mean and variance. $\endgroup$
    – xkcd
    Aug 30, 2018 at 0:39
  • $\begingroup$ @xkcd, if you know x1 & X2 are independent, you can infer the correlation from that. If you didn't know whether they were independent, you could use background knowledge to impute a distribution of possible correlations (like a prior) & integrate over that. $\endgroup$ Aug 30, 2018 at 0:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.