I want to use the least squares approximation to find the best fits with a quadratic function.
Data: $(1,2)(3,4)(5,7)(7,9)(9,12)$.

Let $y=\begin{pmatrix} 2\\4\\7\\9\\12 \end{pmatrix}$ and $A=\begin{pmatrix} 1&1&1&\\9&3&1\\25&5&1\\49&7&1\\81&9&1\end{pmatrix}$
I'm trying to get $(A^*A)^{-1}$ so $x=(A^*A)^{-1}A^*y$.
But the process of calculating $(A^*A)^{-1}$ drives me crazy!!!!!
Even the formula $A^{-1}=\dfrac{\mathrm{adj}(A)}{\mathrm{det}(A)}$ still remains a mass.
Is there any other simple and the easiest way to get inverse matrix?

  • $\begingroup$ Why are you not using a software? $\endgroup$ – response Jun 5 '13 at 0:33
  • $\begingroup$ Just do it. Or throw it into Matlab/Mathematica/etc $\endgroup$ – Calvin Lin Jun 5 '13 at 0:33
  • $\begingroup$ Of course I'm using calculator now, BUT in class, for examaple, during exam, I can't. So I just wonder is there any other formula to use. Unfortunately, according to your comments, there is no more... $\endgroup$ – noname Jun 5 '13 at 0:36
  • 1
    $\begingroup$ P.S. I recommend you Just do it and maybe you'll understand what I feel... $\endgroup$ – noname Jun 5 '13 at 0:38
  • 1
    $\begingroup$ Download Octave, the free-software (near-) clone of Matlab. $\endgroup$ – user1551 Jun 5 '13 at 1:30

In your case, you end up with inverting $A^* A$, which is a $3 \times 3$ matrix. For any square matrix $M$ of size $n \times n$, the standard method of inverting $M$ is to construct the augmented matrix $[ M \, \, I ]$, where $I$ is the identity matrix of size $n \times n$. Now, using a series of elementary row operations, manipulate the first $n$ columns of your augmented matrix such that it undergoes the process

$$ [M \, \, I ] \rightarrow [ I \, \, N ]$$

In other words, you want to use row operations to turn the left half of the augmented matrix into the identity matrix. Then, whatever is left over on the right side, denoted $N$, is in fact the inverse; that is, $N = M^{-1}$. This process, is, more or less, the fastest method to invert a matrix - modern techniques have improved considerably upon the details, but all ultimately rely on this version of Gaussian elimination.

  • $\begingroup$ Have you actually tried to perform the row operations with this particular matrix $A^*A$? I don't even want to do the first one. I'd rather have zero at my exam. I was lucky I never had such a professor. $\endgroup$ – Julien Jun 5 '13 at 1:57

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.