# Why don't the dimensions in this linear regression equation match up?

I'm going through an article on linear regression, and they give the following formula for computing estimates:

The convention is that all vectors are column vectors. So if n is the number of samples and m is the number of parameters, hw(x) has dimensions n x 1, wT has dimensions 1 x m, and x has dimensions n x m. The problem is that these dimensions don't work out for matrix multiplication.

Where have I gone wrong here?

My guess is that $$x$$ here refers to a single datapoint with shape $$m$$x$$1$$. So $$h_w(x)$$ and $$w^Tx$$ both have shape $$1$$. In the case of multiple datapoints given as a matrix $$X$$ of shape $$n$$x$$m$$, the equation becomes:
$$h_w(X) = Xw$$
• Indeed I think would be more consistent to have written the case in the OP as $x^Tw$. It doesn't make much sense to think of one data point as a column vector when the design matrix is inherently by convention a bunch of data as row vectors. Mar 2 '20 at 3:01