The cl-mathstats Reference Manual

This is the cl-mathstats Reference Manual, version 0.8.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:26:35 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-mathstats

Common Lisp math and statistics routines

Maintainer

Gary Warren King <>

Author

Gary Warren King <>

License

MIT Style License

Version

0.8.2

Dependencies
  • metatilities-base (system).
  • cl-containers (system).
Source

cl-mathstats.asd.

Child Components

3 Modules

Modules are listed depth-first from the system components tree.


3.1 cl-mathstats/dev

Source

cl-mathstats.asd.

Parent Component

cl-mathstats (system).

Child Components

3.2 cl-mathstats/website

Source

cl-mathstats.asd.

Parent Component

cl-mathstats (system).

Child Component

source (module).


3.3 cl-mathstats/website/source

Source

cl-mathstats.asd.

Parent Component

website (module).

Child Component

index.md (file).


4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 cl-mathstats/cl-mathstats.asd

Source

cl-mathstats.asd.

Parent Component

cl-mathstats (system).

ASDF Systems

cl-mathstats.

Packages

asdf-cl-mathstats.


4.1.2 cl-mathstats/dev/package.lisp

Source

cl-mathstats.asd.

Parent Component

dev (module).

Packages

cl-mathstats.


4.1.3 cl-mathstats/dev/api.lisp

Dependency

package.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface

dot-product (generic function).


4.1.4 cl-mathstats/dev/parameters.lisp

Dependency

package.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Internals

*gaussian-cdf-signals-zero-standard-deviation-error* (special variable).


4.1.5 cl-mathstats/dev/math-utilities.lisp

Dependency

package.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface

4.1.6 cl-mathstats/dev/class-defs.lisp

Dependency

package.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Internals

4.1.7 cl-mathstats/dev/definitions.lisp

Dependency

math-utilities.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface

4.1.8 cl-mathstats/dev/binary-math.lisp

Dependency

package.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface

4.1.9 cl-mathstats/dev/matrices.lisp

Dependency

package.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface
Internals

4.1.10 cl-mathstats/dev/matrix-fns.lisp

Dependency

matrices.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface
Internals

4.1.11 cl-mathstats/dev/density-fns.lisp

Dependency

parameters.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface
Internals

4.1.12 cl-mathstats/dev/svd.lisp

Dependency

matrix-fns.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface
Internals

4.1.13 cl-mathstats/dev/utilities.lisp

Dependency

package.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface
Internals

4.1.14 cl-mathstats/dev/define-statistical-fun.lisp

Dependency

package.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface

convert (method).

Internals

4.1.15 cl-mathstats/dev/basic-statistics.lisp

Dependencies
Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface
Internals

4.1.16 cl-mathstats/dev/smoothing.lisp

Dependency

utilities.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface

4.1.17 cl-mathstats/dev/correlation-regression.lisp

Dependencies
Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface
Internals

4.1.18 cl-mathstats/dev/anova.lisp

Dependency

package.lisp (file).

Source

cl-mathstats.asd.

Parent Component

dev (module).

Public Interface
Internals

4.2 Static


4.2.1 cl-mathstats/website/source/index.md

Source

cl-mathstats.asd.

Parent Component

source (module).


5 Packages

Packages are listed by definition order.


5.1 asdf-cl-mathstats

Source

cl-mathstats.asd.

Use List
  • asdf/interface.
  • common-lisp.

5.2 cl-mathstats

Source

package.lisp.

Nickname

metabang.math

Use List
  • common-lisp.
  • metabang.cl-containers.
  • metabang.utilities.
Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Constants

Constant: +0degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +10degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +120degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +135degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +150degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +15degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +180degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +210degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +225degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +240degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +270degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +300degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +30degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +315degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +330degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +360degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +45degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +5degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +60degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +90degrees+
Package

cl-mathstats.

Source

definitions.lisp.

Constant: +e+

An approximation of the constant e (named for Euler!).

Package

cl-mathstats.

Source

math-utilities.lisp.

Constant: 2fpi

The constant 2*pi, in single-float format. Using this constant avoid run-time double-float contagion.

Package

cl-mathstats.

Source

math-utilities.lisp.

Constant: fpi

The constant pi, in single-float format. Using this constant avoid run-time double-float contagion.

Package

cl-mathstats.

Source

math-utilities.lisp.


6.1.2 Macros

Macro: underflow-goes-to-zero (&body body)

Protects against floating point underflow errors and sets the value to 0.0 instead.

Package

cl-mathstats.

Source

density-fns.lisp.

Macro: with-temp-table ((temp) &body forms)

Binds ‘temp’ to a hash table.

Package

cl-mathstats.

Source

utilities.lisp.

Macro: with-temp-vector ((temp min-size) &body forms)

Binds ‘temp’ to a vector of length at least ‘min-size.’ It’s a vector of pointers and has a fill-pointer, initialized to ‘min-size.’

Package

cl-mathstats.

Source

utilities.lisp.


6.1.3 Ordinary functions

Function: anova-one-way-variables (&rest args)

ANOVA-ONE-WAY-VARIABLES (IV DV &OPTIONAL (SCHEFFE-TESTS-P T) CONFIDENCE-INTERVALS)
Performs a one-way analysis of variance (ANOVA) on the input data, which should be two equal-length sequences: ‘iv’ is the independent variable, represented as a sequence of categories or group identifiers, and ‘dv’ is the dependent variable, represented as a sequence of numbers. The ‘iv’ variable must be “sorted,” meaning that AAABBCCCCCDDDD is okay but ABCDABCDABDCDC is not, where A, B, C and D are group identifiers. Furthermore, each group should consist of at least 2 elements.

The significance of the result indicates that the group means are not all equal; that is, at least two of the groups have significantly different means. If there were only two groups, this would be semantically equivalent to an unmatched, two-tailed t-test, so you can think of the one-way ANOVA as a multi-group, two-tailed t-test.

This function returns five values: 1. an ANOVA table; 2. a list a group means; 3. either a Scheffe table or nil depending on ‘scheffe-tests-p’; and 4. an alternate value for SST. 5. a list of confidence intervals in the form ‘(,mean ,lower ,upper) for each group, if ‘confidence-intervals’ is a number between zero and one, giving the kind of confidence interval, such as 0.9. The fourth value is only interesting if you think there are numerical accuracy problems; it should be approximately equal to the SST value in the ANOVA table. This function differs from ‘anova-one-way-groups’ only in its input representation. See the manual for more information.

Package

cl-mathstats.

Source

anova.lisp.

Function: anova-two-way-variables (&rest args)

ANOVA-TWO-WAY-VARIABLES (DV IV1 IV2)
Calculates the analysis of variance when there are two factors that may affect the dependent variable, specifically ‘iv1’ and ‘iv2.’ Unlike the one-way ANOVA, there are mathematical difficulties with the two-way ANOVA if there are unequal cell sizes; therefore, we require all cells to be the same size; that is, the same number of values (of the dependent variable) for each combination of the independent factors.

The result of the analysis is an anova-table, as described in the manual. This function differs from ‘anova-two-way-groups’ only in its input representation. See the manual for further discussion of analysis of variance.
The row effect is ‘iv1’ and the column effect is ‘iv2.’

Package

cl-mathstats.

Source

anova.lisp.

Function: anova-two-way-variables-unequal-cell-sizes (&rest args)

ANOVA-TWO-WAY-VARIABLES-UNEQUAL-CELL-SIZES (IV1 IV2 DV)
Calculates the analysis of variance when there are two factors that may affect the dependent variable, specifically ‘iv1’ and ‘iv2.’

Unlike the one-way ANOVA, there are mathematical difficulties with the two-way ANOVA if there are unequal cell sizes. This function differs fron the standard two-anova by (1) the use of cell means as single scores, (2) the division of squared quantities by the number of cell means contributing to the quantity that is squared and (3) the multiplication of a "sum of squares" by the harmonic mean of the sample sizes.

The result of the analysis is an anova-table, as described in the manual. See the manual for further discussion of analysis of
variance. The row effect is ‘iv1’ and the
column effect is ‘iv2.’

Package

cl-mathstats.

Source

anova.lisp.

Function: autocorrelation (&rest args)

AUTOCORRELATION (SAMPLE MAX-LAG &OPTIONAL (MIN-LAG 0))
Autocorrelation is merely a cross-correlation between a sample and itself. This function returns a list of correlations, where the i’th element is the correlation of the sample with the sample starting at ‘i.’

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: beta (z w)

Returns the value of the Beta function, defined in terms of the complete gamma function, G, as: G(z)G(w)/G(z+w). The implementation follows Numerical Recipes in C, section 6.1.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: beta-incomplete (a b x)

This function is useful in defining the cumulative distributions for Student’s t and the F distribution.

All arguments must be floating-point numbers; ‘a’ and ‘b’ must be positive and ‘x’ must be between 0.0 and 1.0, inclusive.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: binomial-cdf (p n k)

Suppose an event occurs with probability ‘p’ per trial. This function computes the probability of ‘k’ or more events occurring in ‘n’ trials. Note that this is the complement of the usual definition of cdf. This function approximates the actual computation using the incomplete beta function, but is preferable for large ‘n’ (greater than a dozen or so) because it avoids summing many tiny floating-point numbers.

The implementation follows Numerical Recipes in C, section 6.3
.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: binomial-cdf-exact (p n k)

This is an exact but computationally intensive form of the preferred function, ‘binomial-cdf.’

Package

cl-mathstats.

Source

density-fns.lisp.

Function: binomial-coefficient (n k)

Returns the binomial coefficient, ‘n’ choose ‘k,’ as an integer. The result may not be exactly correct, since the computation is done with logarithms. The result is rounded to an integer. The implementation follows Numerical Recipes in C, section 6.1

Package

cl-mathstats.

Source

density-fns.lisp.

Function: binomial-coefficient-exact (n k)

This is an exact but computationally intensive form of the preferred function, ‘binomial-coefficient.’

Package

cl-mathstats.

Source

density-fns.lisp.

Function: binomial-probability (p n k)

Returns the probability of ‘k’ successes in ‘n’ trials, where at each trial the probability of success is ‘p.’ This function uses floating-point approximations, and so is computationally efficient but not necessarily exact.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: binomial-probability-exact (p n k)

This is an exact but computationally intensive form of the preferred function, ‘binomial-probability.’

Package

cl-mathstats.

Source

density-fns.lisp.

Function: chi-square-significance (x dof)

Computes the complement of the cumulative distribution function for a Chi-square random variable with ‘dof’ degrees of freedom evaluated at ‘x.’ The result is the probability that the observed chi-square for a correct model should be greater than ‘x.’ The implementation follows Numerical Recipes in C, section 6.2. Small values suggest that the null hypothesis should be rejected; in other words, this computes the significance of ‘x.’

Package

cl-mathstats.

Source

density-fns.lisp.

Function: combination-count (n k)

Returns the number of combinations of n elements taken k at a time. Assumes valid input.

Package

cl-mathstats.

Source

math-utilities.lisp.

Function: confidence-interval (&rest args)

CONFIDENCE-INTERVAL NIL NIL

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: confidence-interval-proportion (&rest args)

CONFIDENCE-INTERVAL-PROPORTION (X N CONFIDENCE)
Suppose we have a sample of ‘n’ things and ‘x’ of them are “successes.” We can estimate the population proportion of successes as x/n; call it ‘p-hat.’ This function computes the estimate and a confidence interval on it. This function is not appropriate for small samples with p-hat far from 1/2: ‘x’ should be at least 5, and so should ‘n’-‘x.’ This function returns three values: p-hat, and the lower and upper bounds of the confidence interval. ‘Confidence’ should be a number between 0 and 1, exclusive.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: confidence-interval-t (&rest args)

CONFIDENCE-INTERVAL-T (DATA CONFIDENCE)
Suppose you have a sample of 10 numbers and you want to compute a 90 percent confidence interval on the population mean. This function is the one to use. This function uses the t-distribution, and so it is appropriate for small sample sizes. It can also be used for large sample sizes, but the function ‘confidence-interval-z’ may be computationally faster. It returns three values: the mean and the lower and upper bound of the confidence interval. True, only two numbers are necessary, but the confidence intervals of other statistics may be asymmetrical and these values would be consistent with those confidence intervals. ‘Sample’ should be a sequence of numbers. ‘Confidence’ should be a number between 0 and 1, exclusive.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: confidence-interval-t-summaries (mean dof standard-error confidence)

This function is just like ‘confidence-interval-t,’ except that instead of its arguments being the actual data, it takes the following summary statistics: ‘mean,’ which is the estimator of some t-distributed parameter; ‘dof,’ which is the number of degrees of freedom in estimating the mean; and the ‘standard-error’ of the estimator. In general, ‘mean’ is a point estimator of the mean of a t-distribution, which may be the slope parameter of a regression, the difference between two means, or other practical t-distributions. ‘Confidence’ should be a number between 0 and 1, exclusive.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: confidence-interval-z (&rest args)

CONFIDENCE-INTERVAL-Z (DATA CONFIDENCE)
Suppose you have a sample of 50 numbers and you want to compute a 90 percent confidence interval on the population mean. This function is the one to use. Note that it makes the assumption that the sampling distribution is normal, so it’s inappropriate for small sample sizes. Use confidence-interval-t instead. It returns three values: the mean and the lower and upper bound of the confidence interval. True, only two numbers are necessary, but the confidence intervals of other statistics may be asymmetrical and these values would be consistent with those confidence intervals. This function handles 90, 95 and 99 percent confidence intervals as special cases, so those will be quite fast. ‘Sample’ should be a sequence of numbers. ‘Confidence’ should be a number between 0 and 1, exclusive.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: correlation (&rest args)

