4620c092f2e3f978c170e9160fd15121442d2e69
[CommonLispStat.git] / TODO.org
blob4620c092f2e3f978c170e9160fd15121442d2e69
1 #+TODO: TODO CURR | DONE
2 #+TODO: POSTPONED | CANCELED
5 Time-stamp: <2012-10-12 10:22:43 tony>
6 Creation:   <2008-09-08 08:06:30 tony>
8 * Intro and Metadata
10 File:       TODO.lisp
11 Author:     AJ Rossini <blindglobe@gmail.com>
12 Copyright:  (c) 2007-2012, AJ Rossini <blindglobe@gmail.com>.  MIT license.
13 Purpose:    Stuff that needs to be made working sits inside the
14             Task sections.
16             This file contains the current challenges to solve,
17             including a description of the setup and the work to
18             solve.  Solutions welcome.
20 What is this talk of 'release'? Klingons do not make software
21 'releases'.  Our software 'escapes', leaving a bloody trail of
22 designers and quality assurance people in its wake.
24 * Approach and Design, Strategy and Tactics
26 ** Approach
28    Please develop possible high level API code in examples
29    subdirectory -- when we get it "reasonable", migrate into
30    appropriate core code directories in the src subdirectory. 
32 ** Design
34    Collection of packages.  Include as appropriate, so that we end up
35    with a coherent collection as needed.
37 ** (Internal) Package and (External) System Hierarchy
39   This section provides some of the details regarding infrastructure of
40   the system.
42   current (possibly incomplete) set of lisp dependencies <2012-10-04 Thu>
44  0  ~/sandbox/xarray.git
45  1  ~/sandbox/foreign-numeric-vector.git
46  2  ~/sandbox/trivial-features.git
47  3  ~/sandbox/alexandria.git
48  4  ~/sandbox/babel.git
49  5  ~/sandbox/cffi.git
50  6  ~/sandbox/cl-utilities
51  7  ~/sandbox/metabang-bind.git
52  8  ~/sandbox/iterate.git
53  9  ~/sandbox/array-operations.git
56 *** Singletons (primary building blocks)
57     
58     These are packages as well as 
60     | asdf          | common system loader                          |
61     | xarray        | common access structure to array-like         |
62     |               | (matrix, vector) structures.                  |
63     | cls-config    | initialization of Lisp state, variables, etc, |
64     |               | localization to the particular lisp.          |
65     | lift          | unit-testing                                  |
66     | cffi          | foriegn function library                      |
67     | alexandria    |                                               |
68     | babel         |                                               |
69     | iterate       |                                               |
70     | metabang-bind |                                               |
72     as of now, all are in QL heirarchy
74 *** Dependency structure
76     | lisp-matrix     | general purpose matrix package, linking to lapack |      |
77     |                 | for numerics. Depends on:                         |      |
78     |                 | ffa                                               | cffi |
79     |                 | fnv                                               | cffi |
80     |                 | cl-blapack                                        | cffi |
81     |                 | xarray                                            |      |
82     | cls-dataframe   | in the same spirit as lisp-matrix, a means to     |      |
83     |                 | create tables.  Perhaps better called datatables? |      |
84     | cls-probability | depends on gsll, cl-variates, cl-? initially,     |      |
86 *** Need to integrate
88 **** Random number streams and probability calculus
91      Something for random numbers, that has a settable seed.  However,
92      we could pass on the "right thing" in favor of something that
93      will "work for now".  
94      cl-randist
96 **** import of data in text files
98      CSV and similar specialized imports
100      rsm-string
102 **** Graphics
104      ?? cl-2d  : 
105                cl-cairo2 : cffi
107      ?? cl-plplot : cffi
110 * Tasks to Do [2/40]
112   Usually, we need to load it everything before going on.
114 #+name: loadit
115 #+begin_src lisp
116   (ql:quickload :cls)
117 #+end_src
119 #+RESULTS: loadit
120 | :CLS |
122   and sometimes we might want to recompile fully:
124 #+name: recompile-it-all
125 #+begin_src lisp
126   (asdf:oos 'asdf:compile-op :cls :force T)
127 #+end_src
129   Currently <2012-10-10 Wed> QuickLisp support doesn't provide a
130   recompilation facility.  And QL is built over and partially extends
131   ASDF, so we should be fine for now.
133 ** DONE [#B] Example of Custom Data analysis set up
134    - State "DONE"       from "CURR"       [2010-10-12 Tue 13:48] \\
135      setup is mostly complete
136    - State "CURR"       from "TODO"       [2010-10-12 Tue 13:47]
137    - State "TODO"       from ""           [2010-10-12 Tue 13:47]
139    This is an example of a custom setup, not really interesting at
140    this point (it will hopefully be obsolete by the first release)
141    except to remind Tony how to program.  Pointy-headed managers need
142    any support they can find in order to regress to their
143    hacker-childhood.
145    The only point of this section is to illustrate that we could want
146    to load additional modules that are not a central part of the core
147    files.
148    
149 #+name: CustomLoader
150 #+begin_src lisp :tangle "examples/CustomLoader.lisp"
151   ;; always ensure we are in the right package to leave droppings and access functionality
152   (in-package :cl-user) 
153   (progn 
154     (defun init-CLS (&key (compile 'nil))
155       (let ((packagesToLoad (list ;; core system
156                                   :lift :lisp-matrix :cls
157                                   ;; visualization
158                                   ;; :cl-cairo2-x11 :iterate
159                                   :cl-2d
160                                   ;; doc reporting
161                                   :cl-pdf :cl-typesetting
162                                   ;;INFRA
163                                   :asdf-system-connections :xarray
164                                   ;;DOCS
165                                   :metatilities-base :anaphora :tinaa
166                                   :cl-ppcre :cl-markdown :docudown
167                                   ;; version and validate CLOS objects
168                                   ;; :versioned-objects :validations
169                                   ;;VIZ
170                                   ;; :cl-opengl
171                                   ;; :cl-glu :cl-glut :cl-glut-examples
172   
173   
174                                   ;; :cells :cells-gtk
175                                   :bordeaux-threads)))
176         (mapcar #'(lambda (x)
177                     (if compile
178                         (asdf:oos 'asdf:compile-op x :force T)
179                         (asdf:oos 'asdf:load-op x)))
180                 packagesToLoad)))
181     ;; (init-CLS :compile T) vs:
182     (init-CLS))
183 #+end_src
185 #+results:
186 |   | #<PACKAGE "COMMON-LISP-USER"> |
188 ** CURR [#A] Integrate with quicklist support.
189    
190    important to merge with quicklisp system loader support.  We
191    currently have some of this work integrated, but I think there are
192    a few systems which are not auto-installable.
194 *** TODO [#B] Determine which packages still need to be in QuickLisp
196     Currently, probably need my versions of files, or will need to
197     preface them as needed.  As we can afford at most 2 more renames,
198     probably have something like cls-cl-XXXX for packages which have
199     API conflicts, and then if we rename the system, something like
200     NAME-RANDOM, NAME-CORE, NAME-MATRIX, etc... as needed.
202 ** CURR [#A] Testing: unit, regression, examples. [0/3]
203    - State "CURR"       from "TODO"       [2010-10-12 Tue 13:51]
204    - State "TODO"       from ""           [2010-10-12 Tue 13:51]
206    Testing consists of unit tests, which internally verify subsets of
207    code, regression tests, and functional tests (in increasing order
208    of scale).
210 *** CURR [#B] Unit tests
211     - State "CURR"       from "TODO"       [2010-11-04 Thu 18:33]
212     - State "CURR"       from "TODO"       [2010-10-12 Tue 13:48]
213     - State "TODO"       from ""           [2010-10-12 Tue 13:48]
215     Unit tests have been started using LIFT.  Need to consider some of
216     the other systems that provide testing, when people add them to
217     the mix of libraries that we need, along with examples of how to
218     use.
220 #+name: ex-cls-unittest
221 #+begin_src lisp
222   (in-package :lisp-stat-unittests)
223   (run-tests :suite 'lisp-stat-ut)
224 #+end_src
226 #+RESULTS: ex-cls-unittest
227 : #<Results for LISP-STAT-UT 66 Tests, 3 Failures, 21 Errors>
230     Before we removed the internal legacy lispstat probability code,
231     we had:
233 : ;; => tests = 78, failures = 7, errors = 20
235     The following needs to be solved in order to have a decent
236     installation qualification (IQ) and performance qualification
237     (PQ).  It currently fails on approach.
239 #+name: cls-unittest
240 #+begin_src lisp
241   (in-package :lisp-stat-unittests)
242   (asdf:oos 'asdf:test-op 'cls) ; (describe (run-tests :suite 'lisp-stat-ut))
243 #+end_src
245     and check documentation to see if it is useful.
247 #+name: unittest-ex
248 #+begin_src lisp
249   (in-package :lisp-stat-unittests)
250   (describe 'lisp-stat-ut)
251   (documentation 'lisp-stat-ut 'type)
252   
253   ;; FIXME: Example: currently not relevant, yet
254   ;;   (describe (lift::run-test :test-case  'lisp-stat-unittests::create-proto
255   ;;                             :suite 'lisp-stat-unittests::lisp-stat-ut-proto))
256   
257   (describe (lift::run-tests :suite 'lisp-stat-ut-dataframe))
258   ;; => Test Report for LISP-STAT-UT-DATAFRAME: 11 tests run, 5 Errors.
259   
260   (lift::run-tests :suite 'lisp-stat-ut-dataframe)
261   
262   ;;; The following barfs, doesn't like test-case keyword
263   ;; (describe (lift::run-test
264   ;;             :test-case  'lisp-stat-unittests::create-proto
265   ;;             :suite 'lisp-stat-unittests::lisp-stat-ut-proto))
266 #+end_src
268 *** TODO [#B] Regression Tests
269     - State "TODO"       from ""           [2010-10-12 Tue 13:54]
271     By regression tests, we refer to tests which focus on probing a
272     range of high level interactions.  The test skeleton should focus
273     on managing complex interactions which are reasonable.  
275 *** TODO [#B] Functional Tests
276     - State "TODO"       from ""           [2010-10-12 Tue 13:54]
278 ** CURR [#B] Functional Examples that need to work [1/3]
279    - State "CURR"       from "TODO"       [2010-11-30 Tue 17:57]
280    - State "TODO"       from ""           [2010-10-12 Tue 13:55]
282    These examples should be functional forms within CLS, describing
283    working functionality which is needed for work.
284 *** TODO [#A] Dataframe creation
285     Illustration via a file, that we need to get working so that we
286     can get data in-and-out of CLS structures.
288 #+BEGIN_SRC lisp :export examples/example-DF-creation.lisp
289   ;;; -*- mode: lisp -*-
290   ;;; Copyright (c) 2006-2012, by A.J. Rossini <blindglobe@gmail.com>
291   ;;; See COPYRIGHT file for any additional restrictions (BSD license).
292   ;;; Since 1991, ANSI was finally finished.  Edited for ANSI Common Lisp. 
293   
294   ;;; Time-stamp: <2012-10-04 02:16:45 tony>
295   ;;; Creation:   <2012-07-01 11:29:42 tony>
296   ;;; File:       example.lisp
297   ;;; Author:     AJ Rossini <blindglobe@gmail.com>
298   ;;; Copyright:  (c) 2012, AJ Rossini.  BSD.
299   ;;; Purpose:    example of possible usage.
300   
301   ;;; What is this talk of 'release'? Klingons do not make software
302   ;;; 'releases'.  Our software 'escapes', leaving a bloody trail of
303   ;;; designers and quality assurance people in its wake.
304   
305   
306   ;; Load system
307   (ql:quickload "cls")
308   
309   ;; use the example package...
310   (in-package :cls-user)
311   
312   
313   ;; or better yet, create a package/namespace for the particular problem being attacked.
314   (defpackage :my-package-user
315     (:documentation "demo of how to put serious work should be placed in
316       a similar package elsewhere for reproducibility.  This hints as to
317       what needs to be done for a user- or analysis-package.")
318     (:nicknames :my-clswork-user)
319     (:use :common-lisp ; always needed for user playgrounds!
320           :lisp-matrix ; we only need the packages that we need...
321           :common-lisp-statistics
322           :lisp-stat-data-examples) ;; this ensures access to a data package
323     (:export summarize-data summarize-results this-data this-report)
324     (:shadowing-import-from :lisp-stat call-method call-next-method
325   
326         expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan
327         asin acos atan sinh cosh tanh asinh acosh atanh float random
328         truncate floor ceiling round minusp zerop plusp evenp oddp 
329         < <= = /= >= > > ;; complex
330         conjugate realpart imagpart phase
331         min max logand logior logxor lognot ffloor fceiling
332         ftruncate fround signum cis
333   
334         <= float imagpart)) 
335   
336   (in-package :my-clswork-user)
337   
338   ;; create some data by hand using arrays, and demonstrate access. 
339   
340   (let ((myArray #2A((1 2 3)(4 5 6)))
341         (myDF    (make-dataframe #2A((1 2 3)(4 5 6))))
342         (myLOL   (list (list 1 2 3) (list 4 5 6)))
343         ;; FIXME: listoflist conversion does not work.
344         ;; (myDFlol (make-dataframe  '(list ((1 2 3)(4 5 6)))))
345         )
346   
347     (= (xref myArray 1 1)
348        (xref myDF    1 1)
349        (xref myLOL   1 1)))
350   
351 #+END_SRC
352 *** TODO [#B] Scoping with datasets
353     - State "TODO"       from ""           [2010-11-04 Thu 18:46]
355     The following needs to work, and a related syntax for resampling
356     and similar synthetic data approaches (bootstrapping, imputation)
357     ought to use similar syntax as well.
358 #+name: DataSetNameScoping
359 #+begin_src lisp
360   (in-package :ls-user)
361   (progn
362     ;; Syntax examples using lexical scope, closures, and bindings to
363     ;; ensure a clean communication of results
364     ;; This is actually a bit tricky, since we need to clarify whether
365     ;; it is line-at-a-time that we are considering or if there is
366     ;; another mapping strategy.  In particular, one could imagine a
367     ;; looping-over-observations function, or a
368     ;; looping-over-independent-observations function which leverages a
369     ;; grouping variable which provides guidance for what is considered
370     ;; independent from the sampling frame being considered. The frame
371     ;; itself (definable via some form of metadata to clarify scope?)
372     ;; could clearly provide a bit of relativity for clarifying what
373     ;; statistical independence means.
374     
375     (with-data dataset ((dsvarname1 [usevarname1])
376                         (dsvarname2 [usevarname2]))
377         @body)
378   
379     ;; SAS-centric approach to spec'ing work 
380     (looping-over-observations
381        dataset ((dsvarname1 [usevarname1])
382                 (dsvarname2 [usevarname2]))
383          @body)
384   
385     ;; SAS plus "statistical sensibility"... for example, if an
386     ;; independent observation actually consists of many observations so
387     ;; that a dataframe of independence results -- for example,
388     ;; longitudinal data or spatial data or local-truncated network data
389     ;; are clean examples of such happening -- then we get the data
390     ;; frame or row representing the independent result.
391     (looping-over-independent-observations
392        dataset independence-defining-variable
393          ((dsvarname1 [usevarname1])
394           (dsvarname2 [usevarname2]))
395          @body)
396     )
397 #+end_src
399 *** DONE [#B] Dataframe variable typing
400     - State "DONE"       from "CURR"       [2010-11-30 Tue 17:56] \\
401       check-type approach works, we would just have to throw a catchable
402       error if we want to use it in a reliable fashion.
403     - State "CURR"       from "TODO"       [2010-11-30 Tue 17:56]
404     - State "TODO"       from ""           [2010-11-04 Thu 18:48]
406     Seems to generally work, need to ensure that we use this for
407     appropriate typing.
409 #+name: DFvarTyping
410 #+begin_src lisp
411   (in-package :ls-user)
412   (defparameter *df-test*
413     (make-instance 'dataframe-array
414                    :storage #2A (('a "test0" 0 0d0)
415                                  ('b "test1" 1 1d0)
416                                  ('c "test2" 2 2d0)
417                                  ('d "test3" 3 3d0)
418                                  ('e "test4" 4 4d0))
419                    :doc "test reality"
420                    :case-labels (list "0" "1" 2 "3" "4")
421                    :var-labels (list "symbol" "string" "integer" "double-float")
422                    :var-types (list 'symbol 'string 'integer 'double-float)))
423   
424   ;; with SBCL, ints become floats?  Need to adjust output
425   ;; representation appropriately..
426   ,*df-test* 
427   
428   (defun check-var (df colnum)
429     (let ((nobs (xdim (dataset df) 0)))
430       (dotimes (i nobs)
431         (check-type (xref df i colnum) (elt (var-types df) i)))))
432   
433   (xdim (dataset *df-test*) 1)
434   (xdim (dataset *df-test*) 0)
435   
436   (check-var *df-test* 0)
437   
438   (class-of
439     (xref *df-test* 1 1))
440   
441   (check-type (xref *df-test* 1 1)
442               string) ;; => nil, so good.
443   (check-type (xref *df-test* 1 1)
444               vector) ;; => nil, so good.
445   (check-type (xref *df-test* 1 1)
446               real) ;; => simple-error type thrown, so good.
447   
448   ;; How to nest errors within errors?
449   (check-type (check-type (xref *df-test* 1 1) real) ;; => error thrown, so good.
450               simple-error)
451   (xref *df-test* 1 2)
452   
453   (check-type *df-test*
454               dataframe-array) ; nil is good.
455   
456   (integerp (xref *df-test* 1 2))
457   (floatp (xref *df-test* 1 2))
458   (integerp (xref *df-test* 1 3))
459   (type-of (xref *df-test* 1 3))
460   (floatp (xref *df-test* 1 3))
461   
462   (type-of (vector 1 1d0))
463   (type-of *df-test*)
464   
465   (xref *df-test* 2 1)
466   (xref *df-test* 0 0)
467   (xref *df-test* 1 0)
468   (xref *df-test* 1 '*)
469 #+end_src
470   
471 ** CURR [#A] Random Numbers [2/6]
472    - State "CURR"       from "TODO"       [2010-11-05 Fri 15:41]
473    - State "TODO"       from ""           [2010-10-14 Thu 00:12]
475    Need to select and choose a probability system (probability
476    functions, random numbers).  Goal is to have a general framework
477    for representing probability functions, functionals on
478    probabilities, and reproducible random streams based on such
479    numbers. 
480 *** CURR [#B] CL-VARIATES system evaluation [2/3]
481     - State "CURR"       from "TODO"       [2010-11-05 Fri 15:40]
482     - State "TODO"       from ""           [2010-10-12 Tue 14:16]
483     
484     CL-VARIATES is a system developed by Gary W King.  It uses streams
485     with seeds, and is hence reproducible.  (Random comment: why do CL
486     programmers as a class ignore computational reproducibility?)
488     The main problem with this system is licensing.  It has a weird
489     licensing schema which prevents 
491 #+name: Loading-CL-VARIATES
492 #+begin_src lisp
493   (in-package :cl-user)
494   (ql:quickload :cl-variates)
495   ;;(ql:quickload :cl-variates-test)
496 #+end_src
498 #+name: CL-VARIATES-UNITTESTS
499 #+begin_src lisp
500   (in-package :cl-variates-test)
501   ;; check tests
502   (run-tests :suite 'cl-variates-test)
503   (describe (run-tests :suite 'cl-variates-test))
504 #+end_src
506     basic example of reproducible draws from the uniform and normal
507     random number streams.
509 #+name: CL-VARIATES-REPRO
510 #+begin_src lisp
511   
512   (in-package :cl-variates-user)
513   
514   (defparameter state (make-random-number-generator))
515   (setf (random-seed state) 44)
516   
517   (random-seed state)
518   (loop for i from 1 to 10 collect
519                     (random-range state 0 10))
520   ;; => (1 5 1 0 7 1 2 2 8 10)
521   (setf (random-seed state) 44)
522   (loop for i from 1 to 10 collect
523                     (random-range state 0 10))
524   ;; => (1 5 1 0 7 1 2 2 8 10)
525   
526   (setf (random-seed state) 44)
527   (random-seed state)
528   (loop for i from 1 to 10 collect
529                     (normal-random state 0 1))
530   ;; => 
531   ;; (-1.2968656102820426 0.40746363934173213 -0.8594712469518473 0.8795681301148328
532   ;;  1.0731526250004264 -0.8161629082481728 0.7001813608754809 0.1078045427044097
533   ;;  0.20750134211656893 -0.14501914108452274)
534   
535   (setf (random-seed state) 44)
536   (loop for i from 1 to 10 collect
537                     (normal-random state 0 1))
538   ;; => 
539   ;; (-1.2968656102820426 0.40746363934173213 -0.8594712469518473 0.8795681301148328
540   ;;  1.0731526250004264 -0.8161629082481728 0.7001813608754809 0.1078045427044097
541   ;;  0.20750134211656893 -0.14501914108452274)
542   
543 #+end_src
545 **** CURR [#B] Full example of general usage 
546      - State "CURR"       from "TODO"       [2010-11-05 Fri 15:40]
547      - State "TODO"       from ""           [2010-11-05 Fri 15:40]
549      What we want to do here is describe the basic available API that
550      is present.  So while the previous work describes what the basic
551      reproducibility approach would be in terms of generating lists of
552      reproducible pRNG streams, we need the full range of possible
553      probability laws that are present. 
555      One of the good things about cl-variates is that it provides for
556      reproducibility.  One of the bad things is that it has a mixed
557      bag for an API.
559 *** TODO [#B] CL-RANDOM system evaluation
560     - State "TODO"       from ""           [2010-11-05 Fri 15:40]
562     Problems:
563     1. no seed setting for random numbers
564     2. contamination of a probability support with optimization and
565        linear algebra.
567     Positives:
568     1. good code
569     2. nice design for generics.
570        
571 *** TODO [#B] Native CLS (from XLS)
572     - State "TODO"       from ""           [2010-11-05 Fri 15:40]
573       
574 ** TODO [#B] Numerical Linear Algebra [0/3]
575    - State "TODO"       from ""           [2010-10-14 Thu 00:12]
577 *** TODO [#B] LLA evaluation
578     - State "TODO"       from ""           [2010-10-12 Tue 14:13]
580 LLA is an SBCL targetted linear algebra library from Tamas Papp
582 #+NAME LLA-experiments
583 #+BEGIN_SRC lisp
584 (in-package :cl-user)
585 (asdf:oos 'asdf:load-op 'lla)
586 (in-package :lla-user)
587 ;;; experiment here
588 #+END_SRC
590 *** CURR [#B] Lisp-Matrix system evaluation
591     - State "CURR"       from "TODO"       [2010-10-12 Tue 14:13]
592     - State "TODO"       from ""           [2010-10-12 Tue 14:13]
594       in progress
596 *** TODO [#B] LispLab system evaluation
597     - State "TODO"       from ""           [2010-10-12 Tue 14:13]
599 LL is an SBCL targetted linear algebra library from ---
601 ** TODO [#B] Numerical Statistical Procedures to implement
603    By this, I mean procedures which provide numerical quantitative or
604    precise categorical qualitative results (for example, excluding
605    visualizations, which tend to produce very useful but relatively
606    imprecise actionable insights).
608 *** CURR [#A] Basic Descriptives
610 *** TODO [#C] PFIM 
612 #+BEGIN_SRC lisp
614 (in-package :cls-user)
615 ;;;; PFIM notes
617 ;; PFIM 3.2 
619 ;; population design eval and opt
620 #| 
621 issues: 
622 - # individuals
623 - # sampling times
624 - sampling times?
626 constraints:
627 number of samples/cost of lab analysis and collection
628 expt constraints
631 (defun pfim (&key model ( constraints ( summary-function )
633   (list num-subjects num-times list-times))))
636 N individuals i
637 Each individal has a deisgn psi_i
638    nubmer of samples n_i and sampling times t_{i{1}} t_{i{n_1}}
639    individuals can differ
641 Model:
643 individual-level model 
646 (=model y_i (+ (f \theta_i \psi_i) epsilion_i ))
647 (=var \epsilion_i \sigma_between \sigma_within  )
649 ;; Information Matrix for pop deisgn 
651 (defparameter IM (sum  (i 1 N) (MF \psi_i \phi_i)))
654 For nonlinear structureal models, expand around RE=0
656 Cramer-Rao : MF^{-1} is lower bound for estimation variance.
658 Design comparisons: 
660 - smallest SE, but is a matrix, so
661 - criteria for matrix comparison
662 -- D-opt, (power (determinant MF) (/ 1 P))
665 find design maxing D opt, (power (determinant MF) (/ 1 P))
666 Design varialables 
667  -- contin vars for smapling times within interval or set -- number of groups for cat vars
669 Stat in Med 2009, expansion around post-hoc RE est, not necessarily zero.
671 Example binary covariate C
674 (if (= i reference-class) 
675     (setf (aref C i) 0)
676     (setf (aref C i) 1))
678 ;; Exponential RE,
679 (=model (log \theta) (  ))
681 ;; extensions
683 ;; outputs
686 PFIM provides for a given design and values of \beta: 
687  compute extended FIM
688  SE/RSE for \beta of each class of each covar
689  eval influence of design on SE(\beta)
691 inter-occassion variability (IOV)
692 - patients sampled more than once, H occassions
693 - RE for IOV
694 - additional vars to estimate
698 ;;; comparison criteria
700 functional of conc/time curve which is used for comparison, i.e. 
701 (AUC conc/time-curve)
702 (Cmax conc/time-curve)
703 (Tmax conc/time-curve)
705 where 
707 (defun conc/time-curve (t) 
708   ;; computation
709 #| 
710   (let ((conc (exp (* t \beta1))))
711      conc)
713   )
715 ;;See
716 (url-get "www.pfim.biostat.fr")
719 ;;; Thinking of generics...
720 (information-matrix model parameters)
721 (information-matrix variance-matrix)
722 (information-matrix model data)
723 (information-matrix list-of-individual-IMs)
726 (defun IM (loglikelihood parameters times)
727   "Does double work.  Sum up the resulting IMs to form a full IM."
728   (let ((IM (make-matrix (length parameters)
729                          (length parameters)
730                          :initial-value 0.0d0)))
731     (dolist (parameterI parameters)
732       (dolist (parameterJ parameters)
733         (setf (aref IM I J)
734               (differentiate (differentiate loglikelihood parameterI) parameterJ))))))
735 #+END_SRC
737 *** TODO [#C] difference between empirical, fisherian, and ...? information.
738 *** TODO [#C] Example of Integration with CL-GENOMIC
739     - State "TODO"       from ""           [2010-10-12 Tue 14:03]
740     
741     CL-GENOMIC is a very interesting data-structure strategy for
742     manipulating sequence data.
744 #+name: CL-GENOMIC
745 #+begin_src lisp
746     (in-package :cl-user)
747     (asdf:oos 'asdf:compile-op :ironclad)
748     (asdf:oos 'asdf:load-op :cl-genomic)
750     (in-package :bio-sequence)
751     (make-dna "agccg") ;; fine
752     (make-aa "agccg")  ;; fine
753     (make-aa "agc9zz") ;; error expected
754 #+end_src
756 ** TODO [#A] Visual data analytic methods [0/10]
757 *** TODO [#B] Evaluate Graphics toolkits [0/3]
759 **** TODO [#B] QT and similar tools
761      Pros: Insight from Deepyan Saarkar and Mike -- super fast plot
762      routines for dynamic interactive graphics.  Crossplatform.
764      Common-QT, or ??
766 **** TODO [#B] Cairo-based
768      Pros: actually have example lattice/trellis plotting system with
769      Tamas Papp's cl-2d based on cl-cairo2.
771      Con: cross-platform?  setup on a mac?
773 **** TODO [#C] Others?
775      increase priority if someone cares enough to code
777 *** TODO [#A] Evaluate APIs, methods, designs, back-end into framework [0/2]
778     By this, I mean that we need a good proposal, and it should be
779     based on history.  I need to email Paul Murrell and Deepyan and
780     Hadley for a "lessons learned in statistical graphics systems".  
781 **** TODO [#B] Paul Murrell's core R system (grid?)
783 **** TODO [#B] Peter Siebel's Grammer of Graphics javascript implementation
784      Thanks Peter Schmiedeskamp for pointing this out.
786 *** TODO [#B] Implement Visualization routines [0/2]
787     This should happen one-two times.  Remember, with the package
788     approach, we can try out new packages and continually build newer
789     ones, as long as we appropriately version the interface for user
790     selection purposes.
791 **** TODO [#A] actual statistical graphics
792      we need functions to x-y plots, bar charts, and need the API to
793      describe in terms of statistical quantities, scatter plots,
794      etc.
796      Also, will be important to get prototypes working ASAP to get
797      testing and feedback.  But remember, not all users want what is
798      good for them, just like not all people "honestly prefer"
799      completely healthy approaches to life.
801       See file:README.org and the Philosophy for background for the
802       above. 
804 **** TODO [#C] Statistical toolkit and pipeline, ala ORCA 
806      Orca (sutherland, cook, lumley, rossini, etal) was a java based
807      toolkit for pipelined DAG representations of interactive dynamic
808      graphics.
810 ** TODO [#B] Documentation and Examples [0/3]
811    - State "TODO"       from ""           [2010-10-14 Thu 00:12]
813    I've started putting examples of use in function documentation.  If
814    you are a lisp'er, you'll find this pendantic and insulting.  Many
815    of the uses are trivial.  However, this has been tested out on a
816    number of research statisticians (the primary user audience) and
817    found useful.
819    Still need to write the 
821 #+BEGIN_SRC lisp
822   (evaluate-documentation-example 'function-name)
823 #+END_SRC
825    function, which would print out the example and run it live.
826    Hopefully with the same results.  Need to setup the infrastructure,
827    but basically, we'd like something like:
829 #+name: Example-InLineDoc
830 #+begin_src lisp
831   (cls-example-progn
832       (example-code-for-function-1)
833       (example-code-for-function-...)
834       (example-code-for-function-n))
835 #+end_src
837    and have this within the doc-string.  Then the doc-string would be
838    parsed for the appropriate code and we'd get the results, evaluated
839    in a special name space derived from the object (function, class)
840    name, possibly with the corresponding functions and environment
841    set up that would be required.  OR, it could just work in cl-user
842    (which is the default starting location.
844    Here are some possible common lisp systems that could be
845    evaluated:
847 *** TODO [#B] Docudown
848     - State "TODO"       from ""           [2010-11-05 Fri 15:34]
850 *** TODO [#A] CLDOC
851     - State "TODO"       from ""           [2010-11-05 Fri 15:34]
853 *** TODO [#B] CLPDF, and literate data analysis
854     - State "TODO"       from ""           [2010-11-05 Fri 15:34]
856 * Proposals
857   Place proposals for features, work, etc here...
858 ** <2011-12-29 Thu> new stuff
859    First new proposal is to track proposals.
861 * Rejoinder
863   This project is dedicated to all the lisp hackers out there who
864   provided the basic infrastructure to get so far so fast with minimal
865   effort on my part.
867   And to all the people trying to help to get this off the ground.