consider the possibility thast we use matrix-like as a dataframe store.
[CommonLispStat.git] / TODO.lisp
blobd0adbebfa98d88b05421d23865d9000e22b82558
1 ;;; -*- mode: lisp -*-
3 ;;; Time-stamp: <2009-03-27 08:04:27 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 progns...
10 ;;; What is this talk of 'release'? Klingons do not make software
11 ;;; 'releases'. Our software 'escapes', leaving a bloody trail of
12 ;;; designers and quality assurance people in its wake.
14 ;;; This file contains the current challenges to solve, including a
15 ;;; description of the setup and the work to solve....
17 ;;; SET UP
19 (in-package :cl-user)
20 ;;(asdf:oos 'asdf:compile-op 'lispstat)
21 ;;(asdf:oos 'asdf:load-op 'lispstat)
23 (in-package :lisp-stat-unittests)
25 ;; tests = 87, failures = 7, errors = 35
27 (describe (run-tests :suite 'lisp-stat-ut))
28 (run-tests :suite 'lisp-stat-ut)
31 ;; FIXME: Example: currently not relevant, yet
32 (describe
33 (lift::run-test
34 :test-case 'lisp-stat-unittests::create-proto
35 :suite 'lisp-stat-unittests::lisp-stat-ut-proto))
38 (describe 'lisp-stat-ut)
39 (in-package :ls-user)
42 (progn ;; dataframe
44 (describe (lift::run-tests :suite 'lisp-stat-ut-dataclos))
45 (lift::run-tests :suite 'lisp-stat-ut-dataclos)
48 (describe
49 (lift::run-test
50 :test-case 'lisp-stat-unittests::create-proto
51 :suite 'lisp-stat-unittests::lisp-stat-ut-proto))
53 (defparameter *my-df-1*
54 (make-instance 'dataframe-array
55 :storage #2A((1 2 3 4 5)
56 (10 20 30 40 50))
57 :doc "This is an interesting dataframe-array"
58 :case-labels (list "x" "y")
59 :var-labels (list "a" "b" "c" "d" "e")))
63 (type-of #2A((1 2 3 4 5)
64 (10 20 30 40 50)))
66 (type-of (rand 10 20))
68 (typep #2A((1 2 3 4 5)
69 (10 20 30 40 50))
70 'matrix-like)
72 (typep (rand 10 20) 'matrix-like)
74 (typep #2A((1 2 3 4 5)
75 (10 20 30 40 50))
76 'array)
78 (typep (rand 10 20) 'array)
81 (make-dataframe #2A((1 2 3 4 5)
82 (10 20 30 40 50)))
84 (make-dataframe (rand 10 20))
87 (defparameter *my-df-1*
88 (make-dataframe #2A((1 2 3 4 5)
89 (10 20 30 40 50))
90 :caselabels (list "x" "y")
91 :varlabels (list "a" "b" "c" "d" "e")
92 :doc "This is an interesting dataframe-array")
95 (defparameter *my-df-2*
96 (make-instance 'dataframe-array
97 :storage
98 (make-array-from-listoflists
99 (cybertiggyr-dsv::load-escaped
100 "/media/disk/Desktop/sandbox/CLS.git/Data/example-mixed.csv"))
101 :doc "This is an interesting dataframe-array"))
102 #| :case-labels (list "x" "y")
103 :var-labels (list "a" "b" "c" "d" "e")
109 (progn ;; Data setup
111 (describe 'make-matrix)
113 (defparameter *indep-vars-2-matrix*
114 (make-matrix (length iron) 2
115 :initial-contents
116 (mapcar #'(lambda (x y)
117 (list (coerce x 'double-float)
118 (coerce y 'double-float)))
119 iron aluminum)))
122 (defparameter *dep-var*
123 (make-vector (length absorbtion)
124 :type :row
125 :initial-contents
126 (list
127 (mapcar #'(lambda (x) (coerce x 'double-float))
128 absorbtion))))
130 (defparameter *dep-var-int*
131 (make-vector (length absorbtion)
132 :type :row
133 :element-type 'integer
134 :initial-contents (list absorbtion)))
137 (defparameter *xv+1a*
138 (make-matrix
140 :initial-contents #2A((1d0 1d0)
141 (1d0 3d0)
142 (1d0 2d0)
143 (1d0 4d0)
144 (1d0 3d0)
145 (1d0 5d0)
146 (1d0 4d0)
147 (1d0 6d0))))
149 (defparameter *xv+1b*
150 (bind2
151 (ones 8 1)
152 (make-matrix
154 :initial-contents '((1d0)
155 (3d0)
156 (2d0)
157 (4d0)
158 (3d0)
159 (5d0)
160 (4d0)
161 (6d0)))
162 :by :column))
164 (m= *xv+1a* *xv+1b*) ; => T
166 (princ "Data Set up"))
171 (progn
172 ;; REVIEW: general Lisp use guidance
174 (fdefinition 'make-matrix)
175 (documentation 'make-matrix 'function)
177 #| Examples from CLHS, a bit of guidance.
179 ;; This function assumes its callers have checked the types of the
180 ;; arguments, and authorizes the compiler to build in that assumption.
181 (defun discriminant (a b c)
182 (declare (number a b c))
183 "Compute the discriminant for a quadratic equation."
184 (- (* b b) (* 4 a c))) => DISCRIMINANT
185 (discriminant 1 2/3 -2) => 76/9
187 ;; This function assumes its callers have not checked the types of the
188 ;; arguments, and performs explicit type checks before making any assumptions.
189 (defun careful-discriminant (a b c)
190 "Compute the discriminant for a quadratic equation."
191 (check-type a number)
192 (check-type b number)
193 (check-type c number)
194 (locally (declare (number a b c))
195 (- (* b b) (* 4 a c)))) => CAREFUL-DISCRIMINANT
196 (careful-discriminant 1 2/3 -2) => 76/9
201 #+nil
202 (progn ;; FIXME: Regression modeling
204 ;; data setup in previous FIXME
205 (defparameter *m* nil
206 "holding variable.")
207 ;; need to make vectors and matrices from the lists...
209 ;; BROKEN
210 (def *m* (regression-model (list->vector-like iron)
211 (list->vector-like absorbtion)))
213 (def m (regression-model (list->vector-like iron)
214 (list->vector-like absorbtion) :print nil))
215 ;;Good
216 (send m :print)
217 (send m :own-slots)
218 (send m :own-methods)
219 ;; (lsos::ls-objects-methods m) ; bogus?
220 (send m :show)
222 (def m (regression-model (list->vector-like iron)
223 (list->vector-like absorbtion)))
225 (def m (regression-model (listoflists->matrix-like (list iron aluminum))
226 (list->vector-like absorbtion) :print nil))
229 (send m :compute)
230 (send m :sweep-matrix)
231 (format t "~%~A~%" (send m :sweep-matrix))
233 ;; need to get multiple-linear regression working (simple linear regr
234 ;; works)... to do this, we need to redo the whole numeric structure,
235 ;; I'm keeping these in as example of brokenness...
237 (send m :basis) ;; this should be positive?
238 (send m :coef-estimates) )
240 #+nil
241 (progn ;; FIXME: Need to clean up data examples, licenses, attributions, etc.
242 ;; The following breaks because we should use a package to hold
243 ;; configuration details, and this would be the only package outside
244 ;; of packages.lisp, as it holds the overall defsystem structure.
245 (load-data "iris.lsp") ;; (the above partially fixed).
246 (variables)
247 diabetes )
252 (progn ;; FIXME: read data from CSV file. To do.
255 ;; challenge is to ensure that we get mixed arrays when we want them,
256 ;; and single-type (simple) arrays in other cases.
259 (defparameter *csv-num*
260 (cybertiggyr-dsv::load-escaped
261 #p"/media/disk/Desktop/sandbox/CLS.git/Data/example-numeric.csv"
262 :field-separator #\,
263 :trace T))
265 (nth 0 (nth 0 *csv-num*))
267 (defparameter *csv-num*
268 (cybertiggyr-dsv::load-escaped
269 #p"/media/disk/Desktop/sandbox/CLS.git/Data/example-numeric2.dsv"
270 :field-separator #\:))
272 (nth 0 (nth 0 *csv-num*))
275 ;; The handling of these types should be compariable to what we do for
276 ;; matrices, but without the numerical processing. i.e. mref, bind2,
277 ;; make-dataframe, and the class structure should be similar.
279 ;; With numerical data, there should be a straightforward mapping from
280 ;; the data.frame to a matrix. With categorical data (including
281 ;; dense categories such as doc-strings, as well as sparse categories
282 ;; such as binary data), we need to include metadata about ordering,
283 ;; coding, and such. So the structures should probably consider
285 ;; Using the CSV file:
287 (defun parse-number (s)
288 (let* ((*read-eval* nil)
289 (n (read-from-string s)))
290 (if (numberp n) n)))
292 (parse-number "34")
293 (parse-number "34 ")
294 (parse-number " 34")
295 (parse-number " 34 ")
297 (+ (parse-number "3.4") 3)
298 (parse-number "3.4 ")
299 (parse-number " 3.4")
300 (+ (parse-number " 3.4 ") 3)
302 (parse-number "a")
304 ;; (coerce "2.3" 'number) => ERROR
305 ;; (coerce "2" 'float) => ERROR
307 (defparameter *csv-num*
308 (cybertiggyr-dsv::load-escaped
309 #p"/media/disk/Desktop/sandbox/CLS.git/Data/example-numeric.csv"
310 :field-separator #\,
311 :filter #'parse-number
312 :trace T))
314 (nth 0 (nth 0 *csv-num*))
316 (defparameter *csv-num*
317 (cybertiggyr-dsv::load-escaped
318 #p"/media/disk/Desktop/sandbox/CLS.git/Data/example-numeric2.dsv"
319 :field-separator #\:
320 :filter #'parse-number))
322 (nth 0 (nth 0 *csv-num*))
324 ;; now we've got the DSV code in the codebase, auto-loaded I hope:
325 cybertiggyr-dsv:*field-separator*
326 (defparameter *example-numeric.csv*
327 (cybertiggyr-dsv:load-escaped "Data/example-numeric.csv"
328 :field-separator #\,))
329 *example-numeric.csv*
331 ;; the following fails because we've got a bit of string conversion
332 ;; to do. 2 thoughts: #1 modify dsv package, but mucking with
333 ;; encapsulation. #2 add a coercion tool (better, but potentially
334 ;; inefficient).
335 #+nil(coerce (nth 3 (nth 3 *example-numeric.csv*)) 'double-float)
337 ;; cases, simple to not so
338 (defparameter *test-string1* "1.2")
339 (defparameter *test-string2* " 1.2")
340 (defparameter *test-string3* " 1.2 ")
344 #+nil
345 (progn ;; experiments with GSL and the Lisp interface.
346 (asdf:oos 'asdf:load-op 'gsll)
347 (asdf:oos 'asdf:load-op 'gsll-tests)
349 ;; the following should be equivalent
350 (setf *t1* (LIST 6.18d0 6.647777777777779d0 6.18d0))
351 (setf *t2* (MULTIPLE-VALUE-LIST
352 (LET ((VEC
353 (gsll:make-marray 'DOUBLE-FLOAT
354 :INITIAL-CONTENTS '(-3.21d0 1.0d0 12.8d0)))
355 (WEIGHTS
356 (gsll:MAKE-MARRAY 'DOUBLE-FLOAT
357 :INITIAL-CONTENTS '(3.0d0 1.0d0 2.0d0))))
358 (LET ((MEAN (gsll:MEAN VEC)))
359 (LIST (gsll:ABSOLUTE-DEVIATION VEC)
360 (gsll:WEIGHTED-ABSOLUTE-DEVIATION VEC WEIGHTS)
361 (gsll:ABSOLUTE-DEVIATION VEC MEAN))))))
362 (eql *t1* *t2*)
364 ;; from (gsll:examples 'gsll::numerical-integration) ...
365 (gsll:integration-qng gsll::one-sine 0.0d0 PI)
367 (gsll:defun-single axpb (x) (+ (* 2 x) 3)) ;; a<-2, b<-3
368 (gsll:integration-qng axpb 1d0 2d0)
370 (let ((a 2)
371 (b 3))
372 (defun-single axpb2 (x) (+ (* a x) b)))
373 (gsll:integration-qng axpb2 1d0 2d0)
375 ;; BAD
376 ;; (gsll:integration-qng
377 ;; (let ((a 2)
378 ;; (b 3))
379 ;; (defun-single axpb2 (x) (+ (* a x) b)))
380 ;; 1d0 2d0)
382 ;; right, but weird expansion...
383 (gsll:integration-qng
384 (let ((a 2)
385 (b 3))
386 (defun axpb2 (x) (+ (* a x) b))
387 (gsll:def-single-function axpb2)
388 axpb2)
389 1d0 2d0)
391 ;; Linear least squares
393 (gsll:gsl-lookup "gsl_linalg_LU_decomp") ; => gsll:lu-decomposition
394 (gsll:gsl-lookup "gsl_linalg_LU_solve") ; => gsll:lu-solve
399 #+nil
400 (progn ;; philosophy time
402 (setf my-model (model :name "ex1"
403 :data-slots (list w x y z)
404 :param-slots (list alpha beta gamma)
405 :math-form (regression-model :formula '(= w (+ (* beta x)
406 (* alpha y)
407 (* gamma z)
408 normal-error))
409 :centrality 'median ; 'mean
412 #| or:
413 #R"W ~ x+ y + z "
416 (setf my-dataset (statistical-table :table data-frame-contents
417 :metadata (list (:case-names (list ))
418 (:var-names (list ))
419 (:documentation "string of doc"))))
421 (setf my-analysis (analysis
422 :model my-model
423 :data my-dataset
424 :parameter-map (pairing (model-param-slots my-model)
425 (data-var-names my-dataset))))
427 ;; ontological implications -- the analysis is an abstract class of
428 ;; data, model, and mapping between the model and data. The fit is
429 ;; the instantiation of such. This provides a statistical object
430 ;; computation theory which can be realized as "executable
431 ;; statistics" or "computable statistics".
432 (setf my-analysis (analyze my-fit
433 :estimation-method 'linear-least-squares-regression))
435 ;; one of the tricks here is that one needs to provide the structure
436 ;; from which to consider estimation, and more importantly, the
437 ;; validity of the estimation.
440 (setf linear-least-squares-regression
441 (estimation-method-definition
442 :variable-defintions ((list
443 ;; from MachLearn: supervised,
444 ;; unsupervised
445 :data-response-vars list-drv ; nil if unsup
447 :param-vars list-pv
448 :data-predictor-vars list-dpv
449 ;; nil in this case. these
450 ;; describe "out-of-box" specs
451 :hyper-vars list-hv))
452 :form '(regression-additive-error
453 :central-form (linear-form drv pv dpv)
454 :error-form 'normal-error)
455 :resulting-decision '(point-estimation interval-estimation)
456 :philosophy 'frequentist
457 :documentation "use least squares to fit a linear regression
458 model to data."))
460 (defparameter *statistical-philosophies*
461 '(frequentist bayesian fiducial decision-analysis)
462 "can be combined to build decision-making approaches and
463 characterizations")
465 (defparameter *decisions*
466 '(estimation selection testing)
467 "possible results from a...")
468 ;; is this really true? One can embedded hypothesis testing within
469 ;; estimation, as the hypothesis estimated to select. And
470 ;; categorical/continuous rear their ugly heads, but not really in
471 ;; an essential way.
473 (defparameter *ontology-of-decision-procedures*
474 (list :decisions
475 (list :estimation
476 (list :point
477 (list :maximum-likelihood
478 :minimum-entropy
479 :least-squares
480 :method-of-moments)
481 :interval
482 (list :maximum-likelihood
484 :testing
485 (list :fisherian
486 :neyman-pearson
487 (list :traditional
488 :bioequivalence-inversion)
489 :selection
490 (list :ranking
491 :top-k-of-n-select))
492 :parametric
493 :partially-parametric))
494 "start of ontology"))
497 ;;;; LM
499 (progn
501 (defparameter *y*
502 (make-vector
504 :type :row
505 :initial-contents '((1d0 2d0 3d0 4d0 5d0 6d0 7d0 8d0))))
508 (defparameter *xv+1*
509 (make-matrix
511 :initial-contents '((1d0 1d0)
512 (1d0 3d0)
513 (1d0 2d0)
514 (1d0 4d0)
515 (1d0 3d0)
516 (1d0 5d0)
517 (1d0 4d0)
518 (1d0 6d0))))
521 ;; so something like (NOTE: matrices are transposed to begin with, hence the incongruety)
522 (defparameter *xtx-2* (m* (transpose *xv+1*) *xv+1*))
523 ;; #<LA-SIMPLE-MATRIX-DOUBLE 2 x 2
524 ;; 8.0d0 28.0d0
525 ;; 28.0d0 116.0d0>
527 (defparameter *xty-2* (m* (transpose *xv+1*) (transpose *y*)))
528 ;; #<LA-SIMPLE-VECTOR-DOUBLE (2 x 1)
529 ;; 36.0d0
530 ;; 150.0d0>
532 (defparameter *rcond-2* 0.000001)
533 (defparameter *betahat-2* (gelsy *xtx-2* *xty-2* *rcond-2*))
534 ;; *xtx-2* => "details of complete orthogonal factorization"
535 ;; according to man page:
536 ;; #<LA-SIMPLE-MATRIX-DOUBLE 2 x 2
537 ;; -119.33147112141039d0 -29.095426104883202d0
538 ;; 0.7873402682880205d0 -1.20672274167718d0>
540 ;; *xty-2* => output becomes solution:
541 ;; #<LA-SIMPLE-VECTOR-DOUBLE (2 x 1)
542 ;; -0.16666666666668312d0
543 ;; 1.333333333333337d0>
545 *betahat-2* ; which matches R, see below
547 (documentation 'gelsy 'function)
550 ;; (#<LA-SIMPLE-VECTOR-DOUBLE (2 x 1)
551 ;; -0.16666666666668312 1.333333333333337>
552 ;; 2)
554 ;; ## Test case in R:
555 ;; x <- c( 1.0, 3.0, 2.0, 4.0, 3.0, 5.0, 4.0, 6.0)
556 ;; y <- c( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0)
557 ;; lm(y~x)
558 ;; ## => Call: lm(formula = y ~ x)
560 ;; Coefficients: (Intercept) x
561 ;; -0.1667 1.3333
563 ;; summary(lm(y~x))
564 ;; ## =>
566 ;; Call:
567 ;; lm(formula = y ~ x)
569 ;; Residuals:
570 ;; Min 1Q Median 3Q Max
571 ;; -1.833e+00 -6.667e-01 -3.886e-16 6.667e-01 1.833e+00
573 ;; Coefficients:
574 ;; Estimate Std. Error t value Pr(>|t|)
575 ;; (Intercept) -0.1667 1.1587 -0.144 0.89034
576 ;; x 1.3333 0.3043 4.382 0.00466 **
577 ;; ---
578 ;; Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
580 ;; Residual standard error: 1.291 on 6 degrees of freedom
581 ;; Multiple R-squared: 0.7619, Adjusted R-squared: 0.7222
582 ;; F-statistic: 19.2 on 1 and 6 DF, p-value: 0.004659
586 ;; which suggests one might do (modulo ensuring correct
587 ;; orientations). When this is finalized, it should migrate to
588 ;; CLS.
592 (defparameter *n* 20) ; # rows = # obsns
593 (defparameter *p* 10) ; # cols = # vars
594 (defparameter *x-temp* (rand *n* *p*))
595 (defparameter *b-temp* (rand *p* 1))
596 (defparameter *y-temp* (m* *x-temp* *b-temp*))
597 ;; so Y=Xb + \eps
598 (defparameter *rcond* (* (coerce (expt 2 -52) 'double-float)
599 (max (nrows *x-temp*) (ncols *y-temp*))))
600 (defparameter *orig-x* (copy *x-temp*))
601 (defparameter *orig-b* (copy *b-temp*))
602 (defparameter *orig-y* (copy *y-temp*))
604 (defparameter *lm-result* (lm *x-temp* *y-temp*))
605 (princ (first *lm-result*))
606 (princ (second *lm-result*))
607 (princ (third *lm-result*))
608 (v= (third *lm-result*)
609 (v- (first (first *lm-result*))
610 (first (second *lm-result*))))
615 ;; Some issues exist in the LAPACK vs. LINPACK variants, hence R
616 ;; uses LINPACK primarily, rather than LAPACK. See comments in R
617 ;; source for issues.
620 ;; Goal is to start from X, Y and then realize that if
621 ;; Y = X \beta, then, i.e. 8x1 = 8xp px1 + 8x1
622 ;; XtX \hat\beta = Xt Y
623 ;; so that we can solve the equation W \beta = Z where W and Z
624 ;; are known, to estimate \beta.
626 ;; the above is known to be numerically instable -- some processing
627 ;; of X is preferred and should be done prior. And most of the
628 ;; transformation-based work does precisely that.
630 ;; recall: Var[Y] = E[(Y - E[Y])(Y-E[Y])t]
631 ;; = E[Y Yt] - 2 \mu \mut + \mu \mut
632 ;; = E[Y Yt] - \mu \mut
634 ;; Var Y = E[Y^2] - \mu^2
637 ;; For initial estimates of covariance of \hat\beta:
639 ;; \hat\beta = (Xt X)^-1 Xt Y
640 ;; with E[ \hat\beta ]
641 ;; = E[ (Xt X)^-1 Xt Y ]
642 ;; = E[(Xt X)^-1 Xt (X\beta)]
643 ;; = \beta
645 ;; So Var[\hat\beta] = ...
646 ;; (Xt X)
647 ;; and this gives SE(\beta_i) = (* (sqrt (mref Var i i)) adjustment)
650 ;; from docs:
652 (setf *temp-result*
653 (let ((*default-implementation* :foreign-array))
654 (let* ((m 10)
655 (n 10)
656 (a (rand m n))
657 (x (rand n 1))
658 (b (m* a x))
659 (rcond (* (coerce (expt 2 -52) 'double-float)
660 (max (nrows a) (ncols a))))
661 (orig-a (copy a))
662 (orig-b (copy b))
663 (orig-x (copy x)))
664 (list x (gelsy a b rcond))
665 ;; no applicable conversion?
666 ;; (m- (#<FA-SIMPLE-VECTOR-DOUBLE (10 x 1))
667 ;; (#<FA-SIMPLE-VECTOR-DOUBLE (10 x 1)) )
668 (v- x (first (gelsy a b rcond))))))
671 (princ *temp-result*)
673 (setf *temp-result*
674 (let ((*default-implementation* :lisp-array))
675 (let* ((m 10)
676 (n 10)
677 (a (rand m n))
678 (x (rand n 1))
679 (b (m* a x))
680 (rcond (* (coerce (expt 2 -52) 'double-float)
681 (max (nrows a) (ncols a))))
682 (orig-a (copy a))
683 (orig-b (copy b))
684 (orig-x (copy x)))
685 (list x (gelsy a b rcond))
686 (m- x (first (gelsy a b rcond)))
688 (princ *temp-result*)
691 (defparameter *xv*
692 (make-vector
694 :type :row ;; default, not usually needed!
695 :initial-contents '((1d0 3d0 2d0 4d0 3d0 5d0 4d0 6d0))))
697 (defparameter *y*
698 (make-vector
700 :type :row
701 :initial-contents '((1d0 2d0 3d0 4d0 5d0 6d0 7d0 8d0))))
703 ;; so something like (NOTE: matrices are transposed to begin with, hence the incongruety)
704 (defparameter *xtx-1* (m* *xv* (transpose *xv*)))
705 (defparameter *xty-1* (m* *xv* (transpose *y*)))
706 (defparameter *rcond-in* (* (coerce (expt 2 -52) 'double-float)
707 (max (nrows *xtx-1*)
708 (ncols *xty-1*))))
710 (defparameter *betahat* (gelsy *xtx-1* *xty-1* *rcond-in*))
712 ;; (#<LA-SIMPLE-VECTOR-DOUBLE (1 x 1)
713 ;; 1.293103448275862>
714 ;; 1)
716 ;; ## Test case in R:
717 ;; x <- c( 1.0, 3.0, 2.0, 4.0, 3.0, 5.0, 4.0, 6.0)
718 ;; y <- c( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0)
719 ;; lm(y~x-1)
720 ;; ## =>
721 ;; Call:
722 ;; lm(formula = y ~ x - 1)
724 ;; Coefficients:
725 ;; x
726 ;; 1.293
728 (first *betahat*))
732 #+nil
733 (progn
735 (asdf:oos 'asdf:load-op 'cl-plplot)
737 (plot-ex))