Hi

I have read some examples of least squares fitting of data, for example there is a an example stating that Hooke's spring law relates the length of a uniform spring x as a linear function of the force y applied to it: $\displaystyle y = a + bx$

So it then goes on to form the matrix based on applying four forces, 0, 2, 4, and 6 N, and then taking the respective spring length measurements, $\displaystyle x_0, x_1, x_2, x_3$ so that the matrix and y vector,

$\displaystyle A = \left[\begin{matrix}1 & x_0\\1 & x_1\\1 & x_2\\1 & x_3\end{matrix}\right]$ , $\displaystyle y = \left[\begin{matrix}y_0\\y_1\\y_2\\y_3\end{matrix}\right]$

look like this

$\displaystyle A = \left[\begin{matrix}1 & 6.1\\1 & 7.6\\1 & 8.7\\1 & 10.4\end{matrix}\right]$ , $\displaystyle y = \left[\begin{matrix}0\\2\\4\\6\end{matrix}\right]$

for the system $\displaystyle A\hat{x} = y $, where $\displaystyle \hat{x} = \left[\begin{matrix}a\\b\end{matrix}\right]$

I understand that example fine, but I want to fit some data into a least squares form, but I'm just not sure how to start.

The equation is as follows, $\displaystyle a_{ij} = \mu + \alpha_i + \nu_j$

Here my parameters are, $\displaystyle \hat{x}= \left[\begin{matrix}\mu\\\alpha_a\\.\\.\\.\\\alpha_m\\\n u_1\\.\\.\\.\\\nu_n\end{matrix}\right]$
My y vector in this case will be, $\displaystyle y = \left[\begin{matrix}a_{11}\\a_{12}\\.\\.\\.\\a_{mn}\end{ matrix}\right]$

$\displaystyle \mu$ is an average that is included in every solution to $\displaystyle a_{ij}$ so the first columb of the A matrix is all 1'a. From the equation above I can see that, take $\displaystyle a_{12}$ for example, $\displaystyle a_{12}$ is a linear combination of the parameters $\displaystyle \mu, \alpha_1$ and $\displaystyle \nu_2$. So I'm thinking the linear combination of the top line of the A matrix should look something like this: $\displaystyle a_{12} = 1\mu_1 + 1\alpha_1 + 0\alpha_2 + ... + 0\alpha_m + 0\nu_a + 1\nu_2 + 0\nu_3 + ...+ 0\nu_n$

But I can't see how this fits into the equation of a line model y = a + bx though. Am I going to have an equation like y = a + bx + cz? or something? Or am I doing something totally wrong?
Does anyone know how to help me fit this into a linear least squares model?

Thanks.