Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -9,4 +9,5 @@ Compute the vector <math>\beta = \{ \beta_1, \beta_2, ..., \beta_k \}</math> usi
<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).
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).

View file

@ -3,4 +3,7 @@
NB. |:X is transpose of X
(%.(|:X) mp X) mp (|:X) mp y
128.814 _143.163 61.9606
xpy=: mp~ |: NB. Or factoring out "X prime y" (monadically "X prime X")
X (%.@:xpy@[ mp xpy) y
128.814 _143.163 61.9606

View file

@ -6,5 +6,5 @@
[2]
[3]
[9]]))
; Output:
{{out}}
(array #[#[9 1/3] #[-3 1/3]])

View file

@ -0,0 +1 @@
puts regression_coefficients([3,4,5], [ [1,2,1], [1,1,2] ])