Liking cljdoc? Tell your friends :D

kixi.stats.core


adjusted-r-squaredclj/s

(adjusted-r-squared fy-hat fy k)

Given two functions: (fŷ input) and (fy input), returning the predicted and actual values of y respectively, and a constant k equal to the number of terms in the model, estimates the adjusted coefficient of determination R^2 using Wherry's Formula-1. This is the fraction of variance in y explained by the model, adjusted for the number of terms in the model. https://stats.stackexchange.com/questions/48703/what-is-the-adjusted-r-squared-formula-in-lm-in-r-and-how-should-it-be-interpret

Given two functions: (fŷ input) and (fy input), returning
the predicted and actual values of y respectively, and a constant k
equal to the number of terms in the model, estimates the adjusted
coefficient of determination R^2 using Wherry's Formula-1.
This is the fraction of variance in y explained by the model,
adjusted for the number of terms in the model.
https://stats.stackexchange.com/questions/48703/what-is-the-adjusted-r-squared-formula-in-lm-in-r-and-how-should-it-be-interpret
sourceraw docstring

arithmetic-meanclj/s

Calculates the arithmetic mean of numeric inputs.

Calculates the arithmetic mean of numeric inputs.
sourceraw docstring

chi-squared-testclj/s

(chi-squared-test & fxs)

Given a sequence of functions, each of which returns the categorical value (e.g. keyword or string) of a factor, performs a X^2 test of independence.

Given a sequence of functions, each of which returns the categorical value
(e.g. keyword or string) of a factor, performs a X^2 test of independence.
sourceraw docstring

correlationclj/s

(correlation fx fy)

Given two functions: (fx input) and (fy input), each of which returns a number, estimates the unbiased linear correlation coefficient between fx and fy over inputs. Ignores any records where fx or fy are nil. If there are no records with values for fx and fy, the correlation is nil. See http://mathworld.wolfram.com/CorrelationCoefficient.html.

Given two functions: (fx input) and (fy input), each of which returns a
number, estimates the unbiased linear correlation coefficient between fx and
fy over inputs. Ignores any records where fx or fy are nil. If there are no
records with values for fx and fy, the correlation is nil. See
http://mathworld.wolfram.com/CorrelationCoefficient.html.
sourceraw docstring

correlation-matrixclj/s

(correlation-matrix kvs)

Given a map of key names to functions that extract values for those keys from an input, computes the correlation for each of the n^2 key pairs. For example:

(correlation-matrix {:name-length #(.length (:name %))
                     :age         :age
                     :num-cats    (comp count :cats)})

will, when reduced, return a map like:

{[:name-length :age]      0.56
 [:name-length :num-cats] 0.95
 ...}
Given a map of key names to functions that extract values for those keys
from an input, computes the correlation for each of the n^2 key pairs.
For example:

    (correlation-matrix {:name-length #(.length (:name %))
                         :age         :age
                         :num-cats    (comp count :cats)})

will, when reduced, return a map like:

    {[:name-length :age]      0.56
     [:name-length :num-cats] 0.95
     ...}
sourceraw docstring

countclj/s

Calculates the count of inputs.

Calculates the count of inputs.
sourceraw docstring

covarianceclj/s

Alias for covariance-s

Alias for covariance-s
sourceraw docstring

covariance-matrixclj/s

(covariance-matrix kvs)

Given a map of key names to functions that extract values for those keys from an input, computes the covariance for each of the n^2 key pairs. For example:

(covariance-matrix {:name-length #(.length (:name %))
                    :age         :age
                    :num-cats    (comp count :cats)})

will, when reduced, return a map like:

{[:name-length :age]      0.56
 [:name-length :num-cats] 0.95
 ...}
Given a map of key names to functions that extract values for those keys
from an input, computes the covariance for each of the n^2 key pairs.
For example:

    (covariance-matrix {:name-length #(.length (:name %))
                        :age         :age
                        :num-cats    (comp count :cats)})

will, when reduced, return a map like:

    {[:name-length :age]      0.56
     [:name-length :num-cats] 0.95
     ...}
sourceraw docstring

covariance-pclj/s

(covariance-p fx fy)

Given two functions of an input (fx input) and (fy input), each of which returns a number, estimates the population covariance of those functions over inputs.

Ignores any inputs where (fx input) or (fy input) are nil. If no inputs have both x and y, returns nil.

Given two functions of an input `(fx input)` and `(fy input)`, each of which
returns a number, estimates the population covariance of those functions over
inputs.

Ignores any inputs where `(fx input)` or `(fy input)` are nil. If no
inputs have both x and y, returns nil.
sourceraw docstring

covariance-sclj/s

(covariance-s fx fy)

Given two functions of an input (fx input) and (fy input), each of which returns a number, estimates the unbiased covariance of those functions over inputs.

Ignores any inputs where (fx input) or (fy input) are nil. If no inputs have both x and y, returns nil.

