3 ;;; Time-stamp: <2009-04-20 18:44:42 tony>
4 ;;; Creation: <2009-04-19 09:41:09 tony>
5 ;;; File: linear-regression.lisp
6 ;;; Author: AJ Rossini <blindglobe@gmail.com>
7 ;;; Copyright: (c)2009--, AJ Rossini. BSD, MIT, LLGPL, or
8 ;;; GPLv2+, or GPLv3+ depending on how it arrives.
9 ;;; Purpose: Example of basic linear regression data analysis in CLS.
11 ;;; What is this talk of 'release'? Klingons do not make software
12 ;;; 'releases'. Our software 'escapes', leaving a bloody trail of
13 ;;; designers and quality assurance people in its wake.
18 ;; - confirm estimates for multivariate case,
19 ;; - pretty-print output
20 ;; - fix up API -- what do we want this to look like?
23 (regression-model (list->vector-like iron
)
24 (list->vector-like absorbtion
))
34 (covariance-matrix *m-fit
*)
37 (regression-model (transpose
38 (listoflist->matrix-like
40 :orientation
:row-major
))
41 (list->vector-like absorbtion
)))
43 (defparameter *m3-fit
*
47 ;; Should the above look something like:
48 (defparameter *m3-fit
*
49 (spec-and-fit-model '(absorbtion = iron aluminum
)))
50 ;; in which case we split the list before/after the "=" character.
54 (covariance-matrix *m3-fit
*))
58 ;; now to build a linear regression model from an external CSV datafile...
62 (rsm.string
::filestream-
>string-table
64 "Initial read-in of data.")