1
$\begingroup$

Overview: I'm attempting to understand Linear Regression but am currently confused with regard to notation. I'm using a simple profit/loss sheet as a framework to assist my learning.

What I have: Naturally the profit/loss sheet runs over the 12 months of the year Jan - Dec. I have split the data into two separate matrices, one matrix 'y' contains the dependent variables, i.e. profit/loss for each month of the year (shape = 12x1). The other matrix 'x' (design matrix) contains 15 explanatory variables upon which the profit/loss for each month depends (shape = 15x12).

The problem: I am following a course text which states; "x is a D-Dimensional matrix", (see related image, below)

Design Matrix

My question: Is it the number of independent variables (i.e. 15) OR the number of months of the year (i.e. 12) which we refer to the dimension of this matrix?

My current viewpoint: The course text seems to suggest that the months of the year relate to the dimension 'D'. But if I have some vector composed of (x,y) pairs we call this a 2-dimensional vector, which can be represented in a 2-d vector space. If I have many vectors, for arguments sake we'll say 100 vectors, each containing an (x,y) pair, we don't call this a 100 dimensional vector/matrix and we simply represent it graphically as 100 points in the same 2-d vector space.

$\endgroup$
0
$\begingroup$

The design matrix is $N \times (D+1)$. Each of the $N$ rows of the matrix represents one datapoint (one month), and each of the $D+1$ columns of the matrix represents an explanatory variable or an intercept term (the all ones column). So your design matrix has size $12 \times (15+1)$.

$\endgroup$
  • $\begingroup$ Note: I should have removed the 1's from the first column this could be misleading as the actual design matrix does not contain this constant term and begins at x1. Ok, I think the subscript/superscript notation confused me. I see now how the superscript represents the months in the year, x^(1) being January, ..., x^(n=12) being December. While the subscript represents the independent variable. So for one year I end up with 12 points in a 15-dimensional vector space. Thanks for the help, I can't upvote as my reputation is not high enough yet. $\endgroup$ – MarkMark Sep 17 '17 at 18:48

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.