Given two functions of an input `(fx input)` and `(fy input)`, each of which
returns a number, estimates the unbiased covariance of those functions over
inputs.

Ignores any inputs where `(fx input)` or `(fy input)` are nil. If no
inputs have both x and y, returns nil.
sourceraw docstring

cramers-vclj/s

(cramers-v fx fy)

Cramer's Phi is the intercorrelation of two discrete variables and may be used with variables having two or more levels. It gives a value between 0 and +1 (inclusive). Given two functions: (fx input) and (fy input), each of which returns a the relevant discrete value.

Cramer's Phi is the intercorrelation of two discrete variables and may be used with variables having two or more levels. It gives a value between 0 and +1 (inclusive).
Given two functions: (fx input) and (fy input), each of which returns a the relevant discrete value.
sourceraw docstring

cross-tabulateclj/s

(cross-tabulate & fxs)

Given a sequence of n functions, each of which returns a categorical value (e.g. keyword or string) of a factor, calculates an n-dimensional contingency table implementing IContingencyTable. This can be passed to kixi.stats.test/chi-squared-test to determine if the relationship between factors is significant. See also: kixi.stats.core/chi-squared-test

Given a sequence of n functions, each of which returns a categorical value
(e.g. keyword or string) of a factor, calculates an n-dimensional contingency table
implementing IContingencyTable. This can be passed to kixi.stats.test/chi-squared-test
to determine if the relationship between factors is significant.
See also: kixi.stats.core/chi-squared-test
sourceraw docstring

geometric-meanclj/s

Calculates the geometric mean of numeric inputs. Defined only for positive numbers.

Calculates the geometric mean of numeric inputs. Defined only for positive numbers.
sourceraw docstring

harmonic-meanclj/s

Calculates the harmonic mean of numeric inputs.

Calculates the harmonic mean of numeric inputs.
sourceraw docstring

histogramclj

Calculates a histogram of numeric inputs using the t-digest with default arguments.

Calculates a histogram of numeric inputs using the t-digest with default arguments.
sourceraw docstring

iqrclj

Calculates the interquartile range of numeric inputs.

Calculates the interquartile range of numeric inputs.
sourceraw docstring

kurtosisclj/s

Alias for kurtosis-s.

Alias for kurtosis-s.
sourceraw docstring

kurtosis-pclj/s

Calculates the population kurtosis of numeric inputs. See http://www.macroption.com/kurtosis-formula/

Calculates the population kurtosis of numeric inputs.
See http://www.macroption.com/kurtosis-formula/
sourceraw docstring

kurtosis-sclj/s

Estimates the sample kurtosis of numeric inputs.
See https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
and http://www.real-statistics.com/descriptive-statistics/symmetry-skewness-kurtosis.
sourceraw docstring

maxclj/s

Like clojure.core/max, but transducer and nil-friendly.

Like clojure.core/max, but transducer and nil-friendly.
sourceraw docstring

meanclj/s

Alias for arithmetic-mean.

Alias for arithmetic-mean.
sourceraw docstring

medianclj

Calculates the median of numeric inputs.

Calculates the median of numeric inputs.
sourceraw docstring

minclj/s

Like clojure.core/min, but transducer and nil-friendly.

Like clojure.core/min, but transducer and nil-friendly.
sourceraw docstring

monoidclj/s

(monoid f init)

Add 0-arity returning init to f.

Add 0-arity returning `init` to `f`.
sourceraw docstring

mseclj/s

(mse fy-hat fy)

Given two functions: (fŷ input) and (fy input), returning the predicted and actual values of y respectively, calculates the mean squared error of the estimate.

Given two functions: (fŷ input) and (fy input), returning
the predicted and actual values of y respectively, calculates
the mean squared error of the estimate.
sourceraw docstring

proportionclj/s

(proportion pred)

Calculate the proportion of inputs for which pred returns true.

Calculate the proportion of inputs for which `pred` returns true.
sourceraw docstring

r-squaredclj/s

(r-squared fy-hat fy)

Given two functions: (fŷ input) and (fy input), returning the predicted and actual values of y respectively, estimates the coefficient of determination R^2. This is the fraction of variance in y explained by the model.

Given two functions: (fŷ input) and (fy input), returning
the predicted and actual values of y respectively, estimates
the coefficient of determination R^2.
This is the fraction of variance in y explained by the model.
sourceraw docstring

rmseclj/s

(rmse fy-hat fy)

Given two functions: (fŷ input) and (fy input), returning the predicted and actual values of y respectively, calculates the root mean squared error of the estimate.

Given two functions: (fŷ input) and (fy input), returning
the predicted and actual values of y respectively, calculates
the root mean squared error of the estimate.
sourceraw docstring

shareclj/s

Alias for proportion

Alias for proportion
sourceraw docstring

simple-linear-regressionclj/s

(simple-linear-regression fx fy)

Given two functions: (fx input) and (fy input), each of which returns a number, calculates a least squares linear model between fx and fy over inputs. Returns a vector containing the coefficients: offset and slope. Ignores any records with fx or fy are nil. If there are no records with values for fx and fy, the linear relationship is nil. See https://en.wikipedia.org/wiki/Simple_linear_regression.

Given two functions: (fx input) and (fy input), each of which returns a
number, calculates a least squares linear model between fx and fy over inputs.
Returns a vector containing the coefficients: offset and slope.
Ignores any records with fx or fy are nil. If there are no records with
values for fx and fy, the linear relationship is nil. See
https://en.wikipedia.org/wiki/Simple_linear_regression.
sourceraw docstring

simple-z-testclj/s

(simple-z-test {:keys [mu sd]} & [opts])

Performs a simple z test against a specified population mean and standard deviation. The standard deviation is optional, if not provided, a 'plug-in' test using the sample's sd will be performed instead. mu: the population mean sd: (optional) the population standard deviation opts: (optional) see kixi.stats.test/simple-z-test for options

Performs a simple z test against a specified population mean
and standard deviation. The standard deviation is optional,
if not provided, a 'plug-in' test using the sample's sd
will be performed instead.
mu: the population mean
sd: (optional) the population standard deviation
opts: (optional) see kixi.stats.test/simple-z-test for options
sourceraw docstring

skewnessclj/s

Alias for skewness-s.

Alias for skewness-s.
sourceraw docstring

skewness-pclj/s

Calculates the population skewness of numeric inputs. See: http://www.real-statistics.com/descriptive-statistics/symmetry-skewness-kurtosis.

Calculates the population skewness of numeric inputs.
See: http://www.real-statistics.com/descriptive-statistics/symmetry-skewness-kurtosis.
sourceraw docstring

skewness-sclj/s

Estimates the sample skewness of numeric inputs. See https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance.

Estimates the sample skewness of numeric inputs.
See https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance.
sourceraw docstring

standard-deviationclj/s

Alias for standard-deviation-s.

Alias for standard-deviation-s.
sourceraw docstring

standard-deviation-pclj/s

Calculates the population standard deviation of numeric inputs.

Calculates the population standard deviation of numeric inputs.
sourceraw docstring

standard-deviation-sclj/s

Estimates the sample standard deviation of numeric inputs.

Estimates the sample standard deviation of numeric inputs.
sourceraw docstring

standard-errorclj/s

Alias for standard-error-s

Alias for standard-error-s
sourceraw docstring

standard-error-estimateclj/s

Given two functions: (fx input) and (fy input), each of which returns a number, and an x value, calculates the standard error of the least squares linear model of fx and fy over inputs. Ignores any records with fx or fy are nil. If there are no records with values for fx and fy, the standard error of the estimate is nil.

Given two functions: (fx input) and (fy input), each of which returns a
number, and an x value, calculates the standard error of the least
squares linear model of fx and fy over inputs.
Ignores any records with fx or fy are nil. If there are no records with
values for fx and fy, the standard error of the estimate is nil.
sourceraw docstring

standard-error-predictionclj/s

Given two functions: (fx input) and (fy input), each of which returns a number, and an x value, calculates the standard error of the least squares linear model of fx and fy over inputs. Ignores any records with fx or fy are nil. If there are no records with values for fx and fy, the standard error of the estimate is nil.

Given two functions: (fx input) and (fy input), each of which returns a
number, and an x value, calculates the standard error of the least
squares linear model of fx and fy over inputs.
Ignores any records with fx or fy are nil. If there are no records with
values for fx and fy, the standard error of the estimate is nil.
sourceraw docstring

standard-error-sclj/s

Calculates the standard error of sample means.

Calculates the standard error of sample means.
sourceraw docstring

sum-squaresclj/s

(sum-squares fx fy)
source

summaryclj

Calculates the five number summary of numeric inputs.

Calculates the five number summary of numeric inputs.
sourceraw docstring

varianceclj/s

Alias for variance-s.

Alias for variance-s.
sourceraw docstring

variance-pclj/s

Calculates the population variance of numeric inputs.

Calculates the population variance of numeric inputs.
sourceraw docstring

variance-sclj/s

Estimates an unbiased variance of numeric inputs.

Estimates an unbiased variance of numeric inputs.
sourceraw docstring

z-testclj/s

(z-test fx fy & [opts])

Given two functions of an input (fx input) and (fy input), each of which returns a number, performs the z-test of mean significance of those functions over inputs.

Ignores only inputs where both (fx input) and (fy input) are nil.

Given two functions of an input `(fx input)` and `(fy input)`, each of which
returns a number, performs the z-test of mean significance of those functions over
inputs.

Ignores only inputs where both `(fx input)` and `(fy input)` are nil.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close