# Generating Regression For Unknown Beta in Matlab

My professor wants me to generate a regression problem based on the following:

B is fixed unknown 100,100 matrix, X is random 100,100 matrix and y and noise are a random scalar for every output. He wants me to do this using a loop. For Y= < B,X > + z . I am not sure if I am misinterpreting his instructions since I thought B should be a 100x1 matrix in this situation.

Any help leading me in the right direction for generating this or maybe clarifying my understanding of what this could possibly mean.

• I'd have thought B would be $100\times 1$ as well, unless $Y$ is multivariate, but in that case it would be a matrix. I think you'll have to ask him whether the really meant for B to be a vector. Oct 18, 2014 at 1:34
• The conditions imply $B$ is a $1\times 100$ matrix, for that's the only way to produce a "random scalar for every output" when $X$ has dimensions $100 \times n$ for any $n.$
– whuber
Nov 5, 2019 at 14:25

The notation $\langle B,X \rangle$ could mean the inner product of two matrices which is ${\rm tr}(B^T X)$.