14 lines
593 B
Plaintext
14 lines
593 B
Plaintext
;Task:
|
|
Given a set of data vectors in the following format:
|
|
|
|
<math>y = \{ y_1, y_2, ..., y_n \}\,</math>
|
|
|
|
<math>X_i = \{ x_{i1}, x_{i2}, ..., x_{in} \}, i \in 1..k\,</math>
|
|
|
|
Compute the vector <math>\beta = \{ \beta_1, \beta_2, ..., \beta_k \}</math> using [[wp:Ordinary least squares|ordinary least squares]] regression using the following equation:
|
|
|
|
<math>y_j = \Sigma_i \beta_i \cdot x_{ij} , j \in 1..n</math>
|
|
|
|
You can assume <i> y </i> is given to you as a vector (a one-dimensional array), and <i> X </i> is given to you as a two-dimensional array (i.e. matrix).
|
|
<br><br>
|