CORRELATION (SAMPLE1 SAMPLE2 &KEY START1 END1 START2 END2) Computes the correlation coefficient of two samples, which should be equal-length sequences of numbers.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: correlation-from-summaries (n x x2 y y2 xy)

Computes the correlation of two variables given summary statistics of the variables. All of these arguments are summed over the variable: ‘x’ is the sum of the x’s, ‘x2’ is the sum of the squares of the x’s, and ‘xy’ is the sum of the cross-products, which is also known as the inner product of the variables x and y. Of course, ‘n’ is the number of data values in each variable.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: correlation-matrix (dv ivs)

Returns a matrix of all the correlations of all the variables. The dependent variable is row and column zero.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: covariance (&rest args)

COVARIANCE (SAMPLE1 SAMPLE2 &KEY START1 END1 START2 END2)
Computes the covariance of two samples, which should be equal-length sequences of numbers. Covariance is the inner product of differences between sample elements and their sample means. For more information, see the manual.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: cross-correlation (&rest args)

CROSS-CORRELATION (SEQUENCE1 SEQUENCE2 MAX-LAG &OPTIONAL (MIN-LAG 0)) Returns a list of the correlation coefficients for all lags from ‘min-lag’ to ‘max-lag,’ inclusive, where the ‘i’th list element is the correlation of the first (length-of-sequence1 - i) elements of sequence1 with with the last i elements of sequence2. Both sequences should be sequences of numbers and of equal length.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: d-test (&rest args)

D-TEST (SAMPLE-1 SAMPLE-2 TAILS &KEY (TIMES 1000) (H0MEAN 0))
Two-sample test for difference in means. Competes with the unmatched, two-sample t-test. Each sample should be a sequence of numbers. We calculate the mean of ‘sample-1’ minus the mean of ‘sample-2’; call that D. Under the null hypothesis, D is zero. There are three possible alternative hypotheses: D is positive, D is negative, and D is either, and they are selected by the ‘tails’ parameter, which must be :positive, :negative, or :both, respectively. We count the number of chance occurrences of D in the desired rejection region, and return the estimated probability.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: data-length (&rest args)

DATA-LENGTH (DATA &KEY START END KEY)
Returns the number of data values in ‘data.’ Essentially, this is the Common Lisp ‘length’ function, except it handles sequences where there is a ‘start’ or ‘end’ parameter. The ‘key’ parameter is ignored.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: degrees->radians (degrees)

Convert degrees to radians.

Package

cl-mathstats.

Source

math-utilities.lisp.

Function: div2 (i &optional power)

Divide positive fixnum ‘i’ by 2 or a power of 2, yielding an integer result. For example, (div2 35 5) => 1.

Package

cl-mathstats.

Source

binary-math.lisp.

Function: ensure-float (number)
Package

cl-mathstats.

Source

math-utilities.lisp.

Function: error-function (x)

Computes the error function, which is typically used to compute areas under the Gaussian probability distribution. See the manual for more information. Also see the function ‘gaussian-cdf.’

This implementation follows Numerical Recipes in C, section 6.2

Package

cl-mathstats.

Source

density-fns.lisp.

Function: error-function-complement (x)

This function computes the complement of the error function, “erfc(x),” defined as 1-erf(x). See the documentation for ‘error-function’ for a more complete definition and description. Essentially, this function on z/sqrt2 returns the two-tailed significance of z in a standard Gaussian distribution.

This function implements the function that Numerical Recipes in C calls erfcc, see section 6.3; that is, it’s the one using the Chebyshev approximation, since that is the one they call from their statistical functions. It is quick to compute and has fractional error everywhere less than 1.2x10^\{-7\}.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: exp2 (n)

2^n

Package

cl-mathstats.

Source

binary-math.lisp.

Function: extract-unique-values (sequence)

