working through the statistical procedures structure. Unlike R, any new statistical...
[CommonLispStat.git] / TODO.lisp
blob5f5752927242cc323742ce072ea634e98198676f
1 ;;; -*- mode: lisp -*-
3 ;;; Time-stamp: <2009-09-21 22:53:53 tony>
4 ;;; Creation: <2008-09-08 08:06:30 tony>
5 ;;; File: TODO.lisp
6 ;;; Author: AJ Rossini <blindglobe@gmail.com>
7 ;;; Copyright: (c) 2007-2008, AJ Rossini <blindglobe@gmail.com>. BSD.
8 ;;; Purpose: Stuff that needs to be made working sits inside the
9 ;;; progns... This file contains the current challenges to
10 ;;; solve, including a description of the setup and the work
11 ;;; to solve....
13 ;;; What is this talk of 'release'? Klingons do not make software
14 ;;; 'releases'. Our software 'escapes', leaving a bloody trail of
15 ;;; designers and quality assurance people in its wake.
17 ;;; SET UP
19 (in-package :cl-user)
21 (progn
22 (defun init-CLS ()
24 ;; core system
25 ;;(asdf:oos 'asdf:load-op 'lisp-matrix)
26 ;;(asdf:oos 'asdf:compile-op 'cls :force t)
27 (asdf:oos 'asdf:load-op 'cls)
29 ;; visualization
30 (asdf:oos 'asdf:load-op 'cl-cairo2-x11)
31 (asdf:oos 'asdf:load-op 'cl-2d)
33 ;; doc reporting
34 (asdf:oos 'asdf:load-op 'cl-pdf)
35 (asdf:oos 'asdf:load-op 'cl-typesetting))
37 (init-CLS))
39 (in-package :lisp-stat-unittests)
41 ;; tests = 80, failures = 7, errors = 21
42 (run-tests :suite 'lisp-stat-ut)
43 (describe (run-tests :suite 'lisp-stat-ut))
45 (describe 'lisp-stat-ut)
46 (documentation 'lisp-stat-ut 'type)
48 ;; FIXME: Example: currently not relevant, yet
49 ;; (describe (lift::run-test :test-case 'lisp-stat-unittests::create-proto
50 ;; :suite 'lisp-stat-unittests::lisp-stat-ut-proto))
52 (describe (lift::run-tests :suite 'lisp-stat-ut-dataframe))
53 (lift::run-tests :suite 'lisp-stat-ut-dataframe)
55 (describe (lift::run-test
56 :test-case 'lisp-stat-unittests::create-proto
57 :suite 'lisp-stat-unittests::lisp-stat-ut-proto))
59 (in-package :ls-user)
61 ;;; Tasks working on...
63 #+nil
64 (progn
65 ;; use of extension packages supporting versioning and validation of
66 ;; CLOS objects?
67 (asdf:oos 'asdf:load-op 'versioned-objects)
68 (asdf:oos 'asdf:load-op 'validations))
70 #+nil
71 (progn
72 ;; Syntax examples using lexical scope, closures, and bindings to
73 ;; ensure a clean communication of results
74 (with-data dataset ((dsvarname1 [usevarname1])
75 (dsvarname2 [usevarname2]))
76 @body))
79 (defparameter *df-test*
80 (make-instance 'dataframe-array
81 :storage #2A (('a "test0" 0 0d0)
82 ('b "test1" 1 1d0)
83 ('c "test2" 2 2d0)
84 ('d "test3" 3 3d0)
85 ('e "test4" 4 4d0))
86 :doc "test reality"
87 :case-labels (list "0" "1" "2" "3" "4")
88 :var-labels (list "symbol" "string" "integer" "double-float")
89 :var-types (list 'symbol 'string 'integer 'double-float)))
91 *df-test* ; but with SBCL, ints become floats?
93 (defun check-var (df colnum)
94 (let ((nobs (xdim df 0)))
95 (dotimes (i nobs)
96 (check-type (xref df i colnum) (elt (var-types df) i)))))
98 (check-var *df-test* 0)
100 (xref *df-test* 1 2)
102 (integerp (xref *df-test* 1 2))
103 (floatp (xref *df-test* 1 2))
104 (integerp (xref *df-test* 1 3))
105 (type-of (xref *df-test* 1 3))
106 (floatp (xref *df-test* 1 3))
108 (type-of (vector 1 1d0))
112 (loop )
114 (xref *df-test* 2 1)
115 (xref *df-test* 0 0)
116 (xref *df-test* 1 0)
117 (xref *df-test* 1 '*)
119 ;;; Experiments with cl-variates
121 ;; (asdf:oos 'asdf:compile-op 'cl-variates :force t)
122 ;; (asdf:oos 'asdf:compile-op 'cl-variates-test :force t)
123 ;; (asdf:oos 'asdf:load-op 'lift)
124 ;; (asdf:oos 'asdf:load-op 'cl-variates)
125 (asdf:oos 'asdf:load-op 'cl-variates-test)
127 (in-package :cl-variates-test)
128 ;; check tests
129 (run-tests :suite 'cl-variates-test)
130 (describe (run-tests :suite 'cl-variates-test))
132 (in-package :cl-variates-user)
133 ;; example usage
134 (defparameter state (make-random-number-generator))
135 (setf (random-seed state) 44)
136 (random-seed state)
137 (loop for i from 1 to 10 collect
138 (random-range state 0 10))
139 ;; => (1 5 1 0 7 1 2 2 8 10)
140 (setf (random-seed state) 44)
141 (loop for i from 1 to 10 collect
142 (random-range state 0 10))
143 ;; => (1 5 1 0 7 1 2 2 8 10)
145 (setf (random-seed state) 44)
146 (random-seed state)
147 (loop for i from 1 to 10 collect
148 (normal-random state 0 1))
149 ;; =>
150 ;; (-1.2968656102820426 0.40746363934173213 -0.8594712469518473 0.8795681301148328
151 ;; 1.0731526250004264 -0.8161629082481728 0.7001813608754809 0.1078045427044097
152 ;; 0.20750134211656893 -0.14501914108452274)
154 (setf (random-seed state) 44)
155 (loop for i from 1 to 10 collect
156 (normal-random state 0 1))
157 ;; =>
158 ;; (-1.2968656102820426 0.40746363934173213 -0.8594712469518473 0.8795681301148328
159 ;; 1.0731526250004264 -0.8161629082481728 0.7001813608754809 0.1078045427044097
160 ;; 0.20750134211656893 -0.14501914108452274)
163 ;;; experiments with LLA
164 (in-package :cl-user)
165 (asdf:oos 'asdf:load-op 'lla)