ansi-fication
[CommonLispStat.git] / Data / leukemia.lsp
blob8dfcd49a8c9cbadd233330381e7acdc2c4dabfea
1 (require "bayes")
3 (def wbc-pos (list 2300 750 4300 2600 6000 10500 10000 17000 5400 7000
4 9400 32000 35000 100000 100000 52000 100000))
6 (def transformed-wbc-pos (- (log wbc-pos) (log 10000)))
8 (def times-pos (list 65 156 100 134 16 108 121 4 39 143 56 26 22 1 1 5 65))
10 (defun llik-pos (theta)
11 (let* ((x transformed-wbc-pos)
12 (y times-pos)
13 (theta0 (select theta 0))
14 (theta1 (select theta 1))
15 (t1x (* theta1 x)))
16 (- (sum t1x)
17 (* (length x) (log theta0))
18 (/ (sum (* y (exp t1x)))
19 theta0))))
21 (defun lk-sprob (theta)
22 (let* ((time 52.0)
23 (x (log 5))
24 (mu (* (select theta 0) (exp (- (* (select theta 1) x))))))
25 (exp (- (/ time mu)))))