A faster version of ‘remove-duplicates’. Note you cannot specify a :TEST (it is always #’eq).

Package

cl-mathstats.

Source

utilities.lisp.

Function: f-measure (precision recall &optional beta)

Returns the f-measure, the combination of precision and recall based on parameter beta - default = .5 which => precision and recall are equally weighted. beta = 1 => precision is maximized. beta = 0 => recall is maximized.

From a recent statistics book - All of Statistics - springer verlag http://www2.springeronline.com/sgw/cda/frontpage/0,,4-10128-22-13887455-0,00.html

Package

cl-mathstats.

Source

math-utilities.lisp.

Function: f-significance (f-statistic numerator-dof denominator-dof &optional one-tailed-p)

This function occurs in the statistical test of whether two observed samples have the same variance. A certain statistic, F, essentially the ratio of the observed dispersion of the first sample to that of the second one, is calculated. This function computes the tail areas of the null hypothesis: that the variances of the numerator and denominator are equal. It can be used for either a one-tailed or two-tailed test. The default is two-tailed, but one-tailed can be computed by setting the optional argument ‘one-tailed-p’ to true.

For a two-tailed test, this function computes the probability that F would be as different from 1.0 (larger or smaller) as it is, if the null hypothesis is true.

For a one-tailed test, this function computes the probability that F would be as LARGE as it is if the first sample’s underlying distribution actually has SMALLER variance that the second’s, where ‘numerator-dof’ and ‘denominator-dof’ is the number of degrees of freedom in the numerator sample and the denominator sample. In other words, this computes the significance level at which the hypothesis “the numerator sample has smaller variance than the denominator sample” can be rejected.

A small numerical value implies a very significant rejection.

The ‘f-statistic’ must be a non-negative floating-point number. The degrees of freedom arguments must be positive integers. The ‘one-tailed-p’ argument is treated as a boolean.

This implementation follows Numerical Recipes in C, section 6.3 and the ‘ftest’ function in section 13.4. Some of the documentation is also drawn from the section 6.3, since I couldn’t improve on their explanation.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: factorial (n)

Returns the factorial of ‘n,’ which should be a non-negative integer. The result will returned as a floating-point number, single-float if possible, otherwise double-float. If it is returned as a double-float, it won’t necessarily be integral, since the actual computation is

(exp (gamma-ln (1+ n)))

Implementation is loosely based on Numerical Recipes in C, section 6.1. On the TI Explorer, the largest argument that won’t cause a floating overflow is 170.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: factorial-exact (n)

Returns the factorial of ‘n,’ which should be an integer. The result will returned as an integer or bignum. This implementation is exact, but is more computationally expensive than ‘factorial,’ which is to be preferred.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: factorial-ln (n)

Returns the natural logarithm of n!; ‘n’ should be an integer. The result will be a single-precision, floating point number. The implementation follows Numerical Recipes in C, section 6.1

Package

cl-mathstats.

Source

density-fns.lisp.

Function: gamma-incomplete (a x)

This is an incomplete gamma function, what Numerical Recipes in C calls “gammp.” This function also returns, as the second value, g(a,x). See the manual for more information.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: gamma-ln (x)

Returns the natural logarithm of the Gamma function evaluated at ‘x.’ Mathematically, the Gamma function is defined to be the integral from 0 to Infinity of t^x exp(-t) dt. The implementation is copied, with extensions for the reflection formula, from Numerical Recipes in C, section 6.1. The argument ‘x’ must be positive. Full accuracy is obtained for x>1. For x<1, the reflection formula is used. The computation is done using double-floats, and the result is a double-float.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: gaussian-cdf (x &optional mean sd)

Computes the cumulative distribution function for a Gaussian random variable (defaults: mean=0.0, s.d.=1.0) evaluated at ‘x.’ The result is the probability of getting a random number less than or equal to ‘x,’ from the given Gaussian distribution.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: gaussian-significance (x tails &optional mean sd)

Computes the significance of ‘x’ in a Gaussian distribution with mean=‘mean’ (default 0.0) and standard deviation=‘sd’ (default 1.0); that is, it returns the area which farther from the mean than ‘x’ is.

The null hypothesis is roughly that ‘x’ is zero; you must specify your alternative hypothesis (H1) via the ‘tails’ parameter, which must be :both, :positive or :negative. The first corresponds to a two-tailed test: H1 is that ‘x’ is not zero, but you are not specifying a direction. If the parameter is :positive, H1 is that ‘x’ is positive, and similarly for :negative.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: interquartile-range (&rest args)

INTERQUARTILE-RANGE (DATA)
The interquartile range is similar to the variance of a sample because both are statistics that measure out “spread out” a sample is. The interquartile range is the difference between the 3/4 quantile (the upper quartile) and the 1/4 quantile (the lower quartile).

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: lagged-correlation (sequence1 sequence2 lag)

Returns the correlations of ‘sequence1’ with ‘sequence2’ after shifting ‘sequence1’ by ‘lag’. This means that for all n, element n of ‘sequence1’ is paired with element n+‘lag’ of ‘sequence2’, where both of those elements exist.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: linear-regression-brief (dv iv)

Calculates the main statistics of a linear regression: the slope and intercept of the line, the coefficient of determination, also known as r-square, the standard error of the slope, and the p-value for the regression. This function takes two equal-length sequences of raw data. Note that the dependent variable, as always, comes first in the argument list.

You should first look at your data with a scatter plot to see if a linear model is plausible. See the manual for a fuller explanation of linear regression statistics.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: linear-regression-brief-summaries (n x y x2 y2 xy)

Calculates the main statistics of a linear regression: the slope and intercept of the line, the coefficient of determination, also known as r-square, the standard error of the slope, and the p-value for the regression. This function differs from ‘linear-regression-brief’ in that it takes summary variables: ‘x’ and ‘y’ are the sums of the independent variable and dependent variables, respectively; ‘x2’ and ‘y2’ are the sums of the squares of the independent variable and dependent variables, respectively; and ‘xy’ is the sum of the products of the independent and dependent variables.

You should first look at your data with a scatter plot to see if a linear model is plausible. See the manual for a fuller explanation of linear regression statistics.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: linear-regression-minimal (dv iv)

Calculates the slope and intercept of the regression line. This function takes two equal-length sequences of raw data. Note that the dependent variable, as always, comes first in the argument list.

You should first look at your data with a scatter plot to see if a linear model is plausible. See the manual for a fuller explanation of linear regression statistics.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: linear-regression-minimal-summaries (n x y x2 y2 xy)

Calculates the slope and intercept of the regression line. This function differs from ‘linear-regression-minimal’ in that it takes summary statistics: ‘x’ and ‘y’ are the sums of the independent variable and dependent variables, respectively; ‘x2’ and ‘y2’ are the sums of the squares of the independent variable and dependent variables, respectively; and ‘xy’ is the sum of the products of the independent and dependent variables.

You should first look at your data with a scatter plot to see if a linear model is plausible. See the manual for a fuller explanation of linear regression statistics.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: linear-regression-verbose (dv iv)

Calculates almost every statistic of a linear regression: the slope and intercept of the line, the standard error on each, the correlation coefficient, the coefficient of determination, also known as r-square, and an ANOVA table as described in the manual.

This function takes two equal-length sequences of raw data. Note that the dependent variable, as always, comes first in the argument list. If you don’t need all this information, consider using the “-brief,” or “-minimal” functions, which do less computation.

You should first look at your data with a scatter plot to see if a linear model is plausible. See the manual for a fuller explanation of linear regression statistics.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: linear-regression-verbose-summaries (n x y x2 y2 xy)

Calculates almost every statistic of a linear regression: the slope and intercept of the line, the standard error on each, the correlation coefficient, the coefficient of determination, also known as r-square, and an ANOVA table as described in the manual.

If you don’t need all this information, consider using the “-brief” or “-minimal” functions, which do less computation.

This function differs from ‘linear-regression-verbose’ in that it takes summary variables: ‘x’ and ‘y’ are the sums of the independent variable and dependent variables, respectively; ‘x2’ and ‘y2’ are the sums of the squares of the independent variable and dependent variables, respectively; and ‘xy’ is the sum of the products of the independent and dependent variables.

You should first look at your data with a scatter plot to see if a linear model is plausible. See the manual for a fuller explanation of linear regression statistics.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: linear-scale (value old-min old-max new-min new-max)

Rescales value linearly from the old-min/old-max scale to the new-min/new-max one.

Package

cl-mathstats.

Source

math-utilities.lisp.

Function: log2 (n)

Log of ‘n’ to base 2.

Package

cl-mathstats.

Source

binary-math.lisp.

Function: matrix-multiply (&rest args)

Does successive multiplications of each element in ‘args’. If two elements are scalar, then their product is i * j, if a scalar is multiplied by a matrix, then each element in the matrix is multiplied by the scalar, lastly, if two matrices are multiplied then standard matrix multiplication is applied, and the ranks must be such that if ARGi is rank a x b and ARGj is rank c x d, then b must be equal to c.

Package

cl-mathstats.

Source

matrix-fns.lisp.

Function: matrix-trace (matrix)
Package

cl-mathstats.

Source

matrix-fns.lisp.

Function: maximum (&rest args)

MAXIMUM (DATA &KEY START END KEY)
Returns the element of the sequence ‘data’ whose ‘key’ is maximum. Signals ‘no-data’ if there is no data. If there is only one element in the data sequence, that element will be returned, regardless of whether it is valid (a number).

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: mean (&rest args)

MEAN (DATA &KEY START END KEY)
Returns the arithmetic mean of ‘data,’ which should be a sequence.

Signals ‘no-data’ if there is no data.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: median (&rest args)

MEDIAN (DATA &KEY START END KEY)
Returns the median of the subsequence of ‘data’ from ‘start’ to ‘end’, using ‘key’. The median is just the 0.5 quantile, and so this function returns the same values as the ‘quantile’ function.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: minimum (&rest args)

MINIMUM (DATA &KEY START END KEY)
Returns the element of the sequence ‘data’ whose ‘key’ is minimum. Signals ‘no-data’ if there is no data. If there is only one element in the data sequence, that element will be returned, regardless of whether it is valid (a number).

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: mod2 (n power)

Find ‘n’ mod a power of 2.

Package

cl-mathstats.

Source

binary-math.lisp.

Function: mode (&rest args)

MODE (DATA &KEY START END KEY)
Returns the most frequent element of ‘data,’ which should be a sequence. The algorithm involves sorting, and so the data must be numbers or the ‘key’ function must produce numbers. Consider ‘sxhash’ if no better function is available. Also returns the number of occurrences of the mode. If there is more than one mode, this returns the first mode, as determined by the sorting of the numbers.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: multiple-linear-regression-arrays (dv &rest ivs)

This is an internal function for the use of the multiple-linear-regression functions. It takes the lists of values given by CLASP and puts them into a pair of arrays, A and b, suitable for solving the matrix equation Ax=b, to find the regression equation. The values are A and b. The first column of A is the constant 1, so that an intercept will be included in the regression model.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: multiple-linear-regression-brief (dv &rest ivs)

Let m be the number of independent variables, ‘ivs.’ This function returns a vector of length m which are the coefficients of a linear equation that best predicts the dependent variable, ‘dv,’ in the least squares sense. It also returns, as the second value, the sum of squared deviations of the data from the fitted model, aka SSE, aka chi-square. The third value is the number of degrees of freedom for the chi-square, if you want to test the fit.

This function returns an intermediate amount of information. Consider using the sibling functions -minimal and -verbose if you want less or more information.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: multiple-linear-regression-minimal (dv &rest ivs)

Let m be the number of independent variables, ‘ivs.’ This function returns a vector of length m which are the coefficients of a linear equation that best predicts the dependent variable, ‘dv,’ in the least squares sense.

This function returns the minimal information for a least squares regression model, namely a list of the coefficients of the ivs, with the constant term first. Consider using the sibling functions -brief and -verbose if you want more information.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: multiple-linear-regression-normal (dv &rest ivs)

Performs linear regression of the dependent variable, ‘dv,’ on multiple independent variables, ‘ivs.’ Y on multiple X’s, calculating the intercept and regression coefficient. Calculates the F statistic, intercept and the correlation coefficient for Y on X’s.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: multiple-linear-regression-verbose (dv &rest ivs)

Let m be the number of independent variables, ‘ivs.’ This function returns fourteen values:
1. the intercept
2. a list of coefficients
3. a list of correlations of each iv to the dv and to each iv
4. a list of the t-statistic for each coefficient
5. a list of the standardized coefficients (betas)
6. the fraction of variance accounted for, aka r-square
7. the ratio of MSR (see #12) to MSE (see #13), aka F
8. a list of the portion of the SSR due to each iv
9. a list of the fraction of variance accounted for by each iv
10. the sum of squares of the regression, aka SSR
11. the sum of squares of the residuals, aka SSE, aka chi-square
12. the mean squared error of the regression, aka MSR
13. the mean squared error of the residuals, aka MSE
14. a list of indices of “zeroed” independent variables

This function returns a lot of information about the regression. Consider using the sibling functions -minimal and -brief if you need less information.

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: multiple-modes (&rest args)

MULTIPLE-MODES (DATA K &KEY START END KEY)
Returns the ‘k’ most frequent elements of ‘data,’ which should be a sequence. The algorithm involves sorting, and so the data must be numbers or the ‘key’ function must produce numbers. Consider #’sxhash if no better function is available. Also returns the number of occurrences of each mode. The value is an association list of modes and their counts. This function is a little more computationally expensive than ‘mode,’ so only use it if you really need multiple modes.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: normalize-matrix (m)

Returns a new matrix such that the sum of its elements is 1.0

Package

cl-mathstats.

Source

matrices.lisp.

Function: on-interval (x lower-bound upper-bound &key lower-inclusive? upper-inclusive?)

returns t iff x in the interval

Package

cl-mathstats.

Source

math-utilities.lisp.

Function: partials-from-parents (from to parents-list)
Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: permutation-count (n k)

Returns the number of possible ways of taking k elements out of n total.

Package

cl-mathstats.

Source

math-utilities.lisp.

Function: poisson-cdf (k x)

Computes the cumulative distribution function for a Poisson random variable with mean ‘x’ evaluated at ‘k.’ The result is the probability that the number of Poisson random events occurring will be between 0 and k-1 inclusive, if the expected number is ‘x.’ The argument ‘k’ should be an integer, while ‘x’ should be a float. The implementation follows Numerical Recipes in C, section 6.2

Package

cl-mathstats.

Source

density-fns.lisp.

Function: quantile (&rest args)

QUANTILE (DATA Q &KEY START END KEY)
Returns the element which is the q’th percentile of the data when accessed by ‘key.’ That is, it returns the element such that ‘q’ of the data is smaller than it and 1-‘q’ is above it, where ‘q’ is a number between zero and one, inclusive. For example, if ‘q’ is .5, this returns the median; if ‘q’ is 0, this returns the minimum (although the ‘minimum’ function is more efficient).

This function uses the bisection method, doing linear interpolation between elements i and i+1, where i=floor(q(n-1)). See the manual for more information. The function returns three values: the interpolated quantile and the two elements that determine the interval it was interpolated in. If the quantile was exact, the second two values are the same element of the data.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: r-score (number-list-1 number-list-2)

Takes two sequences and returns the correlation coefficient. Formula: Sum (Cross-product (Difference-list (number-list-1) Difference-list (number-list-2)) /
(Sqrt (Sum-of-Squares (number-list-1) * Sum-of-Squares (number-list-2)))).

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: radians->degrees (radians)

Convert radians to degrees. Does not round the result.

Package

cl-mathstats.

Source

math-utilities.lisp.

Function: range (&rest args)

RANGE (DATA &KEY START END KEY)
Returns the range of the sequence ‘data.’ Signals ‘no-data’ if there is no data. The range is given by max - min.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: round-to-factor (n factor)

Equivalent to (* factor (round n factor)). For example, ‘round-to-factor’ of 65 and 60 is 60. Useful for converting to certain units, say when converting minutes to the nearest hours. See also ‘truncate-to-factor.’

Package

cl-mathstats.

Source

math-utilities.lisp.

Function: safe-exp (x)

Eliminates floating point underflow for the exponential function. Instead, it just returns 0.0d0

Package

cl-mathstats.

Source

density-fns.lisp.

Function: scheffe-tests (group-means group-sizes ms-error df-error)

Performs all pairwise comparisons between group means, testing for significance using Scheffe’s F-test. Returns an upper-triangular table in a format described in the manual. Also see the function ‘print-scheffe-table.’

‘Group-means’ and ‘group-sizes’ should be sequences. The arguments ‘ms-error’ and ‘df-error’ are the mean square error within groups and its degrees of freedom, both of which are computed by the analysis of variance. An ANOVA test should always be run first, to see if there are any significant differences.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: significance (&rest args)

SIGNIFICANCE NIL NIL

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: skewness (&rest args)

SKEWNESS (DATA &KEY START END KEY)
Returns the skewness of ‘data’, which is the sum of cubed distances from the mean divided by the standard deviation, divided by N.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: smooth-4253h (data)

Smooths ‘data’ by successive smoothing: 4,median; then 2,median; then 5,median; then 3,median; then hanning. The ends are handled by duplicating the end elements. This function is not destructive; it returns a list the same length as ‘data,’ which should be a list of numbers.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: smooth-hanning (data)

Smooths ‘data’ by replacing each element with the weighted mean of it and its two neighbors. The weights are 1/2 for itself and 1/4 for each neighbor. The ends are handled by duplicating the end elements. This function is not destructive; it returns a list the same length as ‘data,’ which should be a sequence of numbers.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: smooth-mean-2 (data)

With a window of size two, the median and mean smooth functions are the same.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: smooth-mean-3 (data)

Smooths ‘data’ by replacing each element with the mean of it and its two neighbors. The ends are handled by duplicating the end elements. This function is not destructive; it returns a list the same length as ‘data,’ which should be a sequence of numbers.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: smooth-mean-4 (data)

Smooths ‘data’ by replacing each element with the mean of it, its left neighbor, and its two right neighbors. The ends are handled by duplicating the end elements. This function is not destructive; it returns a list the same length as ‘data,’ which should be a sequence of numbers.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: smooth-mean-5 (data)

Smooths ‘data’ by replacing each element with the median of it, its two left neighbors and its two right neighbors. The ends are handled by duplicating the end elements. This function is not destructive; it returns a list the same length as ‘data,’ which should be a sequence of numbers.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: smooth-median-2 (data)

Smooths ‘data’ by replacing each element with the median of it and its neighbor on the left. A median of two elements is the same as their mean. The end is handled by duplicating the end element. This function is not destructive; it returns a list the same length as ‘data,’ which should be a sequence of numbers.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: smooth-median-3 (data)

Smooths ‘data’ by replacing each element with the median of it and its two neighbors. The ends are handled by duplicating the end elements. This function is not destructive; it returns a list the same length as ‘data,’ which should be a sequence of numbers.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: smooth-median-4 (data)

Smooths ‘data’ by replacing each element with the median of it, its left neighbor, and its two right neighbors. The ends are handled by duplicating the end elements. This function is not destructive; it returns a list the same length as ‘data,’ which should be a sequence of numbers.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: smooth-median-5 (data)

Smooths ‘data’ by replacing each element with the median of it, its two left neighbors and its two right neighbors. The ends are handled by duplicating the end elements. This function is not destructive; it returns a list the same length as ‘data,’ which should be a sequence of numbers.

Package

cl-mathstats.

Source

smoothing.lisp.

Function: square (x)
Package

cl-mathstats.

Source

math-utilities.lisp.

Function: standard-deviation (&rest args)

STANDARD-DEVIATION (DATA &KEY START END KEY)
Returns the standard deviation of ‘data,’ which is just the square root of the variance.

Signals ‘no-data’ if there is no data. Signals ‘insufficient-data’ if there is only one datum.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: statistical-summary (&rest args)

STATISTICAL-SUMMARY (DATA &KEY START END KEY)
Compute the length, minimum, maximum, range, median, mode, mean, variance, standard deviation, and interquartile-range of ‘sequence’ from ‘start’ to ‘end’, accessed by ‘key’.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: students-t-significance (t-statistic dof tails)

Student’s distribution is much like the Gaussian distribution except with heavier tails, depending on the number of degrees of freedom, ‘dof.’ As ‘dof’ goes to infinity, Student’s distribution approaches the Gaussian. This function computes the significance of ‘t-statistic.’ Values range from 0.0 to 1.0: small values suggest that the null hypothesis—that ‘t-statistic’ is drawn from a t distribution—should be rejected. The ‘t-statistic’ parameter should be a float, while ‘dof’ should be an integer.

The null hypothesis is roughly that ‘t-statistic’ is zero; you must specify your alternative hypothesis (H1) via the ‘tails’ parameter, which must be :both, :positive or :negative. The first corresponds to a two-tailed test: H1 is that ‘t-statistic’ is not zero, but you are not specifying a direction. If the parameter is :positive, H1 is that ‘t-statistic’ is positive, and similarly for :negative.

This implementation follows Numerical Recipes in C, section 6.3.

Package

cl-mathstats.

Source

density-fns.lisp.

Function: sum-of-array-elements (array)
Package

cl-mathstats.

Source

matrices.lisp.

Function: svdcmp-df (a m n w v &optional rv1)

Given an ‘m’x‘n’ matrix ‘A,’ this routine computes its singular value decomposition, A = U W V^T. The matrix U replaces ‘A’ on output. The diagonal matrix of singular values W is output as a vector ‘W’ of length ‘n.’ The matrix ‘V’ – not the transpose V^T – is output as an ‘n’x‘n’ matrix ‘V.’ The row dimension ‘m’ must be greater or equal to ‘n’; if it is smaller, then ‘A’ should be filled up to square with zero rows. See the discussion in Numerical Recipes in C, section 2.6.

This routine returns no values, storing the results in ‘A,’ ‘W,’ and ‘V.’ It does use some auxiliary storage, which can be passed in as ‘rv1,’ a double-float array of length ‘n,’ if you want to avoid consing.

Package

cl-mathstats.

Source

svd.lisp.

Function: svdcmp-sf (a m n w v &optional rv1)

Given an ‘m’x‘n’ matrix ‘A,’ this routine computes its singular value decomposition, A = U W V^T. The matrix U replaces ‘A’ on output. The diagonal matrix of singular values W is output as a vector ‘W’ of length ‘n.’ The matrix ‘V’ – not the transpose V^T – is output as an ‘n’x‘n’ matrix ‘V.’ The row dimension ‘m’ must be greater or equal to ‘n’; if it is smaller, then ‘A’ should be filled up to square with zero rows. See the discussion in Numerical Recipes in C, section 2.6.

This routine returns no values, storing the results in ‘A,’ ‘W,’ and ‘V.’ It does use some auxiliary storage, which can be passed in as ‘rv1,’ a single-float array of length ‘n,’ if you want to avoid consing. All input arrays should be of single-floats.

Package

cl-mathstats.

Source

svd.lisp.

Function: t-significance (&rest args)

T-SIGNIFICANCE NIL NIL

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: t-test (&rest args)

T-TEST (SAMPLE-1 SAMPLE-2 &OPTIONAL (TAILS BOTH) (H0MEAN 0))
Returns the t-statistic for the difference in the means of two samples, which should each be a sequence of numbers. Let D=mean1-mean2. The null hypothesis is that D=0. The alternative hypothesis is specified by ‘tails’: ‘:both’ means D/=0, ‘:positive’ means D>0, and ‘:negative’ means D<0. Unless you’re using :both tails, be careful what order the two samples are in: it matters!

The function also returns the significance, the standard error, and the degrees of freedom. Signals ‘standard-error-is-zero’ if that condition occurs. Signals ‘insufficient-data’ unless there are at least two elements in each sample.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: t-test-matched (&rest args)

T-TEST-MATCHED (SAMPLE1 SAMPLE2 &OPTIONAL (TAILS BOTH))
Returns the t-statistic for two matched samples, which should be equal-length sequences of numbers. Let D=mean1-mean2. The null hypothesis is that D=0. The alternative hypothesis is specified by ‘tails’: ‘:both’ means D/=0, ‘:positive’ means D>0, and ‘:negative’ means D<0. Unless you’re using :both tails, be careful what order the two samples are in: it matters!

The function also returns the significance, the standard error, and the degrees of freedom. Signals ‘standard-error-is-zero’ if that condition occurs. Signals ‘insufficient-data’ unless there are at least two elements in each sample.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: t-test-one-sample (&rest args)

T-TEST-ONE-SAMPLE (DATA TAILS &OPTIONAL (H0-MEAN 0) &KEY START END KEY) Returns the t-statistic for the mean of the data, which should be a sequence of numbers. Let D be the sample mean. The null hypothesis is that D equals the ‘H0-mean.’ The alternative hypothesis is specified by ‘tails’: ‘:both’ means D /= H0-mean, ‘:positive’ means D > H0-mean, and ‘:negative’ means D < H0-mean.

The function also returns the significance, the standard error, and the degrees of freedom. Signals ‘zero-variance’ if that condition occurs. Signals ‘insufficient-data’ unless there are at least two elements in the sample.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: times2 (i &optional power)

Multiply ‘i’ by a power of 2.

Package

cl-mathstats.

Source

binary-math.lisp.

Function: transpose-matrix (matrix &optional into-matrix)
Package

cl-mathstats.

Source

matrices.lisp.

Function: trimmed-mean (&rest args)

TRIMMED-MEAN (DATA PERCENTAGE &KEY START END KEY)
Returns a trimmed mean of ‘data.’ A trimmed mean is an ordinary, arithmetic mean of the data, except that an outlying percentage has been discarded. For example, suppose there are ten elements in ‘data,’ and ‘percentage’ is 0.1: the result would be the mean of the middle eight elements, having discarded the biggest and smallest elements. If ‘percentage’ doesn’t result in a whole number of elements being discarded, then a fraction of the remaining biggest and smallest is discarded. For example, suppose ‘data’ is ’(1 2 3 4 5) and ‘percentage’ is 0.25: the result is (.75(2) + 3 + .75(4))/(.75+1+.75) or 3. By convention, the 0.5 trimmed mean is the median, which is always returned as a number.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: trunc2 (n power)

Truncate ‘n’ to a power of 2.

Package

cl-mathstats.

Source

binary-math.lisp.

Function: truncate-to-factor (n factor)

Equivalent to (* factor (truncate n factor)). For example, ‘truncate-to-factor’ of 65 and 60 is 60. Useful for converting to certain units, say when converting minutes to hours and minutes. See also ‘round-to-factor.’

Package

cl-mathstats.

Source

math-utilities.lisp.

Function: tukey-summary (&rest args)

TUKEY-SUMMARY (DATA &KEY START END KEY)
Computes a Tukey five-number summary of the data. That is, it returns, in increasing order, the extremes and the quartiles: the minimum, the 1/4 quartile, the median, the 3/4 quartile, and the maximum.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: variance (&rest args)

VARIANCE (DATA &KEY START END KEY)
Returns the variance of ‘data,’ that is, the ‘sum-of-squares’ divided by n-1. Signals ‘no-data’ if there is no data. Signals ‘insufficient-data’ if there is only one datum.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: z-test-one-sample (&rest args)

Z-TEST-ONE-SAMPLE (DATA TAILS &OPTIONAL (H0-MEAN 0) (H0-STD-DEV 1) &KEY START END KEY)
NIL

Package

cl-mathstats.

Source

basic-statistics.lisp.


6.1.4 Generic functions

Generic Function: convert (object type)
Package

cl-mathstats.

Methods
Method: convert ((thing iteratable-container-mixin) (type (eql cl-mathstats::iteratable-thing)))
Source

basic-statistics.lisp.

Method: convert ((thing sequence) (type (eql cl-mathstats::iteratable-thing)))
Source

basic-statistics.lisp.

Method: convert (object type)
Source

define-statistical-fun.lisp.

Generic Function: cross-product (number-list-1 number-list-2)
Package

cl-mathstats.

Methods
Method: cross-product ((number-list-1 sequence) (number-list-2 sequence))

Takes two sequences of numbers and returns a sequence of cross products. Formula XYi = Xi * Yi.

Source

basic-statistics.lisp.

Generic Function: dot-product (sequence-1 sequence-2)

http://en.wikipedia.org/wiki/Dot_product

Package

cl-mathstats.

Source

api.lisp.

Methods
Method: dot-product ((number-list-1 sequence) (number-list-2 sequence))

Takes two sequences of numbers and returns the dot product.

Source

basic-statistics.lisp.


6.1.5 Classes

Class: anova-one-way-variables
Package

cl-mathstats.

Source

anova.lisp.

Direct superclasses

composite-statistic.

Direct slots
Slot: anova-table
Slot: means-list
Slot: scheffe-table
Slot: sst-alt
Class: anova-two-way-variables
Package

cl-mathstats.

Source

anova.lisp.

Direct superclasses

composite-statistic.

Direct slots
Slot: anova-table
Class: anova-two-way-variables-unequal-cell-sizes
Package

cl-mathstats.

Source

anova.lisp.

Direct superclasses

composite-statistic.

Direct slots
Slot: anova-table
Slot: ab-matrix
Slot: row-totals
Slot: column-totals
Slot: grand-totla
Slot: a-labels
Slot: b-labels
Class: autocorrelation
Package

cl-mathstats.

Source

correlation-regression.lisp.

Direct superclasses

simple-statistic.

Class: confidence-interval
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

composite-statistic.

Direct subclasses
Direct slots
Slot: value
Slot: lower-bound
Slot: upper-bound
Class: confidence-interval-proportion
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses
Class: confidence-interval-t
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses
Class: confidence-interval-z
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses
Class: correlation
Package

cl-mathstats.

Source

correlation-regression.lisp.

Direct superclasses

simple-statistic.

Class: covariance
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Class: cross-correlation
Package

cl-mathstats.

Source

correlation-regression.lisp.

Direct superclasses

simple-statistic.

Class: d-test
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses
Direct slots
Slot: count
Package

common-lisp.

Slot: times
Class: data-length
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: interquartile-range
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: maximum
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: mean
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: median
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: minimum
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: mode
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: multiple-modes
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Class: quantile
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Class: range
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: significance
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

composite-statistic.

Direct subclasses
Direct slots
Slot: statistic
Slot: level
Class: skewness
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: standard-deviation
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: statistical-summary
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses
Class: t-significance
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses
Direct subclasses
Direct slots
Slot: std-error
Slot: dof
Class: t-test
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses
Class: t-test-matched
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses
Class: t-test-one-sample
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses
Class: trimmed-mean
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Class: tukey-summary
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

composite-statistic.

Direct slots
Slot: minimum
Slot: first-quartile
Slot: median
Slot: third-quartile
Slot: maximum
Class: variance
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

simple-statistic.

Direct subclasses

statistical-summary.

Class: z-test-one-sample
Package

cl-mathstats.

Source

basic-statistics.lisp.

Direct superclasses

6.2 Internals


6.2.1 Constants

Constant: +log-pi+
Package

cl-mathstats.

Source

density-fns.lisp.

Constant: +sqrt-pi+
Package

cl-mathstats.

Source

density-fns.lisp.


6.2.2 Special variables

Special Variable: *continous-data-window-divisor*
Package

cl-mathstats.

Source

basic-statistics.lisp.

Special Variable: *continuous-variable-uniqueness-factor*
Package

cl-mathstats.

Source

basic-statistics.lisp.

Special Variable: *create-statistical-objects*
Package

cl-mathstats.

Source

define-statistical-fun.lisp.

Special Variable: *gaussian-cdf-signals-zero-standard-deviation-error*
Package

cl-mathstats.

Source

parameters.lisp.

Special Variable: *temporary-table*

A temporary table. This avoids consing.

Package

cl-mathstats.

Source

utilities.lisp.

Special Variable: *temporary-vector*

A temporary vector for use by statistical functions such as ‘quantile,’ which uses it for sorting data. This avoids consing or rearranging the user’s data.

Package

cl-mathstats.

Source

utilities.lisp.

Special Variable: *way-too-big-contingency-table-dimension*
Package

cl-mathstats.

Source

basic-statistics.lisp.


6.2.3 Macros

Macro: aref1 (a i)
Package

cl-mathstats.

Source

svd.lisp.

Macro: aref11 (a i j)
Package

cl-mathstats.

Source

svd.lisp.

Macro: check-type-of-arg (arg-name predicate type-string &optional error-type-name)

Generate error if the value of ARG-NAME doesn’t satisfy PREDICATE.
PREDICATE is a function name (a symbol) or an expression to compute. TYPE-STRING is a string to use in the error message, such as "a list". ERROR-TYPE-NAME is a keyword that tells condition handlers what type was desired.

Package

cl-mathstats.

Source

matrices.lisp.

Macro: define-statistic (name &optional superclasses slots values argument-types lambda-list &body body)

In clasp, statistical objects have two parts, a class which stores the various parts of the object and a computing function which computes the value of the object from arguments. The define-statistic macro allows the definition of new statistical types. The define-statistic macro must be provided with all the information necessary to create a statistical object, that is, everything required to create a new class, everything required to create a computing function and some information to connect the two. This last part consists of a list of arguments and their types and a list which determines how the values of a statistical function should be used to fill the slots of a statistical object.

When define-statistic is invoked, two things happen, first a class is defined which is a subclass of ’statistic and any other named ‘superclasses’. Second, a pair of functions is defined. ‘clasp-statistics::name’ is an internal function which has the supplied ‘body’ and ‘lambda-list’ and must return as many values as there are slots in the class ‘name’. The function ‘name’ is also defined, it is basically a wrapper function which converts its arguments to those which are accepted by ‘body’ and then calls ‘clasp-statistics::name’. The parameter clasp:*create-statistical-objects* determines whether the wrapper function packages the values returned by the intern function into a statistical object or just returns them as multiple values.

The ‘argument-types’ argument must be an alist in which the keys are the names of arguments as given in ‘lambda-list’ and the values are lisp types which those arguments will be converted to before calling the internal statistical function. The primary purpose of this is to allow for coersion of clasp variables to sequences, but any coercion which is allowed by lisp is acceptable. The ‘values’ argument is intended to allow the programmer to specify which slots in the statistical object are filled by which of the values returned by the statistical function. By default, the order of the values is assumed to be direct slots in order of specification, inherited slots in order of specification in the superclasses which are also statistics.

Package

cl-mathstats.

Source

define-statistical-fun.lisp.

Macro: sign-df (a b)
Package

cl-mathstats.

Source

svd.lisp.

Macro: sign-sf (a b)
Package

cl-mathstats.

Source

svd.lisp.

Macro: start/end (call-form start-n end-n)
Package

cl-mathstats.

Source

basic-statistics.lisp.

Macro: with-routine-error-handling (&body body)
Package

cl-mathstats.

Source

define-statistical-fun.lisp.


6.2.4 Ordinary functions

Function: 1-or-2d-arrayp (array)
Package

cl-mathstats.

Source

matrices.lisp.

Function: anova-one-way-groups (data &optional scheffe-tests-p confidence-intervals)

Performs a one-way analysis of variance (ANOVA) on the ‘data,’ which should
be a sequence of sequences, where each interior sequence is the data for a particular group. Furthermore, each sequence should consist entirely of numbers, and each should have at least 2 elements.

The significance of the result indicates that the group means are not all equal; that is, at least two of the groups have significantly different means. If there were only two groups, this would be semantically equivalent to an unmatched, two-tailed t-test, so you can think of the one-way ANOVA as a multi-group, two-tailed t-test.

This function returns five values: 1. an ANOVA table; 2. a list a group means; 3. either a Scheffe table or nil depending on ‘scheffe-tests-p’; 4. an alternate value for SST; and 5. a list of confidence intervals in the form ‘(,mean ,lower ,upper) for each group, if ‘confidence-intervals’ is a number between zero and one, giving the kind of confidence interval, such as 0.9. The fourth value is only interesting if you think there are numerical accuracy problems; it should be approximately equal to the SST value in the ANOVA table. This function differs from ‘anova-one-way-variables’ only in its input representation. See the manual for more information.

Package

cl-mathstats.

Source

anova.lisp.

Function: anova-one-way-variables-internal (iv dv &optional scheffe-tests-p confidence-intervals)

See ANOVA-ONE-WAY-VARIABLES

Package

cl-mathstats.

Source

anova.lisp.

Function: anova-two-way-groups (data-array)

Calculates the analysis of variance when there are two factors that may affect the dependent variable. Because the input is represented as an array, we can refer to these two factors as the row-effect and the column effect. Unlike the one-way ANOVA, there are mathematical difficulties with the two-way ANOVA if there are unequal cell sizes; therefore, we require all cells to be the same size, and so the input is a three-dimensional array.

The result of the analysis is an anova-table, as described in the manual. This function differs from ‘anova-two-way-variables’ only in its input representation. See the manual for further discussion of analysis of variance.

Package

cl-mathstats.

Source

anova.lisp.

Function: anova-two-way-variables-internal (dv iv1 iv2)

See ANOVA-TWO-WAY-VARIABLES

Package

cl-mathstats.

Source

anova.lisp.

Function: anova-two-way-variables-unequal-cell-sizes-internal (iv1 iv2 dv)

See ANOVA-TWO-WAY-VARIABLES-UNEQUAL-CELL-SIZES

Package

cl-mathstats.

Source

anova.lisp.

Function: autocorrelation-internal (sample max-lag &optional min-lag)

See AUTOCORRELATION

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: chi-square-2x2 (v1 v2)

Performs a chi-square test for independence of the two variables, ‘v1’ and ‘v2.’ These should be categorial variables with only two values; the function will construct a 2x2 contingency table by counting the number of occurrences of each combination of the variables. See the manual for more details.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: chi-square-2x2-counts (a b c d &optional yates)

Runs a chi-square test for association on a simple 2 x 2 table. If ‘yates’ is nil, the correction for continuity is not done; default is t.

Returns the chi-square statistic and the significance of the value.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: chi-square-rxc (v1 v2)

Performs a chi-square test for independence of the two variables, ‘v1’ and ‘v2.’ These should be categorial variables; the function will construct a contingency table by counting the number of occurrences of each combination of the variables. See the manual for more details.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: chi-square-rxc-counts (contingency-table)

Calculates the chi-square statistic and corresponding p-value for the given contingency table. The result says whether the row factor is independent of the column factor. Does not apply Yate’s correction.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: confidence-interval-internal ()
Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: confidence-interval-proportion-internal (x n confidence)

See CONFIDENCE-INTERVAL-PROPORTION

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: confidence-interval-t-internal (data confidence)

See CONFIDENCE-INTERVAL-T

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: confidence-interval-z-internal (data confidence)

See CONFIDENCE-INTERVAL-Z

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: confidence-interval-z-summaries (mean standard-error confidence)

This function is just like ‘confidence-interval-z,’ except that instead of its arguments being the actual data, it takes the following summary statistics: ‘mean’, a point estimator of the mean of some normally distributed population; and the ‘standard-error’ of the estimator, that is, the estimated standard deviation of the normal population. ‘Confidence’ should be a number between 0 and 1, exclusive.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: correlation-internal (sample1 sample2 &rest args &key start1 end1 start2 end2)

See CORRELATION

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: covariance-internal (sample1 sample2 &rest args &key start1 end1 start2 end2)

See COVARIANCE

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: cross-correlation-internal (sequence1 sequence2 max-lag &optional min-lag)

See CROSS-CORRELATION

Package

cl-mathstats.

Source

correlation-regression.lisp.

Function: d-test-internal (sample-1 sample-2 tails &key times h0mean)

See D-TEST

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: data-continuous-p (sequence)
Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: data-length-internal (data &key start end key)

See DATA-LENGTH

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: difference-list (number-list)

Takes a sequence of numbers and returns a sequence of differences from the mean.
Formula: xi = Xi - Mean (X).

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: error-function-complement-short-1 (y z)
Package

cl-mathstats.

Source

density-fns.lisp.

Function: error-function-complement-short-2 (y)
Package

cl-mathstats.

Source

density-fns.lisp.

Function: fill-2d-array (array list)
Package

cl-mathstats.

Source

matrices.lisp.

Function: find-critical-value (p-function p-value &optional x-tolerance y-tolerance)

Returns the critical value of some statistic. The function ‘p-function’ should be a unary function mapping statistics—x values—to their significance—p values. The function will find the value of x such that the p-value is ‘p-value.’ The function works by binary search. A secant method might be better, but this seems to be acceptably fast. Only positive values of x are considered, and ‘p-function’ should be monotonically decreasing from its value at x=0. The binary search ends when either the function value is within ‘y-tolerance’ of ‘p-value’ or the size of the search region shrinks to less than ‘x-tolerance.’

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: g-test (contingency-table &optional expected-value-matrix error-p)

Calculates the G-test for a contingency table. The formula for the
G-test statistic is

2 * sum[f_ij log [f_ij/f-hat_ij]]

where f_ij is the ith by jth cell in the table and f-hat_ij is the
expected value of that cell. If an expected-value-matrix is supplied,
it must be the same size as table and it is used for expected values,
in which case the G-test is a test of goodness-of-fit. If the
expected value matrix is unsupplied, it is calculated from using the
formula

e_ij = [f_i* * f_*j] / f_**

where f_i*, f_*j and f_** are the row, column and grand totals
respectively. In this case, the G-test is a test of independence. The degrees of freedom is the same as for the chi-square statistic and the significance is obtained by comparing

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: inner-product (sample1 sample2 &key start1 end1 start2 end2)

Returns the inner product of the two samples, which should be sequences of numbers. The inner product, also called the dot product or vector product, is the sum of the pairwise multiplication of the numbers. Stops when either sample runs out; it doesn’t check that they have the same length.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: interquartile-range-internal (data &rest standard-args)

See INTERQUARTILE-RANGE

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: invert-matrix (matrix &optional into-matrix)

If matrix is singular returns nil, else returns its inverse. If into-matrix is supplied, inverse is returned in it, otherwise a new array is created.

Package

cl-mathstats.

Source

matrices.lisp.

Function: invert-matrix-iterate (matrix &optional into-matrix)

If matrix is singular returns nil, else returns the inverse of matrix. Uses iterative improvement until no further improvement is possible.

Package

cl-mathstats.

Source

matrices.lisp.

Function: list-2d-array (array)
Package

cl-mathstats.

Source

matrices.lisp.

Function: make-3d-table (dv iv1 iv2)

Collects the ‘dv’ values for each unique combination of an element of ‘v1’ and an element of ‘v2.’ Returns a three-dimensional table of dv values.

Package

cl-mathstats.

Source

anova.lisp.

Function: make-contingency-table (v1 v2)

Counts each unique combination of an element of ‘v1’ and an element of ‘v2.’ Returns a two-dimensional table of integers.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: matrix-addition (&rest args)
Package

cl-mathstats.

Source

matrix-fns.lisp.

Function: matrix-norm (matrix)

Returns the norm of matrix.
The norm is the maximum over the rows of the sum of the abs of the columns.

Package

cl-mathstats.

Source

matrices.lisp.

Function: matrix-plus-matrix (mat1 mat2)

Adds two matrices together

Package

cl-mathstats.

Source

matrix-fns.lisp.

Function: matrix-plus-scalar (matrix scalar)

Add a scalar value to a matrix

Package

cl-mathstats.

Source

matrix-fns.lisp.

Function: matrix-times-matrix (mat1 mat2)

Multiplies two matrices together

Package

cl-mathstats.

Source

matrix-fns.lisp.

Function: matrix-times-scalar (matrix scalar)

Multiply a matrix by a scalar value

Package

cl-mathstats.

Source

matrix-fns.lisp.

Function: matrix-times-scalar! (matrix scalar)

Multiply a matrix by a scalar value

Package

cl-mathstats.

Source

matrix-fns.lisp.

Function: maximum-internal (data &rest standard-args &key start end key)

See MAXIMUM

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: mean-internal (data &rest standard-args &key start end key)

See MEAN

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: median-internal (data &rest standard-args &key start end key)

See MEDIAN

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: minimum-internal (data &rest standard-args &key start end key)

See MINIMUM

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: mode-for-continuous-data (data &rest standard-args &key start end key window)

Returns the most frequent element of ‘data,’ which should be a sequence. The algorithm involves sorting, and so the data must be numbers or the ‘key’ function must produce numbers. Consider ‘sxhash’ if no better function is available. Also returns the number of occurrences of the mode. If there is more than one mode, this returns the first mode, as determined by the sorting of the numbers.

Keep in mind that if the data has multiple runs of like values that are bigger than the window size (currently defaults to 10% of the size of the data) this function will blindly pick the first one. If this is the case you probabaly should be calling ‘mode’ instead of this function.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: mode-internal (data &rest standard-args &key start end key)

See MODE

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: multiple-modes-internal (data k &rest standard-args &key start end key)

See MULTIPLE-MODES

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: multiply-matrices (matrix-1 matrix-2 &optional matrix-3)

Multiply matrices MATRIX-1 and MATRIX-2, storing into MATRIX-3 if supplied.
If MATRIX-3 is not supplied, then a new (ART-Q type) array is returned, else
MATRIX-3 must have exactly the right dimensions for holding the result of the multiplication. Both MATRIX-1 and MATRIX-2 must be either one- or two-diimensional.
The first dimension of MATRIX-2 must equal the second dimension of MATRIX-1, unless MATRIX-1 is one-dimensional, when the first dimensions must match (thus allowing multiplications of the form VECTOR x MATRIX)

Package

cl-mathstats.

Source

matrices.lisp.

Function: print-anova-table (anova-table &optional stream)

Prints ‘anova-table’ on ‘stream.’

Package

cl-mathstats.

Source

anova.lisp.

Function: print-scheffe-table (scheffe-table &optional group-means stream)

Prints ‘scheffe-table’ on ‘stream.’ If the original one-way anova data had N groups, the Scheffe table prints as an n-1 x n-1 upper-triangular table. If ‘group-means’ is given, it should be a list of the group means, which will be printed along with the table.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: pythag-df (a b)

Computes square root of a*a + b*b without destructive overflow or underflow.

Package

cl-mathstats.

Source

svd.lisp.

Function: pythag-sf (a b)

Computes square root of a*a + b*b without destructive overflow or underflow.

Package

cl-mathstats.

Source

svd.lisp.

Function: quantile-internal (data q &rest standard-args &key start end key)

See QUANTILE

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: range-internal (data &rest standard-args &key start end key)

See RANGE

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: reduce-matrix (mat)

Uses the Gauss-Jordan reduction method to reduce a matrix.

Package

cl-mathstats.

Source

matrix-fns.lisp.

Function: remove-&rest (list)

Removes the ’&rest arg’ part from a lambda-list (strictly for documentation purposes.

Package

cl-mathstats.

Source

define-statistical-fun.lisp.

Function: scalar-matrix-multiply (scalar matrix)

Multiplies a matrix by a scalar value in the form M[i,j] = s*M[i,j].

Package

cl-mathstats.

Source

matrices.lisp.

Function: significance-internal ()
Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: singular-value-decomposition (matrix)

Returns as three values the U W and V of singular value decomposition. If you have already consed up these matrices, you should call ‘svdcmp-sf’ or ‘svdcmp-df’ directly. The input matrix is preserved.

Package

cl-mathstats.

Source

svd.lisp.

Function: skewness-internal (data &rest standard-args &key start end key)

See SKEWNESS

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: smart-mode (sequence &rest args)
Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: standard-deviation-internal (data &rest standard-args &key start end key)

See STANDARD-DEVIATION

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: statistical-summary-internal (data &rest standard-args &key start end key)

See STATISTICAL-SUMMARY

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: sum-list (number-list)

Takes a sequence of numbers and returns their sum. Formula: Sum(X).

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: sum-of-squares (data &rest standard-args &key start end key)

Returns the sum of squared distances from the mean of ‘data’.

Signals ‘no-data’ if there is no data.

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: svbksb-df (u w v m n b x &optional tmp)

Solves A X = B for a vector ‘X,’ where A is specified by the mxn array U, ‘n’ vector W, and nxn matrix V as returned by svdcmp. ‘m’ and ‘n’ are the dimensions of ‘A,’ and will be equal for square matrices. ‘B’ is the 1xm input vector for the right-hand side. ‘X’ is the 1xn output solution vector. All arrays are of double-floats. No input quantities are destroyed, so the routine may be called sequentially with different B’s. See the discussion in Numerical Recipes in C, section 2.6.

This routine assumes that near zero singular values have already been zeroed. It returns no values, storing the result in ‘X.’ It does use some auxiliary storage, which can be passed in as ‘tmp,’ a double-float array of length ‘n,’ if you want to avoid consing.

Package

cl-mathstats.

Source

svd.lisp.

Function: svbksb-sf (u w v m n b x &optional tmp)

Solves A X = B for a vector ‘X,’ where A is specified by the mxn array U, ‘n’ vector W, and nxn matrix V as returned by svdcmp. ‘m’ and ‘n’ are the dimensions of ‘A,’ and will be equal for square matrices. ‘B’ is the 1xm input vector for the right-hand side. ‘X’ is the 1xn output solution vector. All arrays are of single-floats. No input quantities are destroyed, so the routine may be called sequentially with different B’s. See the discussion in Numerical Recipes in C, section 2.6.

This routine assumes that near zero singular values have already been zeroed. It returns no values, storing the result in ‘X.’ It does use some auxiliary storage, which can be passed in as ‘tmp,’ a single-float array of length ‘n,’ if you want to avoid consing.

Package

cl-mathstats.

Source

svd.lisp.

Function: svd-back-substitute (u w v b)

Returns the solution vector to the Ax=b, where A has been decomposed into ‘u,’ ‘w’ and ‘v’ by ‘singular-value-decomposition.’ This function is just a minor wrapping of ‘svbksb-sf’ and ‘svbksb-df.’

Package

cl-mathstats.

Source

svd.lisp.

Function: svd-inverse-fast-df (u w v &optional a-1 tmp)

Computes the inverse of a matrix that has been decomposed into ‘u,’ ‘w’ and ‘v’ by singular value decomposition. It assumes the “small” elements of ‘w’ have already been zeroed. It computes the inverse by taking advantage of the known zeros in the full 2-dimensional ‘w’ matrix. It uses the backsubstitution algorithm, only with the B vectors fixed at the columns of the identity matrix, which lets us take advantage of its zeros. It’s about twice as fast as the slow version and conses a lot less. Note that if you are computing the inverse merely to solve one or more systems of equations, you are better off using the decomposition and backsubstitution routines directly.

Package

cl-mathstats.

Source

svd.lisp.

Function: svd-inverse-fast-sf (u w v &optional a-1 tmp)

Computes the inverse of a matrix that has been decomposed into ‘u,’ ‘w’ and ‘v’ by singular value decomposition. It assumes the “small” elements of ‘w’ have already been zeroed. It computes the inverse by taking advantage of the known zeros in the full 2-dimensional ‘w’ matrix. It uses the backsubstitution algorithm, only with the B vectors fixed at the columns of the identity matrix, which lets us take advantage of its zeros. It’s about twice as fast as the slow version and conses a lot less. Note that if you are computing the inverse merely to solve one or more systems of equations, you are better off using the decomposition and backsubstitution routines directly.

Package

cl-mathstats.

Source

svd.lisp.

Function: svd-inverse-slow-df (u w v &optional a-1)

Computes the inverse of a matrix that has been decomposed into ‘u,’ ‘w’ and ‘v’ by singular value decomposition. It assumes the “small” elements of ‘w’ have already been zeroed. It computes the inverse by constructing a diagonal matrix ‘w2’ from ‘w’ (which is just a vector of the diagonal elements, and then explicitly multiplying u^t w2 and v. Note that if you are computing the inverse merely to solve one or more systems of equations, you are better off using the decomposition and backsubstitution routines directly.

Package

cl-mathstats.

Source

svd.lisp.

Function: svd-inverse-slow-sf (u w v &optional a-1)

Computes the inverse of a matrix that has been decomposed into ‘u,’ ‘w’ and ‘v’ by singular value decomposition. It assumes the “small” elements of ‘w’ have already been zeroed. It computes the inverse by constructing a diagonal matrix ‘w2’ from ‘w’ (which is just a vector of the diagonal elements, and then explicitly multiplying u^t w2 and v. Note that if you are computing the inverse merely to solve one or more systems of equations, you are better off using the decomposition and backsubstitution routines directly.

Package

cl-mathstats.

Source

svd.lisp.

Function: svd-matrix-inverse (a &optional singularity-threshold)

Use singular value decomposition to compute the inverse of ‘A.’ If an exact inverse is not possible, then zero the otherwise infinite inverted singular value and compute the inverse. The inverse is returned; ‘A’ is not destroyed. If you’re using this to solve several systems of equations, you’re better off computing the singular value decomposition and using it several times, because this function computes it anew each time.

Package

cl-mathstats.

Source

svd.lisp.

Function: svd-solve-linear-system (matrix b-vector &optional report? threshold)

Returns solution of linear system matrix * solution = b-vector. Employs the singular value decomposition method. See the discussion in Numerical Recipes in C, section 2.6, especially as to the semantics of ‘threshold.’

Package

cl-mathstats.

Source

svd.lisp.

Function: svd-zero (w &optional threshold report?)

If the relative magnitude of an element in ‘w’ compared to the largest element is less than ‘threshold,’ then zero that element. Returns a list of indices of the zeroed elements. This function is just a convenient wrapper for ‘svzero-sf’ and ‘svzero-df.’

Package

cl-mathstats.

Source

svd.lisp.

Function: svdvar (v w &optional cvm)

Given ‘v’ and ‘w’ as computed by singular value decomposition, computes the covariance matrix among the predictors. Based on Numerical Recipes in C, section 15.4, algorithm ‘svdvar.’ The covariance matrix is returned. It can be supplied as the third argument.

Package

cl-mathstats.

Source

svd.lisp.

Function: svzero-df (w n threshold &optional report?)

If the relative magnitude of an element in ‘w’ compared to the largest element is less than ‘threshold,’ then zero that element. If ‘report?’ is true, the indices of zeroed elements are printed. Returns a list of the indices of zeroed elements. This routine uses double-floats.

Package

cl-mathstats.

Source

svd.lisp.

Function: svzero-sf (w n threshold &optional report?)

If the relative magnitude of an element in ‘w’ compared to the largest element is less than ‘threshold,’ then zero that element. If ‘report?’ is true, the indices of zeroed elements are printed. Returns a list of indices of the zeroed elements. This routine uses single-floats.

Package

cl-mathstats.

Source

svd.lisp.

Function: t-significance-internal ()
Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: t-test-internal (sample-1 sample-2 &optional tails h0mean)

See T-TEST

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: t-test-matched-internal (sample1 sample2 &optional tails)

See T-TEST-MATCHED

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: t-test-one-sample-internal (data tails &optional h0-mean &rest standard-args &key start end key)

See T-TEST-ONE-SAMPLE

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: trimmed-mean-internal (data percentage &rest standard-args &key start end key)

See TRIMMED-MEAN

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: tukey-summary-internal (data &rest standard-args &key start end key)

See TUKEY-SUMMARY

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: variance-internal (data &rest standard-args &key start end key)

See VARIANCE

Package

cl-mathstats.

Source

basic-statistics.lisp.

Function: z-test-one-sample-internal (data tails &optional h0-mean h0-std-dev &rest standard-args &key start end key)

See Z-TEST-ONE-SAMPLE

Package

cl-mathstats.

Source

basic-statistics.lisp.


6.2.5 Generic functions

Generic Function: composite-statistic-p (it)
Package

cl-mathstats.

Methods
Method: composite-statistic-p ((it composite-statistic))
Source

define-statistical-fun.lisp.

Method: composite-statistic-p (it)
Source

define-statistical-fun.lisp.

Generic Function: make-statistic (type &rest args)
Package

cl-mathstats.

Methods
Method: make-statistic (type &rest args)
Source

define-statistical-fun.lisp.

Generic Function: simple-statistic-p (it)
Package

cl-mathstats.

Methods
Method: simple-statistic-p ((it simple-statistic))
Source

define-statistical-fun.lisp.

Method: simple-statistic-p (it)
Source

define-statistical-fun.lisp.

Generic Function: statisticp (it)
Package

cl-mathstats.

Methods
Method: statisticp ((it statistic))
Source

define-statistical-fun.lisp.

Method: statisticp (it)
Source

define-statistical-fun.lisp.


6.2.6 Conditions

Condition: data-error
Package

cl-mathstats.

Source

class-defs.lisp.

Direct superclasses

error.

Direct subclasses
Condition: enormous-contingency-table
Package

cl-mathstats.

Source

class-defs.lisp.

Direct superclasses

condition.

Condition: insufficient-data
Package

cl-mathstats.

Source

class-defs.lisp.

Direct superclasses

data-error.

Direct subclasses

no-data.

Condition: no-data
Package

cl-mathstats.

Source

class-defs.lisp.

Direct superclasses

insufficient-data.

Condition: not-binary-variables
Package

cl-mathstats.

Source

class-defs.lisp.

Direct superclasses

data-error.

Condition: unmatched-sequences
Package

cl-mathstats.

Source

class-defs.lisp.

Direct superclasses

data-error.

Condition: zero-standard-deviation
Package

cl-mathstats.

Source

class-defs.lisp.

Direct superclasses

data-error.

Condition: zero-variance
Package

cl-mathstats.

Source

class-defs.lisp.

Direct superclasses

data-error.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   1  
A   B   C   D   E   F   G   I   L   M   N   O   P   Q   R   S   T   U   V   W   Z  
Index Entry  Section

1
1-or-2d-arrayp: Private ordinary functions

A
anova-one-way-groups: Private ordinary functions
anova-one-way-variables: Public ordinary functions
anova-one-way-variables-internal: Private ordinary functions
anova-two-way-groups: Private ordinary functions
anova-two-way-variables: Public ordinary functions
anova-two-way-variables-internal: Private ordinary functions
anova-two-way-variables-unequal-cell-sizes: Public ordinary functions
anova-two-way-variables-unequal-cell-sizes-internal: Private ordinary functions
aref1: Private macros
aref11: Private macros
autocorrelation: Public ordinary functions
autocorrelation-internal: Private ordinary functions

B
beta: Public ordinary functions
beta-incomplete: Public ordinary functions
binomial-cdf: Public ordinary functions
binomial-cdf-exact: Public ordinary functions
binomial-coefficient: Public ordinary functions
binomial-coefficient-exact: Public ordinary functions
binomial-probability: Public ordinary functions
binomial-probability-exact: Public ordinary functions

C
check-type-of-arg: Private macros
chi-square-2x2: Private ordinary functions
chi-square-2x2-counts: Private ordinary functions
chi-square-rxc: Private ordinary functions
chi-square-rxc-counts: Private ordinary functions
chi-square-significance: Public ordinary functions
combination-count: Public ordinary functions
composite-statistic-p: Private generic functions
composite-statistic-p: Private generic functions
composite-statistic-p: Private generic functions
confidence-interval: Public ordinary functions
confidence-interval-internal: Private ordinary functions
confidence-interval-proportion: Public ordinary functions
confidence-interval-proportion-internal: Private ordinary functions
confidence-interval-t: Public ordinary functions
confidence-interval-t-internal: Private ordinary functions
confidence-interval-t-summaries: Public ordinary functions
confidence-interval-z: Public ordinary functions
confidence-interval-z-internal: Private ordinary functions
confidence-interval-z-summaries: Private ordinary functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
correlation: Public ordinary functions
correlation-from-summaries: Public ordinary functions
correlation-internal: Private ordinary functions
correlation-matrix: Public ordinary functions
covariance: Public ordinary functions
covariance-internal: Private ordinary functions
cross-correlation: Public ordinary functions
cross-correlation-internal: Private ordinary functions
cross-product: Public generic functions
cross-product: Public generic functions

D
d-test: Public ordinary functions
d-test-internal: Private ordinary functions
data-continuous-p: Private ordinary functions
data-length: Public ordinary functions
data-length-internal: Private ordinary functions
define-statistic: Private macros
degrees->radians: Public ordinary functions
difference-list: Private ordinary functions
div2: Public ordinary functions
dot-product: Public generic functions
dot-product: Public generic functions

E
ensure-float: Public ordinary functions
error-function: Public ordinary functions
error-function-complement: Public ordinary functions
error-function-complement-short-1: Private ordinary functions
error-function-complement-short-2: Private ordinary functions
exp2: Public ordinary functions
extract-unique-values: Public ordinary functions

F
f-measure: Public ordinary functions
f-significance: Public ordinary functions
factorial: Public ordinary functions
factorial-exact: Public ordinary functions
factorial-ln: Public ordinary functions
fill-2d-array: Private ordinary functions
find-critical-value: Private ordinary functions
Function, 1-or-2d-arrayp: Private ordinary functions
Function, anova-one-way-groups: Private ordinary functions
Function, anova-one-way-variables: Public ordinary functions
Function, anova-one-way-variables-internal: Private ordinary functions
Function, anova-two-way-groups: Private ordinary functions
Function, anova-two-way-variables: Public ordinary functions
Function, anova-two-way-variables-internal: Private ordinary functions
Function, anova-two-way-variables-unequal-cell-sizes: Public ordinary functions
Function, anova-two-way-variables-unequal-cell-sizes-internal: Private ordinary functions
Function, autocorrelation: Public ordinary functions
Function, autocorrelation-internal: Private ordinary functions
Function, beta: Public ordinary functions
Function, beta-incomplete: Public ordinary functions
Function, binomial-cdf: Public ordinary functions
Function, binomial-cdf-exact: Public ordinary functions
Function, binomial-coefficient: Public ordinary functions
Function, binomial-coefficient-exact: Public ordinary functions
Function, binomial-probability: Public ordinary functions
Function, binomial-probability-exact: Public ordinary functions
Function, chi-square-2x2: Private ordinary functions
Function, chi-square-2x2-counts: Private ordinary functions
Function, chi-square-rxc: Private ordinary functions
Function, chi-square-rxc-counts: Private ordinary functions
Function, chi-square-significance: Public ordinary functions
Function, combination-count: Public ordinary functions
Function, confidence-interval: Public ordinary functions
Function, confidence-interval-internal: Private ordinary functions
Function, confidence-interval-proportion: Public ordinary functions
Function, confidence-interval-proportion-internal: Private ordinary functions
Function, confidence-interval-t: Public ordinary functions
Function, confidence-interval-t-internal: Private ordinary functions
Function, confidence-interval-t-summaries: Public ordinary functions
Function, confidence-interval-z: Public ordinary functions
Function, confidence-interval-z-internal: Private ordinary functions
Function, confidence-interval-z-summaries: Private ordinary functions
Function, correlation: Public ordinary functions
Function, correlation-from-summaries: Public ordinary functions
Function, correlation-internal: Private ordinary functions
Function, correlation-matrix: Public ordinary functions
Function, covariance: Public ordinary functions
Function, covariance-internal: Private ordinary functions
Function, cross-correlation: Public ordinary functions
Function, cross-correlation-internal: Private ordinary functions
Function, d-test: Public ordinary functions
Function, d-test-internal: Private ordinary functions
Function, data-continuous-p: Private ordinary functions
Function, data-length: Public ordinary functions
Function, data-length-internal: Private ordinary functions
Function, degrees->radians: Public ordinary functions
Function, difference-list: Private ordinary functions
Function, div2: Public ordinary functions
Function, ensure-float: Public ordinary functions
Function, error-function: Public ordinary functions
Function, error-function-complement: Public ordinary functions
Function, error-function-complement-short-1: Private ordinary functions
Function, error-function-complement-short-2: Private ordinary functions
Function, exp2: Public ordinary functions
Function, extract-unique-values: Public ordinary functions
Function, f-measure: Public ordinary functions
Function, f-significance: Public ordinary functions
Function, factorial: Public ordinary functions
Function, factorial-exact: Public ordinary functions
Function, factorial-ln: Public ordinary functions
Function, fill-2d-array: Private ordinary functions
Function, find-critical-value: Private ordinary functions
Function, g-test: Private ordinary functions
Function, gamma-incomplete: Public ordinary functions
Function, gamma-ln: Public ordinary functions
Function, gaussian-cdf: Public ordinary functions
Function, gaussian-significance: Public ordinary functions
Function, inner-product: Private ordinary functions
Function, interquartile-range: Public ordinary functions
Function, interquartile-range-internal: Private ordinary functions
Function, invert-matrix: Private ordinary functions
Function, invert-matrix-iterate: Private ordinary functions
Function, lagged-correlation: Public ordinary functions
Function, linear-regression-brief: Public ordinary functions
Function, linear-regression-brief-summaries: Public ordinary functions
Function, linear-regression-minimal: Public ordinary functions
Function, linear-regression-minimal-summaries: Public ordinary functions
Function, linear-regression-verbose: Public ordinary functions
Function, linear-regression-verbose-summaries: Public ordinary functions
Function, linear-scale: Public ordinary functions
Function, list-2d-array: Private ordinary functions
Function, log2: Public ordinary functions
Function, make-3d-table: Private ordinary functions
Function, make-contingency-table: Private ordinary functions
Function, matrix-addition: Private ordinary functions
Function, matrix-multiply: Public ordinary functions
Function, matrix-norm: Private ordinary functions
Function, matrix-plus-matrix: Private ordinary functions
Function, matrix-plus-scalar: Private ordinary functions
Function, matrix-times-matrix: Private ordinary functions
Function, matrix-times-scalar: Private ordinary functions
Function, matrix-times-scalar!: Private ordinary functions
Function, matrix-trace: Public ordinary functions
Function, maximum: Public ordinary functions
Function, maximum-internal: Private ordinary functions
Function, mean: Public ordinary functions
Function, mean-internal: Private ordinary functions
Function, median: Public ordinary functions
Function, median-internal: Private ordinary functions
Function, minimum: Public ordinary functions
Function, minimum-internal: Private ordinary functions
Function, mod2: Public ordinary functions
Function, mode: Public ordinary functions
Function, mode-for-continuous-data: Private ordinary functions
Function, mode-internal: Private ordinary functions
Function, multiple-linear-regression-arrays: Public ordinary functions
Function, multiple-linear-regression-brief: Public ordinary functions
Function, multiple-linear-regression-minimal: Public ordinary functions
Function, multiple-linear-regression-normal: Public ordinary functions
Function, multiple-linear-regression-verbose: Public ordinary functions
Function, multiple-modes: Public ordinary functions
Function, multiple-modes-internal: Private ordinary functions
Function, multiply-matrices: Private ordinary functions
Function, normalize-matrix: Public ordinary functions
Function, on-interval: Public ordinary functions
Function, partials-from-parents: Public ordinary functions
Function, permutation-count: Public ordinary functions
Function, poisson-cdf: Public ordinary functions
Function, print-anova-table: Private ordinary functions
Function, print-scheffe-table: Private ordinary functions
Function, pythag-df: Private ordinary functions
Function, pythag-sf: Private ordinary functions
Function, quantile: Public ordinary functions
Function, quantile-internal: Private ordinary functions
Function, r-score: Public ordinary functions
Function, radians->degrees: Public ordinary functions
Function, range: Public ordinary functions
Function, range-internal: Private ordinary functions
Function, reduce-matrix: Private ordinary functions
Function, remove-&rest: Private ordinary functions
Function, round-to-factor: Public ordinary functions
Function, safe-exp: Public ordinary functions
Function, scalar-matrix-multiply: Private ordinary functions
Function, scheffe-tests: Public ordinary functions
Function, significance: Public ordinary functions
Function, significance-internal: Private ordinary functions
Function, singular-value-decomposition: Private ordinary functions
Function, skewness: Public ordinary functions
Function, skewness-internal: Private ordinary functions
Function, smart-mode: Private ordinary functions
Function, smooth-4253h: Public ordinary functions
Function, smooth-hanning: Public ordinary functions
Function, smooth-mean-2: Public ordinary functions
Function, smooth-mean-3: Public ordinary functions
Function, smooth-mean-4: Public ordinary functions
Function, smooth-mean-5: Public ordinary functions
Function, smooth-median-2: Public ordinary functions
Function, smooth-median-3: Public ordinary functions
Function, smooth-median-4: Public ordinary functions
Function, smooth-median-5: Public ordinary functions
Function, square: Public ordinary functions
Function, standard-deviation: Public ordinary functions
Function, standard-deviation-internal: Private ordinary functions
Function, statistical-summary: Public ordinary functions
Function, statistical-summary-internal: Private ordinary functions
Function, students-t-significance: Public ordinary functions
Function, sum-list: Private ordinary functions
Function, sum-of-array-elements: Public ordinary functions
Function, sum-of-squares: Private ordinary functions
Function, svbksb-df: Private ordinary functions
Function, svbksb-sf: Private ordinary functions
Function, svd-back-substitute: Private ordinary functions
Function, svd-inverse-fast-df: Private ordinary functions
Function, svd-inverse-fast-sf: Private ordinary functions
Function, svd-inverse-slow-df: Private ordinary functions
Function, svd-inverse-slow-sf: Private ordinary functions
Function, svd-matrix-inverse: Private ordinary functions
Function, svd-solve-linear-system: Private ordinary functions
Function, svd-zero: Private ordinary functions
Function, svdcmp-df: Public ordinary functions
Function, svdcmp-sf: Public ordinary functions
Function, svdvar: Private ordinary functions
Function, svzero-df: Private ordinary functions
Function, svzero-sf: Private ordinary functions
Function, t-significance: Public ordinary functions
Function, t-significance-internal: Private ordinary functions
Function, t-test: Public ordinary functions
Function, t-test-internal: Private ordinary functions
Function, t-test-matched: Public ordinary functions
Function, t-test-matched-internal: Private ordinary functions
Function, t-test-one-sample: Public ordinary functions
Function, t-test-one-sample-internal: Private ordinary functions
Function, times2: Public ordinary functions
Function, transpose-matrix: Public ordinary functions
Function, trimmed-mean: Public ordinary functions
Function, trimmed-mean-internal: Private ordinary functions
Function, trunc2: Public ordinary functions
Function, truncate-to-factor: Public ordinary functions
Function, tukey-summary: Public ordinary functions
Function, tukey-summary-internal: Private ordinary functions
Function, variance: Public ordinary functions
Function, variance-internal: Private ordinary functions
Function, z-test-one-sample: Public ordinary functions
Function, z-test-one-sample-internal: Private ordinary functions

G
g-test: Private ordinary functions
gamma-incomplete: Public ordinary functions
gamma-ln: Public ordinary functions
gaussian-cdf: Public ordinary functions
gaussian-significance: Public ordinary functions
Generic Function, composite-statistic-p: Private generic functions
Generic Function, convert: Public generic functions
Generic Function, cross-product: Public generic functions
Generic Function, dot-product: Public generic functions
Generic Function, make-statistic: Private generic functions
Generic Function, simple-statistic-p: Private generic functions
Generic Function, statisticp: Private generic functions

I
inner-product: Private ordinary functions
interquartile-range: Public ordinary functions
interquartile-range-internal: Private ordinary functions
invert-matrix: Private ordinary functions
invert-matrix-iterate: Private ordinary functions

L
lagged-correlation: Public ordinary functions
linear-regression-brief: Public ordinary functions
linear-regression-brief-summaries: Public ordinary functions
linear-regression-minimal: Public ordinary functions
linear-regression-minimal-summaries: Public ordinary functions
linear-regression-verbose: Public ordinary functions
linear-regression-verbose-summaries: Public ordinary functions
linear-scale: Public ordinary functions
list-2d-array: Private ordinary functions
log2: Public ordinary functions

M
Macro, aref1: Private macros
Macro, aref11: Private macros
Macro, check-type-of-arg: Private macros
Macro, define-statistic: Private macros
Macro, sign-df: Private macros
Macro, sign-sf: Private macros
Macro, start/end: Private macros
Macro, underflow-goes-to-zero: Public macros
Macro, with-routine-error-handling: Private macros
Macro, with-temp-table: Public macros
Macro, with-temp-vector: Public macros
make-3d-table: Private ordinary functions
make-contingency-table: Private ordinary functions
make-statistic: Private generic functions
make-statistic: Private generic functions
matrix-addition: Private ordinary functions
matrix-multiply: Public ordinary functions
matrix-norm: Private ordinary functions
matrix-plus-matrix: Private ordinary functions
matrix-plus-scalar: Private ordinary functions
matrix-times-matrix: Private ordinary functions
matrix-times-scalar: Private ordinary functions
matrix-times-scalar!: Private ordinary functions
matrix-trace: Public ordinary functions
maximum: Public ordinary functions
maximum-internal: Private ordinary functions
mean: Public ordinary functions
mean-internal: Private ordinary functions
median: Public ordinary functions
median-internal: Private ordinary functions
Method, composite-statistic-p: Private generic functions
Method, composite-statistic-p: Private generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, cross-product: Public generic functions
Method, dot-product: Public generic functions
Method, make-statistic: Private generic functions
Method, simple-statistic-p: Private generic functions
Method, simple-statistic-p: Private generic functions
Method, statisticp: Private generic functions
Method, statisticp: Private generic functions
minimum: Public ordinary functions
minimum-internal: Private ordinary functions
mod2: Public ordinary functions
mode: Public ordinary functions
mode-for-continuous-data: Private ordinary functions
mode-internal: Private ordinary functions
multiple-linear-regression-arrays: Public ordinary functions
multiple-linear-regression-brief: Public ordinary functions
multiple-linear-regression-minimal: Public ordinary functions
multiple-linear-regression-normal: Public ordinary functions
multiple-linear-regression-verbose: Public ordinary functions
multiple-modes: Public ordinary functions
multiple-modes-internal: Private ordinary functions
multiply-matrices: Private ordinary functions

N
normalize-matrix: Public ordinary functions

O
on-interval: Public ordinary functions

P
partials-from-parents: Public ordinary functions
permutation-count: Public ordinary functions
poisson-cdf: Public ordinary functions
print-anova-table: Private ordinary functions
print-scheffe-table: Private ordinary functions
pythag-df: Private ordinary functions
pythag-sf: Private ordinary functions

Q
quantile: Public ordinary functions
quantile-internal: Private ordinary functions

R
r-score: Public ordinary functions
radians->degrees: Public ordinary functions
range: Public ordinary functions
range-internal: Private ordinary functions
reduce-matrix: Private ordinary functions
remove-&rest: Private ordinary functions
round-to-factor: Public ordinary functions

S
safe-exp: Public ordinary functions
scalar-matrix-multiply: Private ordinary functions
scheffe-tests: Public ordinary functions
sign-df: Private macros
sign-sf: Private macros
significance: Public ordinary functions
significance-internal: Private ordinary functions
simple-statistic-p: Private generic functions
simple-statistic-p: Private generic functions
simple-statistic-p: Private generic functions
singular-value-decomposition: Private ordinary functions
skewness: Public ordinary functions
skewness-internal: Private ordinary functions
smart-mode: Private ordinary functions
smooth-4253h: Public ordinary functions
smooth-hanning: Public ordinary functions
smooth-mean-2: Public ordinary functions
smooth-mean-3: Public ordinary functions
smooth-mean-4: Public ordinary functions
smooth-mean-5: Public ordinary functions
smooth-median-2: Public ordinary functions
smooth-median-3: Public ordinary functions
smooth-median-4: Public ordinary functions
smooth-median-5: Public ordinary functions
square: Public ordinary functions
standard-deviation: Public ordinary functions
standard-deviation-internal: Private ordinary functions
start/end: Private macros
statistical-summary: Public ordinary functions
statistical-summary-internal: Private ordinary functions
statisticp: Private generic functions
statisticp: Private generic functions
statisticp: Private generic functions
students-t-significance: Public ordinary functions
sum-list: Private ordinary functions
sum-of-array-elements: Public ordinary functions
sum-of-squares: Private ordinary functions
svbksb-df: Private ordinary functions
svbksb-sf: Private ordinary functions
svd-back-substitute: Private ordinary functions
svd-inverse-fast-df: Private ordinary functions
svd-inverse-fast-sf: Private ordinary functions
svd-inverse-slow-df: Private ordinary functions
svd-inverse-slow-sf: Private ordinary functions
svd-matrix-inverse: Private ordinary functions
svd-solve-linear-system: Private ordinary functions
svd-zero: Private ordinary functions
svdcmp-df: Public ordinary functions
svdcmp-sf: Public ordinary functions
svdvar: Private ordinary functions
svzero-df: Private ordinary functions
svzero-sf: Private ordinary functions

T
t-significance: Public ordinary functions
t-significance-internal: Private ordinary functions
t-test: Public ordinary functions
t-test-internal: Private ordinary functions
t-test-matched: Public ordinary functions
t-test-matched-internal: Private ordinary functions
t-test-one-sample: Public ordinary functions
t-test-one-sample-internal: Private ordinary functions
times2: Public ordinary functions
transpose-matrix: Public ordinary functions
trimmed-mean: Public ordinary functions
trimmed-mean-internal: Private ordinary functions
trunc2: Public ordinary functions
truncate-to-factor: Public ordinary functions
tukey-summary: Public ordinary functions
tukey-summary-internal: Private ordinary functions

U
underflow-goes-to-zero: Public macros

V
variance: Public ordinary functions
variance-internal: Private ordinary functions

W
with-routine-error-handling: Private macros
with-temp-table: Public macros
with-temp-vector: Public macros

Z
z-test-one-sample: Public ordinary functions
z-test-one-sample-internal: Private ordinary functions


A.3 Variables

Jump to:   *   +   2  
A   B   C   D   F   G   L   M   R   S   T   U   V  
Index Entry  Section

*
*continous-data-window-divisor*: Private special variables
*continuous-variable-uniqueness-factor*: Private special variables
*create-statistical-objects*: Private special variables
*gaussian-cdf-signals-zero-standard-deviation-error*: Private special variables
*temporary-table*: Private special variables
*temporary-vector*: Private special variables
*way-too-big-contingency-table-dimension*: Private special variables

+
+0degrees+: Public constants
+10degrees+: Public constants
+120degrees+: Public constants
+135degrees+: Public constants
+150degrees+: Public constants
+15degrees+: Public constants
+180degrees+: Public constants
+210degrees+: Public constants
+225degrees+: Public constants
+240degrees+: Public constants
+270degrees+: Public constants
+300degrees+: Public constants
+30degrees+: Public constants
+315degrees+: Public constants
+330degrees+: Public constants
+360degrees+: Public constants
+45degrees+: Public constants
+5degrees+: Public constants
+60degrees+: Public constants
+90degrees+: Public constants
+e+: Public constants
+log-pi+: Private constants
+sqrt-pi+: Private constants

2
2fpi: Public constants

A
a-labels: Public classes
ab-matrix: Public classes
anova-table: Public classes
anova-table: Public classes
anova-table: Public classes

B
b-labels: Public classes

C
column-totals: Public classes
Constant, +0degrees+: Public constants
Constant, +10degrees+: Public constants
Constant, +120degrees+: Public constants
Constant, +135degrees+: Public constants
Constant, +150degrees+: Public constants
Constant, +15degrees+: Public constants
Constant, +180degrees+: Public constants
Constant, +210degrees+: Public constants
Constant, +225degrees+: Public constants
Constant, +240degrees+: Public constants
Constant, +270degrees+: Public constants
Constant, +300degrees+: Public constants
Constant, +30degrees+: Public constants
Constant, +315degrees+: Public constants
Constant, +330degrees+: Public constants
Constant, +360degrees+: Public constants
Constant, +45degrees+: Public constants
Constant, +5degrees+: Public constants
Constant, +60degrees+: Public constants
Constant, +90degrees+: Public constants
Constant, +e+: Public constants
Constant, +log-pi+: Private constants
Constant, +sqrt-pi+: Private constants
Constant, 2fpi: Public constants
Constant, fpi: Public constants
count: Public classes

D
dof: Public classes

F
first-quartile: Public classes
fpi: Public constants

G
grand-totla: Public classes

L
level: Public classes
lower-bound: Public classes

M
maximum: Public classes
means-list: Public classes
median: Public classes
minimum: Public classes

R
row-totals: Public classes

S
scheffe-table: Public classes
Slot, a-labels: Public classes
Slot, ab-matrix: Public classes
Slot, anova-table: Public classes
Slot, anova-table: Public classes
Slot, anova-table: Public classes
Slot, b-labels: Public classes
Slot, column-totals: Public classes
Slot, count: Public classes
Slot, dof: Public classes
Slot, first-quartile: Public classes
Slot, grand-totla: Public classes
Slot, level: Public classes
Slot, lower-bound: Public classes
Slot, maximum: Public classes
Slot, means-list: Public classes
Slot, median: Public classes
Slot, minimum: Public classes
Slot, row-totals: Public classes
Slot, scheffe-table: Public classes
Slot, sst-alt: Public classes
Slot, statistic: Public classes
Slot, std-error: Public classes
Slot, third-quartile: Public classes
Slot, times: Public classes
Slot, upper-bound: Public classes
Slot, value: Public classes
Special Variable, *continous-data-window-divisor*: Private special variables
Special Variable, *continuous-variable-uniqueness-factor*: Private special variables
Special Variable, *create-statistical-objects*: Private special variables
Special Variable, *gaussian-cdf-signals-zero-standard-deviation-error*: Private special variables
Special Variable, *temporary-table*: Private special variables
Special Variable, *temporary-vector*: Private special variables
Special Variable, *way-too-big-contingency-table-dimension*: Private special variables
sst-alt: Public classes
statistic: Public classes
std-error: Public classes

T
third-quartile: Public classes
times: Public classes

U
upper-bound: Public classes

V
value: Public classes


A.4 Data types

Jump to:   A   B   C   D   E   F   I   M   N   P   Q   R   S   T   U   V   W   Z  
Index Entry  Section

A
anova-one-way-variables: Public classes
anova-two-way-variables: Public classes
anova-two-way-variables-unequal-cell-sizes: Public classes
anova.lisp: The cl-mathstats/dev/anova․lisp file
api.lisp: The cl-mathstats/dev/api․lisp file
asdf-cl-mathstats: The asdf-cl-mathstats package
autocorrelation: Public classes

B
basic-statistics.lisp: The cl-mathstats/dev/basic-statistics․lisp file
binary-math.lisp: The cl-mathstats/dev/binary-math․lisp file

C
cl-mathstats: The cl-mathstats system
cl-mathstats: The cl-mathstats package
cl-mathstats.asd: The cl-mathstats/cl-mathstats․asd file
Class, anova-one-way-variables: Public classes
Class, anova-two-way-variables: Public classes
Class, anova-two-way-variables-unequal-cell-sizes: Public classes
Class, autocorrelation: Public classes
Class, composite-statistic: Private classes
Class, confidence-interval: Public classes
Class, confidence-interval-proportion: Public classes
Class, confidence-interval-t: Public classes
Class, confidence-interval-z: Public classes
Class, correlation: Public classes
Class, covariance: Public classes
Class, cross-correlation: Public classes
Class, d-test: Public classes
Class, data: Private classes
Class, data-length: Public classes
Class, interquartile-range: Public classes
Class, maximum: Public classes
Class, mean: Public classes
Class, median: Public classes
Class, minimum: Public classes
Class, mode: Public classes
Class, multiple-modes: Public classes
Class, quantile: Public classes
Class, range: Public classes
Class, significance: Public classes
Class, simple-statistic: Private classes
Class, skewness: Public classes
Class, standard-deviation: Public classes
Class, statistic: Private classes
Class, statistical-summary: Public classes
Class, t-significance: Public classes
Class, t-test: Public classes
Class, t-test-matched: Public classes
Class, t-test-one-sample: Public classes
Class, trimmed-mean: Public classes
Class, tukey-summary: Public classes
Class, variance: Public classes
Class, z-test-one-sample: Public classes
class-defs.lisp: The cl-mathstats/dev/class-defs․lisp file
composite-statistic: Private classes
Condition, data-error: Private conditions
Condition, enormous-contingency-table: Private conditions
Condition, insufficient-data: Private conditions
Condition, no-data: Private conditions
Condition, not-binary-variables: Private conditions
Condition, unmatched-sequences: Private conditions
Condition, zero-standard-deviation: Private conditions
Condition, zero-variance: Private conditions
confidence-interval: Public classes
confidence-interval-proportion: Public classes
confidence-interval-t: Public classes
confidence-interval-z: Public classes
correlation: Public classes
correlation-regression.lisp: The cl-mathstats/dev/correlation-regression․lisp file
covariance: Public classes
cross-correlation: Public classes

D
d-test: Public classes
data: Private classes
data-error: Private conditions
data-length: Public classes
define-statistical-fun.lisp: The cl-mathstats/dev/define-statistical-fun․lisp file
definitions.lisp: The cl-mathstats/dev/definitions․lisp file
density-fns.lisp: The cl-mathstats/dev/density-fns․lisp file
dev: The cl-mathstats/dev module

E
enormous-contingency-table: Private conditions

F
File, anova.lisp: The cl-mathstats/dev/anova․lisp file
File, api.lisp: The cl-mathstats/dev/api․lisp file
File, basic-statistics.lisp: The cl-mathstats/dev/basic-statistics․lisp file
File, binary-math.lisp: The cl-mathstats/dev/binary-math․lisp file
File, cl-mathstats.asd: The cl-mathstats/cl-mathstats․asd file
File, class-defs.lisp: The cl-mathstats/dev/class-defs․lisp file
File, correlation-regression.lisp: The cl-mathstats/dev/correlation-regression․lisp file
File, define-statistical-fun.lisp: The cl-mathstats/dev/define-statistical-fun․lisp file
File, definitions.lisp: The cl-mathstats/dev/definitions․lisp file
File, density-fns.lisp: The cl-mathstats/dev/density-fns․lisp file
File, index.md: The cl-mathstats/website/source/index․md file
File, math-utilities.lisp: The cl-mathstats/dev/math-utilities․lisp file
File, matrices.lisp: The cl-mathstats/dev/matrices․lisp file
File, matrix-fns.lisp: The cl-mathstats/dev/matrix-fns․lisp file
File, package.lisp: The cl-mathstats/dev/package․lisp file
File, parameters.lisp: The cl-mathstats/dev/parameters․lisp file
File, smoothing.lisp: The cl-mathstats/dev/smoothing․lisp file
File, svd.lisp: The cl-mathstats/dev/svd․lisp file
File, utilities.lisp: The cl-mathstats/dev/utilities․lisp file

I
index.md: The cl-mathstats/website/source/index․md file
insufficient-data: Private conditions
interquartile-range: Public classes

M
math-utilities.lisp: The cl-mathstats/dev/math-utilities․lisp file
matrices.lisp: The cl-mathstats/dev/matrices․lisp file
matrix-fns.lisp: The cl-mathstats/dev/matrix-fns․lisp file
maximum: Public classes
mean: Public classes
median: Public classes
minimum: Public classes
mode: Public classes
Module, dev: The cl-mathstats/dev module
Module, source: The cl-mathstats/website/source module
Module, website: The cl-mathstats/website module
multiple-modes: Public classes

N
no-data: Private conditions
not-binary-variables: Private conditions

P
Package, asdf-cl-mathstats: The asdf-cl-mathstats package
Package, cl-mathstats: The cl-mathstats package
package.lisp: The cl-mathstats/dev/package․lisp file
parameters.lisp: The cl-mathstats/dev/parameters․lisp file

Q
quantile: Public classes

R
range: Public classes

S
significance: Public classes
simple-statistic: Private classes
skewness: Public classes
smoothing.lisp: The cl-mathstats/dev/smoothing․lisp file
source: The cl-mathstats/website/source module
standard-deviation: Public classes
statistic: Private classes
statistical-summary: Public classes
svd.lisp: The cl-mathstats/dev/svd․lisp file
System, cl-mathstats: The cl-mathstats system

T
t-significance: Public classes
t-test: Public classes
t-test-matched: Public classes
t-test-one-sample: Public classes
trimmed-mean: Public classes
tukey-summary: Public classes

U
unmatched-sequences: Private conditions
utilities.lisp: The cl-mathstats/dev/utilities․lisp file

V
variance: Public classes

W
website: The cl-mathstats/website module

Z
z-test-one-sample: Public classes
zero-standard-deviation: Private conditions
zero-variance: Private conditions