Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Silly Matrix Algebra/Regression Question

  1. Jun 25, 2010 #1
    So I have what I think is going to be a silly matrix algebra question.

    I'm performing a linear regression, using standard matrix algebra:

    Y = XA (all are matrices)

    I have found my coefficients (A) and now I wish to use that information to get X as a function of Y.

    If this were a normal algebraic equation, I'd have X = Y/A, but that doesn't make sense in matrix-land.

    I've tried: Y * A' * inv(A * A') = X, but that doesn't give me numbers which make any sense.

    Can anyone help me clear this up? I'm sure it's not too difficult... thanks!!

    EDIT: I suppose it might be useful to give some matrix dimensions, but I think the algebra should be the same no matter what... A = (10x144), X = (1x10), Y = (1x144)
  2. jcsd
  3. Jun 26, 2010 #2


    User Avatar
    Science Advisor
    Gold Member

    The approach you are taking (so-called "normal equations") will often work, although in general it isn't good from a numerics perspective, expecially for a large number of unknowns. I think we need more details in order to help.

    How do you know that the results make no sense?

    What exactly are your basis functions (powers, othogonal polynomials, or ...)? In other words, what does A look like, and what is the condition of A*A' ? It could be that A*A' is poorly conditioned.

    Also, how are you doing the numerics? Did you write you own software or are you using some well established library/application? single precision or double?

  4. Jun 29, 2010 #3
    If you take the transpose of the equation, you are left with a linear equation [itex]A^Tx^T = y^T[/itex]which can be solved in numerous ways. Your suggestion is one of them.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook