From 64bb3bba757f641cec36e9e8a979e4e31af50596 Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Mon, 1 Feb 2010 14:17:32 +0100 Subject: [PATCH] use names, start constructing model generics. Signed-off-by: AJ Rossini --- src/stat-models/model.lisp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/stat-models/model.lisp b/src/stat-models/model.lisp index 4e6bfab..f69c315 100644 --- a/src/stat-models/model.lisp +++ b/src/stat-models/model.lisp @@ -1,7 +1,7 @@ ;;; -*- mode: lisp -*- ;;; File: model.lisp -;;; Time-stamp: <2009-04-12 12:09:16 tony> +;;; Time-stamp: <2010-01-25 15:52:30 tony> ;;; Creation: <2006-05-17 21:34:07 rossini> ;;; Author: AJ Rossini ;;; Copyright: (c)2007-- , AJ Rossini. BSD, LLGPL, or GPLv2, depending @@ -71,7 +71,7 @@ (defclass result () ((param-values ) (param-uncertainity ) - (param-characterization )) + (param-characterization ))) ;; The following are types of models -- in particular, we can consider ;; that these models @@ -80,12 +80,29 @@ (defclass ode-model (model result )) -(defclass linear-regression-model (statistical-mode)) +(defclass regression-model-linear (statistical-mode)) -(defclass generalized-linear-regression-model (statistical-model)) +(defclass regression-model-generalized-linear (statistical-model)) -(defclass nonlinear-linear-regression-model (statistical-model)) +(defclass regression-model-nonlinear-linear (statistical-model)) +;;;;;;;;; + +(defgeneric =model (lhs rhs) + (:documentation "returns a class describing the model specified") + (:method ((lhs atom) (rhs list)) + (if (linear-model rhs) + (make-instance 'regression-model-linear + lhs + rhs) + (make-instance 'general-model)))) + +;;; Centrality +(defgeneric =mean (lhs rhs)) +(defgeneric =quantile (lhs rhs quantile)) + +;;; Variable +(defgeneric =var (lhs rhs)) ; lhs should spec parameter #| -- 2.11.4.GIT