Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -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).
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
[2]
|
||||
[3]
|
||||
[9]]))
|
||||
; Output:
|
||||
{{out}}
|
||||
(array #[#[9 1/3] #[-3 1/3]])
|
||||
|
|
|
|||
1
Task/Multiple-regression/Ruby/multiple-regression-3.rb
Normal file
1
Task/Multiple-regression/Ruby/multiple-regression-3.rb
Normal file
|
|
@ -0,0 +1 @@
|
|||
puts regression_coefficients([3,4,5], [ [1,2,1], [1,1,2] ])
|
||||
Loading…
Add table
Add a link
Reference in a new issue