Why is this a quadratic programming problem? I am sorry if this is a stupid question, I'm very new.
How would I minimize the following objective?
$\sum_{k=1}^p\| I_{k} - M_{k}A \|^2$
Each I and M are known.
I am told I can use a quadratic programming solver, but I am not sure how it applies.
Could someone nudge me in the right direction?
 A: The problem is quadratic because you are using the $\ell^2$ norm, i.e., for a real vector $\bf v$ you have $\Vert {\bf v} \Vert^2=\sum_{j=1}^n v_j^2 = {\bf v}^\top {\bf v}$.
For a given vector ${\bf i}$ of length $n$ and matrix $M$ you have
$$\Vert {\bf i}-M {\bf a}\Vert^2 
= ({\bf i}-M{\bf a})^\top ({\bf i} -M{\bf a})={\bf i}^\top {\bf i} - 2 {\bf i}^\top M{\bf a} + {\bf a}^\top M^\top M {\bf a}.$$
If you rewrite your objective $f({\bf a})$ this way you have
$$\begin{align}f({\bf a}) 
&= \sum_{k=1}^p \Vert {\bf i}_k - M_k {\bf a}\Vert^2 
\\&= \sum_{k=1}^p \left( {\bf i}_k^\top {\bf i}_k - 2 {\bf i}_k^\top M_k{\bf a} + {\bf a}^\top M_k^\top M_k {\bf a} \right)
\\&= \left(\sum_{k=1}^p {\bf i}_k^\top {\bf i}_k\right) - 2 \left(\sum_{k=1}^p {\bf i}_k^\top M_k\right) {\bf a} + {\bf a}^\top \left( \sum_{k=1}^p M_k^\top M_k \right) {\bf a} .
\end{align}
$$
As @Rahul pointed out in the comment spurring a rewrite of this answer, you can see the constant term, the linear term, and the quadratic term.
This is a quadratic problem in ${\bf a}$, and is convex.
Rewriting just shows it's quadratic, you don't need to rewrite it to take its Jacobian:
$$\nabla f({\bf a}) = \sum_{k=2}^p -2 M_k^\top ({\bf i}_k - M_k {\bf a}),$$
or its Hessian:
$$\nabla^2 f({\bf a}) = \sum_{k=1}^p 2 M_k^\top M_k.$$
You can easily see from this representation that it's a convex problem, and any point where $$\nabla f({\bf a})=\vec 0$$ is a solution.
