micro-stats
This egg provides simple statistical operations. Very simple.
Documentation
Types
sequence
statistics-alist
Note a sequence as understood by the sequences egg.
Usage
(import micro-stats)generate-statistics
(generate-statistics SEQ [SET-ID]) -> statistics-alistSEQ(sequence-of real); SEQ of all iterations, in microsecondsSET-IDsymbol;'normal
Returns an alist with the following:
size- the count of the
SEQ min- the minimum of the
SEQ max- the maximum of the
SEQ mean- arithmetic-mean alias
arithmetic-mean- the arithmetic average of the
SEQ sd- standard-deviation alias
sigma- standard-deviation alias
standard-deviation- the standard deviation for the
SEQ
When verbose adds the following:
95th- the 95th percentile of the
SEQ harmonic-mean- the harmonic average of the
SEQ geometric-mean- the geometric average of the
SEQ median- the median of the
SEQ mode- the mode of the
SEQ var- variance alias
sigma^2- variance alias
variance- the variance for the
SEQ
When full adds the following:
basic-statistics
(basic-statistics SEQ) -> (vector-of real)Returns #(m h g s v) for the SEQ.
SEQ(sequence-of real); the sample
generate-statistics-alist
(generate-statistics-alist SEQ FUNCS [BASICS]) -> statistics-alistReturns an alist for a set of statistical functions results.
SEQ(sequence-of real); the sampleFUNCS(list-of function-spec); the report templateBASICS#(m h g s v); required statistics
A function-spec is:
size- sample count
min- sample minimum
max- sample maximum
arithmetic-mean- sample arithmetic-average
standard-deviation- sample standard-deviation
percentile- sample
Pth-percentile ; default is95 harmonic-mean- sample harmonic-average
geometric-mean- sample geometric-average
median- sample median
mode- sample mode
variance- sample variance
- ...
(KEY . (F [PARAM ...]))- sample parameterized
(: F function-spec)
percentile
(percentile SEQ [P]) -> realReturns Pth percentile of SEQ.
SEQ(sequence-of real)P[0 .. 100]; defaults is95
quantile
(quantile SEQ P) -> realReturns p-quantile of SEQ.
SEQ(sequence-of real)P[0 .. 1]
interquartile-range
(interquartile-range SEQ) -> realReturns Q(.75) - Q(.25).
SEQ(sequence-of real)
five-number-summary
(five-number-summary SEQ) -> real real real real realReturns Q(0.0) Q(.25) Q(.50) Q(.75) Q(1.0).
SEQ(sequence-of real)
mean*
(mean* SEQ) -> real real realReturns the arithmetic, harmonic, & geometric means for SEQ.
SEQ(sequence-of real)
arithmetic-mean
mean
Returns the average for SEQ.
SEQ(sequence-of real)
harmonic-mean
(harmonic-mean SEQ) -> realgeometric-mean
(geometric-mean SEQ) -> realmedian
(median SEQ) -> realReturns the median of the SEQ.
SEQ(sequence-of real)
mode
(mode SEQ) -> realReturns the mode of the SEQ.
SEQ(sequence-of real)
variance
(variance SEQ [BIAS]) -> realReturns the variance for SEQ.
SEQ(sequence-of real)BIAS(or boolean integer); bias correction, default is#f
Bias correction gets disabled by setting BIAS to {#f}, or a positive integer can be used instead of the number of elements.
standard-deviation*
(standard-deviation* SEQ [BIAS]) -> real realReturns the standard-deviation & variance for SEQ.
SEQ(sequence-of real)BIAS(or boolean integer); bias correction, default is#f
standard-deviation
(standard-deviation SEQ [BIAS]) -> realReturns the standard-deviation for SEQ.
SEQ(sequence-of real)BIAS(or boolean integer); bias correction, default is#f
absolute-deviation
(absolute-deviation SEQ) -> realSEQ(sequence-of real)
kurtosis
(kurtosis SEQ [BIAS]) -> realReturns Pearson's measure of a dataset.
SEQ(sequence-of real)BIAS(or boolean integer); bias correction, default is#f
skewness
(skewness SEQ [BIAS]) -> realReturns Pearson's measure of a dataset.
SEQ(sequence-of real)BIAS(or boolean integer); bias correction, default is#f
covariance
(covariance SEQ-A SEQ-B [BIAS/JP]) -> realReturns a measure of the variability of two datasets.
SEQ-A(sequence-of real)SEQ-B(sequence-of real)BIAS/JP(or boolean integer sequence); bias correction or joint-probabilities, default is#f
correlation
(correlation SEQ-A SEQ-B [BIAS/JP]) -> realReturns a measure of the linear relation of two datasets.
SEQ-A(sequence-of real)SEQ-B(sequence-of real)BIAS/JP(or boolean integer sequence); bias correction or joint-probabilities, default is#f
chi-square
(chi-square EXPECTED OBSERVED [YATES]) -> realReturns Pearson's χ2 test w/ optional ''Yates Correction'.
EXPECTED(sequence-of real)OBSERVED(sequence-of real)YATESboolean; use Yates Correction, default#f
Requirements
srfi-1 sequences sequences-utils
Authors
Repository
This egg is hosted on the CHICKEN Subversion repository:
https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/micro-stats
If you want to check out the source code repository of this egg and you are not familiar with Subversion, see this page.
Version history
- 0.7.1
- Fix
covariance&correlationarguments. - 0.7.0
- Default
biasis#f. Addcovariance,correlation,kurtosis,chi-square, &skewness. - 0.6.0
- Multi-valued return functions are suffixed w/ a * and single-valued provided. Fix
biastype. - 0.5.0
- C6 release.
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A full copy of the GPL license can be found at <http://www.gnu.org/licenses/>.