SandBox Statistics
last edited 12 years ago by test1

Edit detail for SandBox Statistics revision 1 of 2

1 2
Editor:
Time: 2007年11月18日 18:38:23 GMT-8
Note: is it possible to change the package

changed:
-
Testing Martin's statistics code
\begin{axiom}
)abbrev package STAT StatisticalFunctions
StatisticalFunctions(F:Field): Exports == Implementation where
 Exports == with
 mean: List F -> F
 stddev: List F -> F
 if F has OrderedRing then
 median: List F -> F
 Implementation == add
 mean l == 
 n := #l::F
 if n = 0 then error "The mean of an empty list is not defined"
 reduce(_+, l)/n
 stddev l ==
 n := #l::F
 if n = 0 then error "The standard deviation of an empty list is not _
 defined"
 m := mean l
 reduce(_+, map((#1-m)**2, l)$ListFunctions2(F,F))/(n-1)
 if F has OrderedRing then
 median l == 
 n := #l
 if n = 0 then error "The median of an empty list is not defined"
 sort(l).(n quo 2)
\end{axiom}
\begin{axiom}
mean [1,2,3]
\end{axiom}
From unknown Tue Jul 26 05:15:09 -0500 2005
From: unknown
Date: 2005年7月26日 05:15:09 -0500
Subject: is it possible to change the package
Message-ID: <20050726051509-0500@page.axiom-developer.org>
\begin{axiom}
median (["a","g","u","a","d"])
\end{axiom}

Testing Martin's statistics code

fricas
)abbrev package STAT StatisticalFunctions
StatisticalFunctions(F:Field): Exports == Implementation where
Exports == with mean: List F -> F
stddev: List F -> F
if F has OrderedRing then median: List F -> F
Implementation == add
mean l == n := #l::F if n = 0 then error "The mean of an empty list is not defined" reduce(_+, l)/n
stddev l == n := #l::F if n = 0 then error "The standard deviation of an empty list is not _ defined"
m := mean l reduce(_+, map((#1-m)**2, l)$ListFunctions2(F,F))/(n-1)
if F has OrderedRing then median l == n := #l if n = 0 then error "The median of an empty list is not defined" sort(l).(n quo 2)
fricas
Compiling FriCAS source code from file 
 /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/4372653822899247572-25px.001.spad
 using old system compiler.
 STAT abbreviates package StatisticalFunctions 
******** Spad syntax error detected ********
Expected: |)|
The prior line was:
25> m := mean l
The current line is:
26> reduce(_+, map((#1-m)**2, l)$ListFunctions2(F,F))/(n-1)
The number of valid tokens is 1. The prior token was #S(TOKEN :SYMBOL |)| :TYPE KEYWORD :NONBLANK 26) The current token is #S(TOKEN :SYMBOL POWER :TYPE KEYWORD :NONBLANK 26)

fricas
mean [1,2,3]
Type: Symbol

is it possible to change the package --unknown, 2005年7月26日 05:15:09 -0500 reply
fricas
median (["a","g","u","a","d"])
Type: Symbol

AltStyle によって変換されたページ (->オリジナル) /