blob | ce73ed5a828df0479d3bca5fd37262873e8c6f59 |

1 ;;; -*- mode: lisp -*-

3 ;;; Time-stamp: <2009-01-31 14:20:14 tony>

4 ;;; Creation: <2008-10-03 02:07:10 tony>

5 ;;; Author: AJ Rossini <blindglobe@gmail.com>

6 ;;; Copyright: (c)2007, AJ Rossini. BSD, LLGPL, or GPLv2, depending

7 ;;; on how it arrives.

8 ;;; Purpose: redoing regression in a CLOS based framework. See

9 ;;; regression.lsp for basis of work.

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.

15 ;;; This organization and structure is new to the 21st Century

16 ;;; version.

20 ;;; Regresion Model CLOS, data structures

55 ;;; The following should be self-created based on introspection of

56 ;;; available:

57 ;;; ## inferential technologies (bayesian, frequentist, etc),

58 ;;; ## optimization criteria (likelihood, least-squares, min-entropy,

59 ;;; minimax, etc)

60 ;;; ## simplification macros, i.e. mapping directly to linear

61 ;;; regression and other applications. fast specialized

62 ;;; algorithms for edge cases and narrow conditions.

63 ;;; ##

69 ()))

73 ;;; Regression model generics and methods

82 "Args: (regr-inst regressino-model-clos)

84 Returns a fitted regression model object. To examine the model further

85 assign the result to a variable and send it messages. Example (data

86 are in file absorbtion.lsp in the sample data directory/folder):

88 (def fit-m (fit (new 'regression-model-clos (list iron aluminum) absorbtion)))

89 (print fit-m)

90 (plot fit-m :feature 'residuals)

91 "

97 ;;;;; More mischief from a different time

100 ;; regression-model is the old API, but regression as a generic will

101 ;; be the new API. We need to distinguish between APIs which enable

102 ;; the user to do clear activities, and APIs which enable developers

103 ;; to do clear extensions and development, and underlying

104 ;; infrastructure to keep everything straight and enabled.

106 ;; There are conflicting theories for how to structure the

107 ;; specification of mathematical models, along with the statistical

108 ;; inference, along with the data which is instantiating the model.

109 ;;

110 ;; i.e.: mathematical model for the relationships between components,

111 ;; between a component and a summarizing parameter, and between

112 ;; parameters.

113 ;;

114 ;; statistical inference describes the general approach for

115 ;; aggregating into a decision and has impliciations for the scale up

116 ;; from the model on a single instance to the generalization.

117 ;;

118 ;; The data represents the particular substantive context that is

119 ;; driving the model/inference combination, and about which we hope to

120 ;; generate knowledge.

121 ;;

122 ;; numerical analysis selects appropriate algorithms/implementations

123 ;; for combining the above 3.

124 ;;

125 ;; the end result is input on the decision being made (which could be

126 ;; specific (decision analysis/testing), risk-analysis (interval

127 ;; estimation) , most likely/appropriate selection (point estimation)

128 ;;

130 #|

136 "Args: (x y &key (intercept T) (print T) (weights nil)

137 included predictor-names response-name case-labels)

138 X - list of independent variables or X matrix

139 Y - dependent variable.

140 INTERCEPT - T to include (default), NIL for no intercept

141 PRINT - if not NIL print summary information

142 WEIGHTS - if supplied should be the same length as Y; error

143 variances are

144 assumed to be inversely proportional to WEIGHTS

145 PREDICTOR-NAMES, RESPONSE-NAME, CASE-LABELS

146 - sequences of strings or symbols.

147 INCLUDED - if supplied should be the same length as Y, with

148 elements nil to skip a in computing estimates (but not

149 in residual analysis).

150 Returns a regression model object. To examine the model further assign the

151 result to a variable and send it messages.

152 Example (data are in file absorbtion.lsp in the sample data directory):

153 (def m (regression-model (list iron aluminum) absorbtion))

154 (send m :help) (send m :plot-residuals)"

173 m))

174 |#