export the right API for listoflist. Whoops!
[CommonLispStat.git] / TODO.lisp
blobec022c9082e1e8441a5b14b90b48828c5b70a388
1 ;;; -*- mode: lisp -*-
3 ;;; Time-stamp: <2009-04-15 16:34: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)
20 ;;(asdf:oos 'asdf:load-op 'lisp-matrix)
21 ;;(asdf:oos 'asdf:compile-op 'lispstat)
22 ;;(asdf:oos 'asdf:load-op 'lispstat)
24 (in-package :lisp-stat-unittests)
26 ;; tests = 80, failures = 8, errors = 15
27 (run-tests :suite 'lisp-stat-ut)
28 (describe (run-tests :suite 'lisp-stat-ut))
30 ;; FIXME: Example: currently not relevant, yet
31 ;; (describe (lift::run-test :test-case 'lisp-stat-unittests::create-proto
32 ;; :suite 'lisp-stat-unittests::lisp-stat-ut-proto))
34 (describe 'lisp-stat-ut)
36 (in-package :ls-user)
38 (progn ;; FIXME: Regression modeling (some data future-ish)
40 (defparameter *m*
41 (regression-model (list->vector-like iron) ;; BROKEN
42 (list->vector-like absorbtion))
43 "holding variable.")
45 (defparameter *m-fit*
46 (fit-model *m*))
49 (princ *m*)
50 (princ *m-fit*)
52 (estimates *m-fit*)
53 (covariance-matrix *m-fit*)
55 (defparameter *m3*
56 (regression-model (listoflist->matrix-like (list iron aluminum))
57 (list->vector-like absorbtion) :print nil))
58 (defparameter *m3-fit*
59 (fit-model *m3*))
63 #+nil
64 (progn ;; FIXME: Need to clean up data examples, licenses, attributions, etc.
65 ;; The following breaks because we should use a package to hold
66 ;; configuration details, and this would be the only package outside
67 ;; of packages.lisp, as it holds the overall defsystem structure.
68 (load-data "iris.lsp") ;; (the above partially fixed).
69 (variables)
70 diabetes )
73 (progn ;; dataframe
75 (describe (lift::run-tests :suite 'lisp-stat-ut-dataframe))
76 (lift::run-tests :suite 'lisp-stat-ut-dataframe)
78 (describe
79 (lift::run-test
80 :test-case 'lisp-stat-unittests::create-proto
81 :suite 'lisp-stat-unittests::lisp-stat-ut-proto))
83 (defparameter *my-df-1*
84 (make-instance 'dataframe-array
85 :storage #2A((1 2 3 4 5)
86 (10 20 30 40 50))
87 :doc "This is an interesting dataframe-array"
88 :case-labels (list "x" "y")
89 :var-labels (list "a" "b" "c" "d" "e")))
91 (setf (dfref *my-df-1* 0 0) -1d0)
95 (make-dataframe #2A((1 2 3 4 5)
96 (10 20 30 40 50)))
98 (make-dataframe (rand 4 3))
101 (equalp (dataset
102 (make-instance 'dataframe-array
103 :storage #2A(('a 'b)
104 ('c 'd))))
105 #2A(('a 'b)
106 ('c 'd)) )
108 (equalp (dataset
109 (make-instance 'dataframe-array
110 :storage #2A((1 2)
111 (3 4))))
112 #2A((1 2)
113 (3 4)))
115 (equalp (dataset
116 (make-instance 'dataframe-array
117 :storage #2A((1d0 2d0)
118 (3d0 4d0))))
119 #2A((1d0 2d0)
120 (3d0 4d0)))
123 (defparameter *my-df-1*
124 (make-dataframe #2A((1 2 3 4 5)
125 (10 20 30 40 50))
126 :caselabels (list "x" "y")
127 :varlabels (list "a" "b" "c" "d" "e")
128 :doc "This is an interesting dataframe-array"))
130 (caselabels *my-df-1*)
131 (varlabels *my-df-1*)
134 (defparameter *my-df-2*
135 (make-instance 'dataframe-array
136 :storage
137 (make-array-from-listoflists
138 (cybertiggyr-dsv::load-escaped
139 "/media/disk/Desktop/sandbox/CLS.git/Data/example-mixed.csv"))
140 :doc "This is an interesting dataframe-array"))
141 #| :case-labels (list "x" "y")
142 :var-labels (list "a" "b" "c" "d" "e")
148 (progn ;; Data setup
150 (describe 'make-matrix)
152 (defparameter *indep-vars-2-matrix*
153 (make-matrix (length iron) 2
154 :initial-contents
155 (mapcar #'(lambda (x y)
156 (list (coerce x 'double-float)
157 (coerce y 'double-float)))
158 iron aluminum)))
161 (defparameter *dep-var*
162 (make-vector (length absorbtion)
163 :type :row
164 :initial-contents
165 (list
166 (mapcar #'(lambda (x) (coerce x 'double-float))
167 absorbtion))))
169 (make-dataframe *dep-var*)
170 (make-dataframe (transpose *dep-var*))
172 (defparameter *dep-var-int*
173 (make-vector (length absorbtion)
174 :type :row
175 :element-type 'integer
176 :initial-contents (list absorbtion)))
179 (defparameter *xv+1a*
180 (make-matrix
182 :initial-contents #2A((1d0 1d0)
183 (1d0 3d0)
184 (1d0 2d0)
185 (1d0 4d0)
186 (1d0 3d0)
187 (1d0 5d0)
188 (1d0 4d0)
189 (1d0 6d0))))
191 (defparameter *xv+1b*
192 (bind2
193 (ones 8 1)
194 (make-matrix
196 :initial-contents '((1d0)
197 (3d0)
198 (2d0)
199 (4d0)
200 (3d0)
201 (5d0)
202 (4d0)
203 (6d0)))
204 :by :column))
206 (m= *xv+1a* *xv+1b*) ; => T
208 (princ "Data Set up"))
213 (progn
214 ;; REVIEW: general Lisp use guidance
216 (fdefinition 'make-matrix)
217 (documentation 'make-matrix 'function)
219 #| Examples from CLHS, a bit of guidance.
221 ;; This function assumes its callers have checked the types of the
222 ;; arguments, and authorizes the compiler to build in that assumption.
223 (defun discriminant (a b c)
224 (declare (number a b c))
225 "Compute the discriminant for a quadratic equation."
226 (- (* b b) (* 4 a c))) => DISCRIMINANT
227 (discriminant 1 2/3 -2) => 76/9
229 ;; This function assumes its callers have not checked the types of the
230 ;; arguments, and performs explicit type checks before making any assumptions.
231 (defun careful-discriminant (a b c)
232 "Compute the discriminant for a quadratic equation."
233 (check-type a number)
234 (check-type b number)
235 (check-type c number)
236 (locally (declare (number a b c))
237 (- (* b b) (* 4 a c)))) => CAREFUL-DISCRIMINANT
238 (careful-discriminant 1 2/3 -2) => 76/9
246 (progn ;; FIXME: read data from CSV file. To do.
249 ;; challenge is to ensure that we get mixed arrays when we want them,
250 ;; and single-type (simple) arrays in other cases.
253 (defparameter *csv-num*
254 (cybertiggyr-dsv::load-escaped
255 #p"/media/disk/Desktop/sandbox/CLS.git/Data/example-numeric.csv"
256 :field-separator #\,
257 :trace T))
259 (nth 0 (nth 0 *csv-num*))
261 (defparameter *csv-num*
262 (cybertiggyr-dsv::load-escaped
263 #p"/media/disk/Desktop/sandbox/CLS.git/Data/example-numeric2.dsv"
264 :field-separator #\:))
266 (nth 0 (nth 0 *csv-num*))
269 ;; The handling of these types should be compariable to what we do for
270 ;; matrices, but without the numerical processing. i.e. mref, bind2,
271 ;; make-dataframe, and the class structure should be similar.
273 ;; With numerical data, there should be a straightforward mapping from
274 ;; the data.frame to a matrix. With categorical data (including
275 ;; dense categories such as doc-strings, as well as sparse categories
276 ;; such as binary data), we need to include metadata about ordering,
277 ;; coding, and such. So the structures should probably consider
279 ;; Using the CSV file:
281 (defun parse-number (s)
282 (let* ((*read-eval* nil)
283 (n (read-from-string s)))
284 (if (numberp n) n)))
286 (parse-number "34")
287 (parse-number "34 ")
288 (parse-number " 34")
289 (parse-number " 34 ")
291 (+ (parse-number "3.4") 3)
292 (parse-number "3.4 ")
293 (parse-number " 3.4")
294 (+ (parse-number " 3.4 ") 3)
296 (parse-number "a")
298 ;; (coerce "2.3" 'number) => ERROR
299 ;; (coerce "2" 'float) => ERROR
301 (defparameter *csv-num*
302 (cybertiggyr-dsv::load-escaped
303 #p"/media/disk/Desktop/sandbox/CLS.git/Data/example-numeric.csv"
304 :field-separator #\,
305 :filter #'parse-number
306 :trace T))
308 (nth 0 (nth 0 *csv-num*))
310 (defparameter *csv-num*
311 (cybertiggyr-dsv::load-escaped
312 #p"/media/disk/Desktop/sandbox/CLS.git/Data/example-numeric2.dsv"
313 :field-separator #\:
314 :filter #'parse-number))
316 (nth 0 (nth 0 *csv-num*))
318 ;; now we've got the DSV code in the codebase, auto-loaded I hope:
319 cybertiggyr-dsv:*field-separator*
320 (defparameter *example-numeric.csv*
321 (cybertiggyr-dsv:load-escaped "Data/example-numeric.csv"
322 :field-separator #\,))
323 *example-numeric.csv*
325 ;; the following fails because we've got a bit of string conversion
326 ;; to do. 2 thoughts: #1 modify dsv package, but mucking with
327 ;; encapsulation. #2 add a coercion tool (better, but potentially
328 ;; inefficient).
329 #+nil(coerce (nth 3 (nth 3 *example-numeric.csv*)) 'double-float)
331 ;; cases, simple to not so
332 (defparameter *test-string1* "1.2")
333 (defparameter *test-string2* " 1.2")
334 (defparameter *test-string3* " 1.2 ")
338 #+nil
339 (progn ;; experiments with GSL and the Lisp interface.
340 (asdf:oos 'asdf:load-op 'gsll)
341 (asdf:oos 'asdf:load-op 'gsll-tests)
343 ;; the following should be equivalent
344 (setf *t1* (LIST 6.18d0 6.647777777777779d0 6.18d0))
345 (setf *t2* (MULTIPLE-VALUE-LIST
346 (LET ((VEC
347 (gsll:make-marray 'DOUBLE-FLOAT
348 :INITIAL-CONTENTS '(-3.21d0 1.0d0 12.8d0)))
349 (WEIGHTS
350 (gsll:MAKE-MARRAY 'DOUBLE-FLOAT
351 :INITIAL-CONTENTS '(3.0d0 1.0d0 2.0d0))))
352 (LET ((MEAN (gsll:MEAN VEC)))
353 (LIST (gsll:ABSOLUTE-DEVIATION VEC)
354 (gsll:WEIGHTED-ABSOLUTE-DEVIATION VEC WEIGHTS)
355 (gsll:ABSOLUTE-DEVIATION VEC MEAN))))))
356 (eql *t1* *t2*)
358 ;; from (gsll:examples 'gsll::numerical-integration) ...
359 (gsll:integration-qng gsll::one-sine 0.0d0 PI)
361 (gsll:defun-single axpb (x) (+ (* 2 x) 3)) ;; a<-2, b<-3
362 (gsll:integration-qng axpb 1d0 2d0)
364 (let ((a 2)
365 (b 3))
366 (defun-single axpb2 (x) (+ (* a x) b)))
367 (gsll:integration-qng axpb2 1d0 2d0)
369 ;; BAD
370 ;; (gsll:integration-qng
371 ;; (let ((a 2)
372 ;; (b 3))
373 ;; (defun-single axpb2 (x) (+ (* a x) b)))
374 ;; 1d0 2d0)
376 ;; right, but weird expansion...
377 (gsll:integration-qng
378 (let ((a 2)
379 (b 3))
380 (defun axpb2 (x) (+ (* a x) b))
381 (gsll:def-single-function axpb2)
382 axpb2)
383 1d0 2d0)
385 ;; Linear least squares
387 (gsll:gsl-lookup "gsl_linalg_LU_decomp") ; => gsll:lu-decomposition
388 (gsll:gsl-lookup "gsl_linalg_LU_solve") ; => gsll:lu-solve
393 #+nil
394 (progn ;; philosophy time
396 (setf my-model (model :name "ex1"
397 :data-slots (list w x y z)
398 :param-slots (list alpha beta gamma)
399 :math-form (regression-model :formula '(= w (+ (* beta x)
400 (* alpha y)
401 (* gamma z)
402 normal-error))
403 :centrality 'median ; 'mean
406 #| or:
407 #R"W ~ x+ y + z "
410 (setf my-dataset (statistical-table :table data-frame-contents
411 :metadata (list (:case-names (list ))
412 (:var-names (list ))
413 (:documentation "string of doc"))))
415 (setf my-analysis (analysis
416 :model my-model
417 :data my-dataset
418 :parameter-map (pairing (model-param-slots my-model)
419 (data-var-names my-dataset))))
421 ;; ontological implications -- the analysis is an abstract class of
422 ;; data, model, and mapping between the model and data. The fit is
423 ;; the instantiation of such. This provides a statistical object
424 ;; computation theory which can be realized as "executable
425 ;; statistics" or "computable statistics".
426 (setf my-analysis (analyze my-fit
427 :estimation-method 'linear-least-squares-regression))
429 ;; one of the tricks here is that one needs to provide the structure
430 ;; from which to consider estimation, and more importantly, the
431 ;; validity of the estimation.
434 (setf linear-least-squares-regression
435 (estimation-method-definition
436 :variable-defintions ((list
437 ;; from MachLearn: supervised,
438 ;; unsupervised
439 :data-response-vars list-drv ; nil if unsup
441 :param-vars list-pv
442 :data-predictor-vars list-dpv
443 ;; nil in this case. these
444 ;; describe "out-of-box" specs
445 :hyper-vars list-hv))
446 :form '(regression-additive-error
447 :central-form (linear-form drv pv dpv)
448 :error-form 'normal-error)
449 :resulting-decision '(point-estimation interval-estimation)
450 :philosophy 'frequentist
451 :documentation "use least squares to fit a linear regression
452 model to data."))
454 (defparameter *statistical-philosophies*
455 '(frequentist bayesian fiducial decision-analysis)
456 "can be combined to build decision-making approaches and
457 characterizations")
459 (defparameter *decisions*
460 '(estimation selection testing)
461 "possible results from a...")
462 ;; is this really true? One can embedded hypothesis testing within
463 ;; estimation, as the hypothesis estimated to select. And
464 ;; categorical/continuous rear their ugly heads, but not really in
465 ;; an essential way.
467 (defparameter *ontology-of-decision-procedures*
468 (list :decisions
469 (list :estimation
470 (list :point
471 (list :maximum-likelihood
472 :minimum-entropy
473 :least-squares
474 :method-of-moments)
475 :interval
476 (list :maximum-likelihood
478 :testing
479 (list :fisherian
480 :neyman-pearson
481 (list :traditional
482 :bioequivalence-inversion)
483 :selection
484 (list :ranking
485 :top-k-of-n-select))
486 :parametric
487 :partially-parametric))
488 "start of ontology"))
491 ;;;; LM
493 (progn
495 (defparameter *y*
496 (make-vector
498 :type :row
499 :initial-contents '((1d0 2d0 3d0 4d0 5d0 6d0 7d0 8d0))))
502 (defparameter *xv+1*
503 (make-matrix
505 :initial-contents '((1d0 1d0)
506 (1d0 3d0)
507 (1d0 2d0)
508 (1d0 4d0)
509 (1d0 3d0)
510 (1d0 5d0)
511 (1d0 4d0)
512 (1d0 6d0))))
515 ;; so something like (NOTE: matrices are transposed to begin with, hence the incongruety)
516 (defparameter *xtx-2* (m* (transpose *xv+1*) *xv+1*))
517 ;; #<LA-SIMPLE-MATRIX-DOUBLE 2 x 2
518 ;; 8.0d0 28.0d0
519 ;; 28.0d0 116.0d0>
521 (defparameter *xty-2* (m* (transpose *xv+1*) (transpose *y*)))
522 ;; #<LA-SIMPLE-VECTOR-DOUBLE (2 x 1)
523 ;; 36.0d0
524 ;; 150.0d0>
526 (defparameter *rcond-2* 0.000001)
527 (defparameter *betahat-2* (gelsy *xtx-2* *xty-2* *rcond-2*))
528 ;; *xtx-2* => "details of complete orthogonal factorization"
529 ;; according to man page:
530 ;; #<LA-SIMPLE-MATRIX-DOUBLE 2 x 2
531 ;; -119.33147112141039d0 -29.095426104883202d0
532 ;; 0.7873402682880205d0 -1.20672274167718d0>
534 ;; *xty-2* => output becomes solution:
535 ;; #<LA-SIMPLE-VECTOR-DOUBLE (2 x 1)
536 ;; -0.16666666666668312d0
537 ;; 1.333333333333337d0>
539 *betahat-2* ; which matches R, see below
541 (documentation 'gelsy 'function)
544 ;; (#<LA-SIMPLE-VECTOR-DOUBLE (2 x 1)
545 ;; -0.16666666666668312 1.333333333333337>
546 ;; 2)
548 ;; ## Test case in R:
549 ;; x <- c( 1.0, 3.0, 2.0, 4.0, 3.0, 5.0, 4.0, 6.0)
550 ;; y <- c( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0)
551 ;; lm(y~x)
552 ;; ## => Call: lm(formula = y ~ x)
554 ;; Coefficients: (Intercept) x
555 ;; -0.1667 1.3333
557 ;; summary(lm(y~x))
558 ;; ## =>
560 ;; Call:
561 ;; lm(formula = y ~ x)
563 ;; Residuals:
564 ;; Min 1Q Median 3Q Max
565 ;; -1.833e+00 -6.667e-01 -3.886e-16 6.667e-01 1.833e+00
567 ;; Coefficients:
568 ;; Estimate Std. Error t value Pr(>|t|)
569 ;; (Intercept) -0.1667 1.1587 -0.144 0.89034
570 ;; x 1.3333 0.3043 4.382 0.00466 **
571 ;; ---
572 ;; Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
574 ;; Residual standard error: 1.291 on 6 degrees of freedom
575 ;; Multiple R-squared: 0.7619, Adjusted R-squared: 0.7222
576 ;; F-statistic: 19.2 on 1 and 6 DF, p-value: 0.004659
580 ;; which suggests one might do (modulo ensuring correct
581 ;; orientations). When this is finalized, it should migrate to
582 ;; CLS.
586 (defparameter *n* 20) ; # rows = # obsns
587 (defparameter *p* 10) ; # cols = # vars
588 (defparameter *x-temp* (rand *n* *p*))
589 (defparameter *b-temp* (rand *p* 1))
590 (defparameter *y-temp* (m* *x-temp* *b-temp*))
591 ;; so Y=Xb + \eps
592 (defparameter *rcond* (* (coerce (expt 2 -52) 'double-float)
593 (max (nrows *x-temp*) (ncols *y-temp*))))
594 (defparameter *orig-x* (copy *x-temp*))
595 (defparameter *orig-b* (copy *b-temp*))
596 (defparameter *orig-y* (copy *y-temp*))
598 (defparameter *lm-result* (lm *x-temp* *y-temp*))
599 (princ (first *lm-result*))
600 (princ (second *lm-result*))
601 (princ (third *lm-result*))
602 (v= (third *lm-result*)
603 (v- (first (first *lm-result*))
604 (first (second *lm-result*))))
609 ;; Some issues exist in the LAPACK vs. LINPACK variants, hence R
610 ;; uses LINPACK primarily, rather than LAPACK. See comments in R
611 ;; source for issues.
614 ;; Goal is to start from X, Y and then realize that if
615 ;; Y = X \beta, then, i.e. 8x1 = 8xp px1 + 8x1
616 ;; XtX \hat\beta = Xt Y
617 ;; so that we can solve the equation W \beta = Z where W and Z
618 ;; are known, to estimate \beta.
620 ;; the above is known to be numerically instable -- some processing
621 ;; of X is preferred and should be done prior. And most of the
622 ;; transformation-based work does precisely that.
624 ;; recall: Var[Y] = E[(Y - E[Y])(Y-E[Y])t]
625 ;; = E[Y Yt] - 2 \mu \mut + \mu \mut
626 ;; = E[Y Yt] - \mu \mut
628 ;; Var Y = E[Y^2] - \mu^2
631 ;; For initial estimates of covariance of \hat\beta:
633 ;; \hat\beta = (Xt X)^-1 Xt Y
634 ;; with E[ \hat\beta ]
635 ;; = E[ (Xt X)^-1 Xt Y ]
636 ;; = E[(Xt X)^-1 Xt (X\beta)]
637 ;; = \beta
639 ;; So Var[\hat\beta] = ...
640 ;; (Xt X)
641 ;; and this gives SE(\beta_i) = (* (sqrt (mref Var i i)) adjustment)
644 ;; from docs:
646 (setf *temp-result*
647 (let ((*default-implementation* :foreign-array))
648 (let* ((m 10)
649 (n 10)
650 (a (rand m n))
651 (x (rand n 1))
652 (b (m* a x))
653 (rcond (* (coerce (expt 2 -52) 'double-float)
654 (max (nrows a) (ncols a))))
655 (orig-a (copy a))
656 (orig-b (copy b))
657 (orig-x (copy x)))
658 (list x (gelsy a b rcond))
659 ;; no applicable conversion?
660 ;; (m- (#<FA-SIMPLE-VECTOR-DOUBLE (10 x 1))
661 ;; (#<FA-SIMPLE-VECTOR-DOUBLE (10 x 1)) )
662 (v- x (first (gelsy a b rcond))))))
665 (princ *temp-result*)
667 (setf *temp-result*
668 (let ((*default-implementation* :lisp-array))
669 (let* ((m 10)
670 (n 10)
671 (a (rand m n))
672 (x (rand n 1))
673 (b (m* a x))
674 (rcond (* (coerce (expt 2 -52) 'double-float)
675 (max (nrows a) (ncols a))))
676 (orig-a (copy a))
677 (orig-b (copy b))
678 (orig-x (copy x)))
679 (list x (gelsy a b rcond))
680 (m- x (first (gelsy a b rcond)))
682 (princ *temp-result*)
685 (defparameter *xv*
686 (make-vector
688 :type :row ;; default, not usually needed!
689 :initial-contents '((1d0 3d0 2d0 4d0 3d0 5d0 4d0 6d0))))
691 (defparameter *y*
692 (make-vector
694 :type :row
695 :initial-contents '((1d0 2d0 3d0 4d0 5d0 6d0 7d0 8d0))))
697 ;; so something like (NOTE: matrices are transposed to begin with, hence the incongruety)
698 (defparameter *xtx-1* (m* *xv* (transpose *xv*)))
699 (defparameter *xty-1* (m* *xv* (transpose *y*)))
700 (defparameter *rcond-in* (* (coerce (expt 2 -52) 'double-float)
701 (max (nrows *xtx-1*)
702 (ncols *xty-1*))))
704 (defparameter *betahat* (gelsy *xtx-1* *xty-1* *rcond-in*))
706 ;; (#<LA-SIMPLE-VECTOR-DOUBLE (1 x 1)
707 ;; 1.293103448275862>
708 ;; 1)
710 ;; ## Test case in R:
711 ;; x <- c( 1.0, 3.0, 2.0, 4.0, 3.0, 5.0, 4.0, 6.0)
712 ;; y <- c( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0)
713 ;; lm(y~x-1)
714 ;; ## =>
715 ;; Call:
716 ;; lm(formula = y ~ x - 1)
718 ;; Coefficients:
719 ;; x
720 ;; 1.293
722 (first *betahat*))
726 #+nil
727 (progn
729 (asdf:oos 'asdf:load-op 'cl-plplot)
731 (plot-ex))
735 (type-of #2A((1 2 3 4 5)
736 (10 20 30 40 50)))
738 (type-of (rand 10 20))
740 (typep #2A((1 2 3 4 5)
741 (10 20 30 40 50))
742 'matrix-like)
744 (typep (rand 10 20) 'matrix-like)
746 (typep #2A((1 2 3 4 5)
747 (10 20 30 40 50))
748 'array)
750 (typep (rand 10 20) 'array)