least-squares ( {{x,y}...} -- alpha beta )


Vocabulary
math.statistics

Definition
USING: combinators kernel math ;

IN: math.statistics

: least-squares ( {{x,y}...} -- alpha beta )
[r] { [ 2dup ] [ ] [ ] [ ] [ ] } spread [ (r) ] 2keep
swap / * [ swapd * - ] keep ;