export the right API for listoflist. Whoops!
[CommonLispStat.git] / Data / leukemia.lsp
blob77b5f6106208644149d5c10ffc69f2b32558f46a
3 ;;; From LispStat 1 : need to document source appropriately.
5 (in-package :lisp-stat-data-examples)
7 ;;; FIXME: Shutup compiler warnings, need to clean up and
8 ;;; appropriately initialize.
11 ;;(require "bayes")
14 (def wbc-pos (list 2300 750 4300 2600 6000 10500 10000 17000 5400 7000
15 9400 32000 35000 100000 100000 52000 100000))
17 (def transformed-wbc-pos (- (log wbc-pos) (log 10000)))
19 (def times-pos (list 65 156 100 134 16 108 121 4 39 143 56 26 22 1 1 5 65))
21 (defun llik-pos (theta)
22 (let* ((x transformed-wbc-pos)
23 (y times-pos)
24 (theta0 (select theta 0))
25 (theta1 (select theta 1))
26 (t1x (* theta1 x)))
27 (- (sum t1x)
28 (* (length x) (log theta0))
29 (/ (sum (* y (exp t1x)))
30 theta0))))
32 (defun lk-sprob (theta)
33 (let* ((time 52.0)
34 (x (log 5))
35 (mu (* (select theta 0) (exp (- (* (select theta 1) x))))))
36 (exp (- (/ time mu)))))