From: Siegfried Gonzi
Subject: Common Lisp and plotting
Date: 
Message-ID: <1009019216.848840@hagakure.utanet.at>
Has anybody ever succeeded in linking Common Lisp (specifically Allegro
Common Lisp or Xanalys Lisp) with plotting programs (Gnuplot,
R-language,...)? Yes, I know there exists a wrapper library for Gnuplot from
Sam. S., but I think it is only intented for CLisp and the Unix-platform.

There exists XLisp Stat and Vista Stat (which is based on XLisp Stat). But
their graphic-capabilities are far from puplication-quality; and XLisp Stat
is not appropiate for handling larger problems (Vista Stat is, but has got
only the graphics from XLisp Stat).

They write, that the R-language is based on Lisp (at least when it comes to
lexical-scoping), but why in hell there only are methods for linking with C
or Fortran code (why they didn't include linking to Common Lisp) is out of
my vision; especially, because there are tons of statistical code in Common
Lisp.

Yes, Allegro Common Lisp lets one easily include foreign C and Fortran code,
and one can even produce ".dll" libraries itself.

But I want to make my calculations with Lisp and want an imediate feedback
via a plot (the way: take the Common Lisp code -> save the results to a
file -> read-in the file with the R-language; is too clumsy).

Anybody any suggestions (please for the Windows platform). I have to express
that maybe a 13 year old boy knows more about "gluing together"
applications; hence, please be patient with my stupidity.

S. Gonzi

From: Jeff Greif
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <Wr4V7.45870$WK1.10896551@typhoon.we.rr.com>
I'm not a user of gnuplot, but a quick check of the docs confirms my
memory that it is usually run as a separate process that reads standard
input.  Thus, you can run Lisp in one process with output piped to
gnuplot, generating gnuplot commands from your lisp code.  This is not
Unix-specific.  I doubt that any Lisp wrapper which just spits out text
would be hard to port to another common lisp.  You could also
potentially run gnuplot as a cgi behind a webserver, and have Lisp open
a socket and send http requests to invoke it.  Many other possibilities
are available which would work on Unix and Windows platforms.

Jeff

Siegried Gonzi" <···············@kfunigraz.ac.at> wrote in message
······················@hagakure.utanet.at...
> Has anybody ever succeeded in linking Common Lisp (specifically
Allegro
> Common Lisp or Xanalys Lisp) with plotting programs (Gnuplot,
> R-language,...)? Yes, I know there exists a wrapper library for
Gnuplot from
> Sam. S., but I think it is only intented for CLisp and the
Unix-platform.
From: Sam Steingold
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <u3d235a5f.fsf@xchange.com>
> * In message <·················@hagakure.utanet.at>
> * On the subject of "Common Lisp and plotting"
> * Sent on Sat, 22 Dec 2001 10:52:18 -0000
> * Honorable "Siegfried Gonzi" <···············@kfunigraz.ac.at> writes:
>
> Has anybody ever succeeded in linking Common Lisp (specifically
> Allegro Common Lisp or Xanalys Lisp) with plotting programs (Gnuplot,
> R-language,...)? Yes, I know there exists a wrapper library for
> Gnuplot from Sam. S., but I think it is only intented for CLisp and
> the Unix-platform.

CLOCC/CLLIB/gnuplot.lisp (<http://www.podval.org/~sds/data/cllib.html>)
works with CLISP, CMUCL, ACL &c on all platforms where those run.
yes, gnuplot on win32 has its quirks, but I work around them.

-- 
Sam Steingold (http://www.podval.org/~sds)
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
If you want it done right, you have to do it yourself
From: Siegfried Gonzi
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <1009052615.271998@hagakure.utanet.at>
"Sam Steingold" <···@gnu.org> schrieb im Newsbeitrag
··················@xchange.com...
>
> CLOCC/CLLIB/gnuplot.lisp (<http://www.podval.org/~sds/data/cllib.html>)
> works with CLISP, CMUCL, ACL &c on all platforms where those run.
> yes, gnuplot on win32 has its quirks, but I work around them.

Sorry, but there is absolutely no documentation how to use it on Windows?

When I type in Allegro CL:

; Loading C:\Wissenschaft\acl61\cllib\gnuplot.lisp

CG-USER(68):
Error: Package "MAKE" does not exist.  Use defpackage to create new
       packages
[condition type: PACKAGE-ERROR]


I get the above error message (otherwise: how should I use "make system" on
Windows?).


I tried to install Quail, but Allegro CL 6.1 (student version) does not
accept ".fasl"-files intented for Allegro CL 5.1.

Maybe I am the greatest idiot on earth, but I have absolutely no clue how to
use "gnuplot.lisp" on my computer (I do not find the documentation).


S. Gonzi
From: Sam Steingold
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <un10a52in.fsf@xchange.com>
> * In message <·················@hagakure.utanet.at>
> * On the subject of "Re: Common Lisp and plotting"
> * Sent on Sat, 22 Dec 2001 20:08:58 -0000
> * Honorable "Siegfried Gonzi" <···············@kfunigraz.ac.at> writes:
>
> "Sam Steingold" <···@gnu.org> schrieb im Newsbeitrag
> ··················@xchange.com...
> >
> > CLOCC/CLLIB/gnuplot.lisp (<http://www.podval.org/~sds/data/cllib.html>)
> > works with CLISP, CMUCL, ACL &c on all platforms where those run.
> > yes, gnuplot on win32 has its quirks, but I work around them.
> 
> Sorry, but there is absolutely no documentation how to use it on Windows?

see the file CLOCC/INSTALL (the "Lisp-only" section).
after you do 
        (mk:oos "cllib" :compile)
you should load "cllib:gnuplot" and set
        *gnuplot-path*,
        *gnuplot-printer*,
        *gnuplot-path-console*,
        and maybe *gnuplot-default-directive*
appropriately
then try:

(plot-functions (list (cons 'sine #'sin) (cons 'cosine #'cos)) 0 pi 100
                :legend '(:bot :left :box) :grid t :plot :wait)

see the doc strings for the autoloaded functions in gnuplot.lisp.

please note that the right place to discuss CLOCC is the <clocc-list>
mailing list (see <http://closs.sf.net>).  You will get a speedier
response there.

-- 
Sam Steingold (http://www.podval.org/~sds)
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
Isn't "Microsoft Works" an advertisement lie?
From: Siegfried Gonzi
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <1009062821.332750@hagakure.utanet.at>
"Sam Steingold" <···@gnu.org> schrieb im Newsbeitrag
··················@xchange.com...

> > Sorry, but there is absolutely no documentation how to use it on
Windows?
>
> see the file CLOCC/INSTALL (the "Lisp-only" section).
> after you do
>         (mk:oos "cllib" :compile)

I get the error message (AL CL 6.1):

CG-USER(74): (mk:oos "cllib" :compile)
Error: Package "MK" not found. [file position = 4]
[condition type: READER-ERROR]
CG-USER(75):


Thank you for your quick answer. But I think it is better I wait for the
answer of the Quail developers, because I do not have weeks to spend in
order to get CLOCC running.

I have downloaded all the libraries concerning CLOCC, but there is no
documentation, which really could help me. Congratulations to everybody, who
knows what he has to do after reading the page, but I am way too silly for
it.


Reagards,
Siegfried Gonzi
From: Siegfried Gonzi
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <1009067844.179958@hagakure.utanet.at>
"Siegfried Gonzi" <···············@kfunigraz.ac.at> schrieb im Newsbeitrag

> I have downloaded all the libraries concerning CLOCC, but there is no
> documentation, which really could help me. Congratulations to everybody,
who
> knows what he has to do after reading the page, but I am way too silly for
> it.

Please, take it not just too literally; maybe it has been an over-reaction
from mine.

Really no insult intented.


S. Gonzi
From: Sam Steingold
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <ubsgp4sag.fsf@xchange.com>
> * In message <·················@hagakure.utanet.at>
> * On the subject of "Re: Common Lisp and plotting"
> * Sent on Sat, 22 Dec 2001 22:59:05 -0000
> * Honorable "Siegfried Gonzi" <···············@kfunigraz.ac.at> writes:
>
> "Sam Steingold" <···@gnu.org> schrieb im Newsbeitrag
> ··················@xchange.com...
> 
> > > Sorry, but there is absolutely no documentation how to use it on
> Windows?
> >
> > see the file CLOCC/INSTALL (the "Lisp-only" section).
> > after you do
> >         (mk:oos "cllib" :compile)
> 
> I get the error message (AL CL 6.1):
> 
> CG-USER(74): (mk:oos "cllib" :compile)
> Error: Package "MK" not found. [file position = 4]
> [condition type: READER-ERROR]
> CG-USER(75):

this indicates that you did not read the CLOCC/INSTALL file.
if you do not read the docs, you should not complain about their
quality.


-- 
Sam Steingold (http://www.podval.org/~sds)
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
main(a){printf(a,34,a="main(a){printf(a,34,a=%c%s%c,34);}",34);}
From: Steven D. Majewski
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <a06hp8$jdk$1@murdoch.acc.Virginia.EDU>
In article <·················@hagakure.utanet.at>,
Siegfried Gonzi <···············@kfunigraz.ac.at> wrote:
>Has anybody ever succeeded in linking Common Lisp (specifically Allegro
>Common Lisp or Xanalys Lisp) with plotting programs (Gnuplot,
>R-language,...)? Yes, I know there exists a wrapper library for Gnuplot from
>Sam. S., but I think it is only intented for CLisp and the Unix-platform.
>
>There exists XLisp Stat and Vista Stat (which is based on XLisp Stat). But
>their graphic-capabilities are far from puplication-quality; and XLisp Stat
>is not appropiate for handling larger problems (Vista Stat is, but has got
>only the graphics from XLisp Stat).

There are papers on xlispstat.org about how to plot to a postscript file
from XlispStat and how to link xlispstat and gnuplot for graphics output.
I posted some examples of how to graph to PDF files from xlispstat.
(They should be in the mailing list archive, or I can send it to you.)

The graphics are quite programmable and easy to customize -- you ought to
be able to get production quality.  The 3d graphics is kind of limited,
but it's hard to imaging what you can't do with it's 2-d graphics. 

Also: what do you mean by not appropriate for handling larger problems ? 


>But I want to make my calculations with Lisp and want an imediate feedback
>via a plot (the way: take the Common Lisp code -> save the results to a
>file -> read-in the file with the R-language; is too clumsy).

This is exactly the sort of thing that XlispStat is great at! 

It is not common lisp: it has it's own prototype based object system
instead of CLOS, and there are some differences in some low level things
like how readtable functions and macro's are implemented, but for most
things, it seems to be close enough to common lisp to not notice any
difference. 

-- Steve Majewski
From: Siegfried Gonzi
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <1009195324.254417@hagakure.utanet.at>
----- Original Message -----
From: "Steven D. Majewski" <·····@minsky.med.Virginia.EDU>

> The graphics are quite programmable and easy to customize -- you ought to
> be able to get production quality.  The 3d graphics is kind of limited,
> but it's hard to imaging what you can't do with it's 2-d graphics.

What I saw in the graph.lisp files actually is, that postscript is only
available with XLisp Stat for Unix. What I need in addition to the common
statistic-plots are contour plots (via a longitude-latitude earth grid; 2
dimensional interpolation in climatology). I saw that R is good at plotting
2 dimensional countour plots.

 I would really appreciate it, if you could send me some hints (via private
mail). I did a quick XLisp Stat mailinglist search, but I had seen that the
mailinglist stopped in 2000 - hasn't it?).

> Also: what do you mean by not appropriate for handling larger problems ?

I sometimes have to deal with larger arrays (100.000 rows and  11 columns).
I only saw that VistaStat is capable of assigning big arrays. In XLisp Stat
the listener aborts (on Windows). I didn't find the command for augmenting
the memory.

Thank you for hints,
S. Gonzi
From: synthespian
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <3C5457E6.9080400@uol.com.br>
Siegfried Gonzi wrote:

> Has anybody ever succeeded in linking Common Lisp (specifically Allegro
> Common Lisp or Xanalys Lisp) with plotting programs (Gnuplot,
> R-language,...)? Yes, I know there exists a wrapper library for Gnuplot from
> Sam. S., but I think it is only intented for CLisp and the Unix-platform.
> 
> There exists XLisp Stat and Vista Stat (which is based on XLisp Stat). But
> their graphic-capabilities are far from puplication-quality; and XLisp Stat
> is not appropiate for handling larger problems (Vista Stat is, but has got
> only the graphics from XLisp Stat).
> 
> They write, that the R-language is based on Lisp (at least when it comes to
> lexical-scoping), but why in hell there only are methods for linking with C
> or Fortran code (why they didn't include linking to Common Lisp) is out of
> my vision; especially, because there are tons of statistical code in Common
> Lisp.
>

Mr. Gonzi-

Could you please be so kind as to point out some to me URLs regarding 
the "tons of statistcal code in Common Lisp."?

I too have an interest in open source statistics software.

TIA,
best regards,
Henry
···········@uol.com.br
From: Siegfried Gonzi
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <3C5696CB.AD470687@kfunigraz.ac.at>
synthespian wrote:

> Could you please be so kind as to point out some to me URLs regarding
> the "tons of statistcal code in Common Lisp."?
>
> I too have an interest in open source statistics software.

With tons I actually meant packages as "XLispStat" and therelike. The problem is
that their code is not well documented: piching up code and successfully using it
is somewhat an adventure.

If you ask your search engine it will pour out a lot of Lisp code. Admittedly it
is awkward to find a specific code (I haven't been successfull  to find a Lisp
code which handles eigenvectors, yet).

The following repository is not bad (especially for simple statistics as the
Tukey-exploration):

http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/math/0.html

If you want graphics you should get Yorick, R, Octave,...

This is a great disadvantage with Lisp that there does not exist many plotting
libraries (and the linking to Gnuplot is more or less a joke). Quail would be a
good candidate; but the current version actually works just only on
MacintoshCommonLisp or AllegroCommonLisp 5. The downloadable AllegroCL 6 version
does not accept ALC 5 fasl-files.

I asked the developers of Quail if it is possible to port Quail to LispWorks.
LispWorks personal edition is free and does not have the great disadvantage that
with the next release the old fasl-files will not any longer be valid (AllegroCL
trial edition has to become updated every 60days).
If you are good at LispWorks and Windows-programming and want to make a good
service to Lisp, please contact the Quail developers and offer them your assitance
( I would, but as I said: programming is not really my favorable activity). They
are really searching for manpower.


S. Gonzi
From: Laurent_Hardt
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <38c8da3c.0202010209.90a89fe@posting.google.com>
Siegfried Gonzi <···············@kfunigraz.ac.at> wrote in message news:<·················@kfunigraz.ac.at>...
> synthespian wrote:
> 
> > Could you please be so kind as to point out some to me URLs regarding
> > the "tons of statistcal code in Common Lisp."?
> >
> > I too have an interest in open source statistics software.
> 
> With tons I actually meant packages as "XLispStat" and therelike. The problem is
> that their code is not well documented: piching up code and successfully using it
> is somewhat an adventure.
> 
> If you ask your search engine it will pour out a lot of Lisp code. Admittedly it
> is awkward to find a specific code (I haven't been successfull  to find a Lisp
> code which handles eigenvectors, yet).
> 
> The following repository is not bad (especially for simple statistics as the
> Tukey-exploration):
> 
> http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/math/0.html
> 
> If you want graphics you should get Yorick, R, Octave,...
> 
> This is a great disadvantage with Lisp that there does not exist many plotting
> libraries (and the linking to Gnuplot is more or less a joke). Quail would be a
> good candidate; but the current version actually works just only on
> MacintoshCommonLisp or AllegroCommonLisp 5. The downloadable AllegroCL 6 version
> does not accept ALC 5 fasl-files.
> 
> I asked the developers of Quail if it is possible to port Quail to LispWorks.
> LispWorks personal edition is free and does not have the great disadvantage that
> with the next release the old fasl-files will not any longer be valid (AllegroCL
> trial edition has to become updated every 60days).
> If you are good at LispWorks and Windows-programming and want to make a good
> service to Lisp, please contact the Quail developers and offer them your assitance
> ( I would, but as I said: programming is not really my favorable activity). They
> are really searching for manpower.
> 
> 
> S. Gonzi

I've played last year with the mathematical prog called "Maxima". It
is build on
LISP ( you can use lisp+mat) and there is also a Windows version. I
don't have now a link to it. Please search with Google.

Regards
Laurent
From: Siegfried Gonzi
Subject: Re: Common Lisp and plotting
Date: 
Message-ID: <3C6162B5.AE62C963@kfunigraz.ac.at>
Siegfried Gonzi wrote:

> The following repository is not bad (especially for simple statistics as the
> Tukey-exploration):
>
> http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/math/0.html

Some remarks to the "Numerical Recipes code" in that specific repository:


1. The function "moment" delivers a divison by 0, if the vector length is lower than 2.
I changed it a little bit and gave more meaningful names to the variables::

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; ORIGINAL version by:
;;;;;; From: Bill Schottstaedt <···@ccrma.Stanford.EDU>
;;;; Message-Id: <··················@ ccrma.Stanford.EDU >
;;;; Date: Fri, 26 Aug 94 07:15:28 -0700
;;;; To: ·····@cs.cmu.edu
;;
;; Changed by Siegfried Gonzi 2002
;;
;; If there is only 1 record then the moments are all nil except for the record itself
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun moment (data-vector)
  (let ((n (array-dimension data-vector 0))
        (sum 0.0) (p 0.0)
        (average 0.0) (average-dev 0.0) (standard-var 0.0) (skew 0.0) (kurtosis 0.0)
(standard-dev 0.0))
    (if (> n 1)
        (progn
          (loop for j below n do
                (incf sum (aref data-vector j)))
          (setf average (/ sum n))
          (loop for j below n do
                (setf sum (- (aref data-vector j) average))
                (incf average-dev (abs sum))
                (setf p (* sum sum))
                (incf standard-var p)
                (setf p (* p sum))
                (incf skew p)
                (setf p (* p sum))
                (incf kurtosis p))
          (setf average-dev (/ average-dev n))
          (setf standard-var (/ standard-var (- n 1)))
          (setf standard-dev (sqrt standard-var))
          (if (/= 0.0 standard-var)
              (progn
                (setf skew (/ skew (* n standard-dev standard-dev standard-dev)))
                (setf kurtosis (- (/ kurtosis (* n standard-var standard-var)) 3.0)))
            (progn
              (setf skew nil)
              (setf kurtosis nil)))
          (list average average-dev standard-dev standard-var skew kurtosis))
      (list (aref data 0) nil nil nil nil nil))))


2. The median calculation assumes a 1-array-offset (as in Fortran); but I believe Lisp
is 0-offset:

Hence the slightly modified median calculation:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; ORIGINAL version by:
;;;;;; From: Bill Schottstaedt <···@ccrma.Stanford.EDU>
;;;; Message-Id: <··················@ ccrma.Stanford.EDU >
;;;; Date: Fri, 26 Aug 94 07:15:28 -0700
;;;; To: ·····@cs.cmu.edu
;;
;; Changed by Siegfried Gonzi 2002
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun median (data-vector)
  (let* ((n (array-dimension data-vector 0))
         (n2 (floor n 2)))
    (sort data-vector #'<)
    (if (oddp n)
        (aref data-vector n2 )
      (* 0.5 (+ (aref data-vector (1- n2)) (aref data-vector n2 ))))))


(sort n data-vector) has been changed to (sort data-vector #'<)

I am not sure what (sort n data-vector) in the original code actually means.


[As a side note: The Numerical Recipes C code is based on 1-offset (C actually is
0-offset). They cheat the compiler and pass an array with a pointer which is decremented
by 1]. Maybe it is natural that a C programmer's brain becomes weird from time to time.

3. In the R language one can calculate the so called summary statistics:

e.g.

data <- c(0.23,1.0023,1.223,1.235,5.6,9.0,23.3456,34.458,34.56,78.9)

summary(data)

delivers:

   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  0.230   1.226   7.300  18.960  31.680  78.900

Everything is correct except the 1st quantile and 3rd quantile.

First, I could not believe it and fired up XLispStat:

(setf data (make-array 10 :initial-contents  '(0.23 1.0023 1.223 1.235 5.6 9.0 23.3456
34.458 34.56 78.9)))

(quantile data 0.25) and (quantile data 0.75) respectively:

delivers: 1.229 and 28.9018


I am not sure why R calculates the quantile-values wrong.

Therefore, I wrote a Lisp program for the summary statistics (note: the idea to the
quantile function has been stolen from the XLispStat code!)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Summary statistics (as in the R language):
;;
;;                minimum, first quantile, median, mean, third quantile, maximum
;;
;;    statistics of an data vector
;;
;; Function: (summary data-vector)
;; Parameter: data-vector...vector which holds the values
;;
;; Output: list of the above mentioned values
;;
;; (C) Siegfried Gonzi 2002
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun summary (data-vector)
                    (let ((data-vector (sort data-vector #'<))
                          (n (array-dimension data-vector 0))
                          (min nil)
                          (first-q nil)
                          (median nil)
                          (mean 0)
                          (third-q nil)
                          (max nil))
                      (flet ((quantile-sort (vec q n)
                                              (let* ((np (* q (- n 1)))
                                                     (low (floor np))
                                                     (high (ceiling np)))
                                                (/ (+ (aref vec low) (aref vec high))
2)))
                               (median-sort (data-vector n)
                                       (let* ((indx-n (floor n 2)))
                                         (if (oddp n)
                                             (aref data-vector indx-n )
                                           (* 0.5 (+ (aref data-vector (1- indx-n))
(aref data-vector indx-n)))))))
                        (setf min (aref data-vector 0))
                        (setf first-q (quantile-sort data-vector 0.25 n))
                        (setf median (median-sort data-vector n))
                        (loop :for j :from 0 :below n :do
                              (setf mean (+ mean (aref data-vector j))))
                        (setf mean (/ mean n))
                        (setf third-q (quantile-sort data-vector 0.75 n))
                        (setf max (aref data-vector (1- n))))
                      (list min first-q median mean third-q max)))

And:

(setf data (make-array 10 :initial-contents  '(0.23 1.0023 1.223 1.235 5.6 9.0 23.3456
34.458 34.56 78.9)))

(summary data)

delivers:

(0.23 1.2290001 7.3 18.955389 28.9018 78.9)


S. Gonzi
From: Roland Kaufmann
Subject: Statistics in CL [was Re: Common Lisp and plotting]
Date: 
Message-ID: <tl2y9i3ucz8.fsf_-_@space.at>
>>>>> "S" == Siegfried Gonzi <···············@kfunigraz.ac.at> writes:

[comments/corrections and additions to the "Numerical Recipes code"
http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/math/0.html
]
It would be a good idea to add informations like these to Cliki.

Have you looked at Larry Hunter's Stats?
[excerpt from http://ww.telent.net/cliki/Stats]:
Stats by is a Mathematics Library. A fairly extensive set of
statistical functions in Common Lisp. Find it at
http://www.biolisp.org/Code/code.html.

                                    Roland Kaufmann
From: Marco Antoniotti
Subject: BioLisp Mailing list. [Re: Statistics in CL [was Re: Common Lisp and plotting]]
Date: 
Message-ID: <y6cg04bgaak.fsf_-_@octagon.mrl.nyu.edu>
Roland Kaufmann <···············@space.at> writes:

> >>>>> "S" == Siegfried Gonzi <···············@kfunigraz.ac.at> writes:
> 
> [comments/corrections and additions to the "Numerical Recipes code"
> http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/math/0.html
> ]
> It would be a good idea to add informations like these to Cliki.
> 
> Have you looked at Larry Hunter's Stats?
> [excerpt from http://ww.telent.net/cliki/Stats]:
> Stats by is a Mathematics Library. A fairly extensive set of
> statistical functions in Common Lisp. Find it at
> http://www.biolisp.org/Code/code.html.

Since we are at it.... There is a "biolisp" mailing list going.  This
is for people who are working in biology/bioinformatics and use Common
Lisp.

	http://www.cat.nyu.edu/mailman/listinfo/biolisp

Cheers	

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.
From: Marc Battyani
Subject: Re: BioLisp Mailing list. [Re: Statistics in CL [was Re: Common Lisp and plotting]]
Date: 
Message-ID: <638F9CD6BD668A8C.DA5D24C120CF4D8E.39B2A65D345F0B88@lp.airnews.net>
"Marco Antoniotti" <·······@cs.nyu.edu> wrote
>
> Roland Kaufmann <···············@space.at> writes:
>
> > >>>>> "S" == Siegfried Gonzi <···············@kfunigraz.ac.at> writes:
> >
> > [comments/corrections and additions to the "Numerical Recipes code"
> >
http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/mat
h/0.html
> > ]
> > It would be a good idea to add informations like these to Cliki.
> >
> > Have you looked at Larry Hunter's Stats?
> > [excerpt from http://ww.telent.net/cliki/Stats]:
> > Stats by is a Mathematics Library. A fairly extensive set of
> > statistical functions in Common Lisp. Find it at
> > http://www.biolisp.org/Code/code.html.
>
> Since we are at it.... There is a "biolisp" mailing list going.  This
> is for people who are working in biology/bioinformatics and use Common
> Lisp.
>
> http://www.cat.nyu.edu/mailman/listinfo/biolisp

What does the "Python powered" logo means ?
The CMUCL compiler ?
;-)

Marc
From: Marco Antoniotti
Subject: Re: BioLisp Mailing list. [Re: Statistics in CL [was Re: Common Lisp and plotting]]
Date: 
Message-ID: <y6c6657g979.fsf@octagon.mrl.nyu.edu>
"Marc Battyani" <·············@fractalconcept.com> writes:

> "Marco Antoniotti" <·······@cs.nyu.edu> wrote
> >
> > Roland Kaufmann <···············@space.at> writes:
> >
> > > >>>>> "S" == Siegfried Gonzi <···············@kfunigraz.ac.at> writes:
> > >
> > > [comments/corrections and additions to the "Numerical Recipes code"
> > >
> http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/mat
> h/0.html
> > > ]
> > > It would be a good idea to add informations like these to Cliki.
> > >
> > > Have you looked at Larry Hunter's Stats?
> > > [excerpt from http://ww.telent.net/cliki/Stats]:
> > > Stats by is a Mathematics Library. A fairly extensive set of
> > > statistical functions in Common Lisp. Find it at
> > > http://www.biolisp.org/Code/code.html.
> >
> > Since we are at it.... There is a "biolisp" mailing list going.  This
> > is for people who are working in biology/bioinformatics and use Common
> > Lisp.
> >
> > http://www.cat.nyu.edu/mailman/listinfo/biolisp
> 
> What does the "Python powered" logo means ?
> The CMUCL compiler ?
> ;-)

Why are set on ruining a fine day? >:|

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.
From: Siegfried Gonzi
Subject: Re: Statistics in CL [was Re: Common Lisp and plotting]
Date: 
Message-ID: <3C6555E9.F941147F@kfunigraz.ac.at>
Roland Kaufmann wrote:

> Have you looked at Larry Hunter's Stats?
> [excerpt from http://ww.telent.net/cliki/Stats]:

I know it. MatLisp would be of interest but it only runs on CMUCL (and calls for the
stone-age user OS era) and CLisp (which calls for Emacs and vi  and is therefore also
the continuation of the stone age era).

1) If one wants to compile Stats (www.biolisp.org/Code/code.html) under AL CL 6 or
LispWorks 4.2 then he should remove the following from the source-code (but do not ask
me why) and everything will go on right, otherwise one gets some error reports: and in
AL CL one should redefine "square" and "range":

(defpackage "STATISTICS"
  (:nicknames "STATS")
  (:use "COMMON-LISP")
  (:export "MEAN" "MEDIAN" "MODE" "GEOMETRIC-MEAN" "RANGE" "PERCENTILE"
           "VARIANCE" "STANDARD-DEVIATION" "COEFFICIENT-OF-VARIATION"
           "STANDARD-ERROR-OF-THE-MEAN" "PERMUTATIONS" "CHOOSE"
           "BINOMIAL-PROBABILITY" "BINOMIAL-CUMULATIVE-PROBABILITY"
           "BINOMIAL-GE-PROBABILITY" "POISSON-PROBABILITY"
           "POISSON-CUMULATIVE-PROBABILITY" "POISSON-GE-PROBABILITY"
           "POISSON-CDF" "NORMAL-PDF" "CONVERT-TO-STANDARD-NORMAL" "PHI" "Z"
           "T-DISTRIBUTION" "CHI-SQUARE" "CHI-SQUARE-CDF"
           "BINOMIAL-PROBABILITY-CI" "POISSON-MU-CI" "NORMAL-MEAN-CI"
           "NORMAL-MEAN-CI-ON-SEQUENCES" "NORMAL-VARIANCE-CI"
           "NORMAL-VARIANCE-CI-ON-SEQUENCE" "NORMAL-SD-CI"
           "NORMAL-SD-CI-ON-SEQUENCE" "Z-TEST" "Z-TEST-ON-SEQUENCE"
           "T-TEST-ONE-SAMPLE" "T-TEST-ONE-SAMPLE-ON-SEQUENCE"
           "T-TEST-PAIRED" "T-TEST-PAIRED-ON-SEQUENCES" "T-TEST-TWO-SAMPLE"
           "T-TEST-TWO-SAMPLE-ON-SEQUENCES" "CHI-SQUARE-TEST-ONE-SAMPLE"
           "F-TEST" "BINOMIAL-TEST-ONE-SAMPLE" "BINOMIAL-TEST-TWO-SAMPLE"
           "FISHER-EXACT-TEST" "MCNEMARS-TEST" "POISSON-TEST-ONE-SAMPLE"
           "SIGN-TEST" "SIGN-TEST-ON-SEQUENCES" "WILCOXON-SIGNED-RANK-TEST"
           "WILCOXON-SIGNED-RANK-TEST-ON-SEQUENCES"
           "CHI-SQUARE-TEST-RXC" "CHI-SQUARE-TEST-FOR-TREND"
           "T-TEST-ONE-SAMPLE-SSE" "T-TEST-TWO-SAMPLE-SSE"
           "T-TEST-PAIRED-SSE" "BINOMIAL-TEST-ONE-SAMPLE-SSE"
           "BINOMIAL-TEST-TWO-SAMPLE-SSE" "BINOMIAL-TEST-PAIRED-SSE"
           "CORRELATION-SSE" "LINEAR-REGRESSION" "CORRELATION-COEFFICIENT"
           "CORRELATION-TEST-TWO-SAMPLE"
           "CORRELATION-TEST-TWO-SAMPLE-ON-SEQUENCES" "SPEARMAN-RANK-CORRELATION"
           "T-SIGNIFICANCE" "F-SIGNIFICANCE" "RANDOM-SAMPLE" "RANDOM-PICK"
           "BIN-AND-COUNT" "FISHERS-Z-TRANSFORM" "MEAN-SD-N" "SQUARE" "ROUND-FLOAT"))

(in-package "STATISTICS")


2) I had tried some functions but the calculations had been aborted by some error
reports. What I can remember for example actually is that "linear-regression" does not
work.


S. Gonzi
From: Brian P Templeton
Subject: Re: Statistics in CL [was Re: Common Lisp and plotting]
Date: 
Message-ID: <87sn8axdes.fsf@tunes.org>
Siegfried Gonzi <···············@kfunigraz.ac.at> writes:

> Roland Kaufmann wrote:
> 
>> Have you looked at Larry Hunter's Stats?
>> [excerpt from http://ww.telent.net/cliki/Stats]:
> 
> I know it. MatLisp would be of interest but it only runs on CMUCL
> (and calls for the stone-age user OS era) and CLisp (which calls for
> Emacs and vi and is therefore also the continuation of the stone age
> era).
> 
...or, alternatively (and *much* more accurately[�]), the LispMs
represent the Golden Age, and Unix represents the Bronze Age. (I won't
say which age *you* apparently exist in.) Troll!

;; Just like plonk, except it's scoring down, not killfiling
*plink*

[...]
> 
> S. Gonzi
> 

Footnotes: 
[�] From your `complaint', you apparently don't understand *either* of
    the things you're complaining about at all. Also, of course this
    is just a temporary analogy - I am sure this metaphor will cease
    to be accurate fairly soon.

-- 
BPT <···@tunes.org>	    		/"\ ASCII Ribbon Campaign
backronym for Linux:			\ / No HTML or RTF in mail
	Linux Is Not Unix			 X  No MS-Word in mail
Meme plague ;)   --------->		/ \ Respect Open Standards
From: Siegfried Gonzi
Subject: Re: Statistics in CL [was Re: Common Lisp and plotting]
Date: 
Message-ID: <3C677FEA.921AD295@kfunigraz.ac.at>
Brian P Templeton wrote:

> Footnotes:
> [�] From your `complaint', you apparently don't understand *either* of
>     the things you're complaining about at all.

What really bothers me: I do not know enough about mathematics (I would
like do know more about topology); I would like to know more about
quantum-mechanics, statictical-physics; history; philosophy;...

Whether you believe I am stepped out for lunch or not is really not on my
tablet.

> Also, of course this
>     is just a temporary analogy - I am sure this metaphor will cease
>     to be accurate fairly soon.

Thank you! Another day where Lisp and Unix/Linux cured cancer.


S. Gonzi
From: Raymond Toy
Subject: Re: Statistics in CL [was Re: Common Lisp and plotting]
Date: 
Message-ID: <4nd6zcum8h.fsf@rtp.ericsson.se>
>>>>> "Siegfried" == Siegfried Gonzi <···············@kfunigraz.ac.at> writes:

    Siegfried> Roland Kaufmann wrote:
    >> Have you looked at Larry Hunter's Stats?
    >> [excerpt from http://ww.telent.net/cliki/Stats]:

    Siegfried> I know it. MatLisp would be of interest but it only
    Siegfried> runs on CMUCL (and calls for the stone-age user OS era)
    Siegfried> and CLisp (which calls for Emacs and vi and is
    Siegfried> therefore also the continuation of the stone age era).

Matlisp also runs on ACL.

I don't know about you, but I think we are all a continuation of the
stone age era.  If you're not, you'd be dead.

Ray