This commit is contained in:
Ingy döt Net 2013-06-05 21:47:54 +00:00
parent 1f1ad49427
commit 6f050a029e
2496 changed files with 37609 additions and 3031 deletions

View file

@ -0,0 +1,6 @@
#lang racket
(require math)
(define T matrix-transpose)
(define (fit X y)
(matrix-solve (matrix* (T X) X) (matrix* (T X) y)))

View file

@ -0,0 +1,10 @@
(fit (matrix [[1 2]
[2 5]
[3 7]
[4 9]])
(matrix [[1]
[2]
[3]
[9]]))
; Output:
(array #[#[9 1/3] #[-3 1/3]])