Janet 1.27.0-01aab66 Documentation
(Other Versions: 1.26.0 1.25.1 1.24.0 1.23.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.1 1.17.1 1.16.1 1.15.0 1.13.1 1.12.2 1.11.1 1.10.1 1.9.1 1.8.1 1.7.0 1.6.0 1.5.1 1.5.0 1.4.0 1.3.1 )

Math extended

Index

math/add math/add-to-mean math/approx-eq math/bernoulli-distribution math/binominal-coeficient math/binominal-distribution math/check-probability math/chi-squared-distribution-table math/cols math/cumulative-std-normal-probability math/det math/dot math/epsilon math/extent math/factorial math/geometric-mean math/get-only-el math/harmonic-mean math/ident math/interquartile-range math/linear-regression math/linear-regression-line math/median math/median-absolute-deviation math/minor math/mode math/mop math/mul math/perm math/permutation-test math/permutations math/poisson-distribution math/quantile math/quantile-rank math/quantile-rank-sorted math/quantile-sorted math/quickselect math/relative-err math/root-mean-square math/rows math/sample-correlation math/sample-covariance math/sample-skewness math/sample-standard-deviation math/sample-variance math/scalar math/shuffle-in-place math/size math/sop math/standard-deviation math/standard-normal-table math/sum-compensated math/sum-nth-power-deviations math/swap math/t-test math/t-test-2 math/trans math/variance math/z-score math/zero

function (math/add m a)
Add `a` to matrix `m` where it can be matrix or scalar.
Matrix `m` is mutated.
Community Examples / source
function (math/add-to-mean m n v)
Adds new value `v` to mean `m` from `n` values.
Community Examples / source
function (math/approx-eq a e &opt t)
Approximate equality between actual number `a`
and expected number `e`. Default tolerance `t`
is `epsilon`.
Community Examples / source
function (math/bernoulli-distribution p)
Creates Bernoulli distribution from popability `p` in the tuple.
Community Examples / source
function (math/binominal-coeficient n k)
Computes binominal coeficient from set of size `n`
and sample size `k`.
Community Examples / source
function (math/binominal-distribution t p)
Creates binominal distribution from trials `t`
and probability `p` in the tuple.
Community Examples / source
function (math/check-probability p)
Asserts that probability in in the [0 1] range.
Community Examples / source
struct math/chi-squared-distribution-table
Chi Squared distribution table.
Community Examples / source
function (math/cols m)
Returns numbers of columns of matrix `m`.
Community Examples / source
function (math/cumulative-std-normal-probability z)
Computes standard normal probability for `y`.
Community Examples / source
function (math/det m)
Computes determinant of matrix `m`.
Community Examples / source
function (math/dot mx my)
Computes dot product of matrices or vectors `x` and `y`.
Community Examples / source
number math/epsilon
Epsilon constant
Community Examples / source
function (math/extent xs)
Returns the minimum & maximum number in an `xs` as tuple.
Community Examples / source
function (math/factorial n)
Returns factorial of `n`.
Community Examples / source
function (math/geometric-mean xs)
Gets the geometric mean from `xs`.
Community Examples / source
macro (math/get-only-el m)
Convenience macro for geting first element
from first row of the two dimensional array `m`.
Community Examples / source
function (math/harmonic-mean xs)
Gets the harmonic mean from `xs`.
Community Examples / source
function (math/ident c)
Creates identity matrix with `c` x `c` size.
Community Examples / source
function (math/interquartile-range xs)
Gets the interquartile range from `xs`.
Community Examples / source
function (math/linear-regression coords)
Computes the slope `:m` and y-intercept `:b`
of the function in the struct from set of coordinates.
Community Examples / source
function (math/linear-regression-line {:m m :b b})
Constructs function from struct returned by linear regression.
Community Examples / source
function (math/median xs)
Gets the median value from `xs`
Community Examples / source
function (math/median-absolute-deviation xs)
Gets median absolute deviation from `xs`.
Community Examples / source
function (math/minor m x y)
Computes minor matrix of matrix `m` and `x`, `y`.
Community Examples / source
function (math/mode xs)
Gets the mode value from `xs`.
Community Examples / source
function (math/mop m op a)
Mutates every cell of the matrix `m` with `op`
and corresponding cell from matrix arg `a`.
Community Examples / source
function (math/mul m a)
Multiply matrix `m` with `a` which can be matrix or vector.
Matrix `m` is mutated.
Community Examples / source
function (math/perm m)
Computes permanent of the matrix `m`.
Community Examples / source
function (math/permutation-test xs ys &opt a k)
Conducts a permutation test to determine if two data sets
`xs` and `ys` are *significantly* different from each other.
You can use alternative hypotesis `a`, which defaults to `:two-side`,
with `:greater` and `:lesser` being the other two options.
The last optional argument is `k` number of values
in permutation distribution
Community Examples / source
function (math/permutations s &opt k)
Returns permutations of length `k` from members of `s`
Community Examples / source
function (math/poisson-distribution lambda)
Creates Poisson distribution from `lambda` in tuple.
Community Examples / source
function (math/quantile xs p)
Gets the quantile value from `xs` at `p` from unsorted population.
Community Examples / source
function (math/quantile-rank xs p)
Gets the quantile rank of value `v` from unsorted `xs`.
Community Examples / source
function (math/quantile-rank-sorted xs v)
Gets the quantile rank of value `v` from sorted `xs`.
Community Examples / source
function (math/quantile-sorted xs p)
Gets the quantile value from `xs` at `p` from sorted population.
Community Examples / source
function (math/quickselect arr k &opt left right)
Rearrange items in `arr` so that all items in `[left, k]` range
are the smallest.
The `k`-th element will have the `(k - left + 1)`-th smallest value
in `[left, right]`.
Mutates `arr`.
Community Examples / source
function (math/relative-err a e)
Gets the relative err between actual number `a`
and expected number `e`.
Community Examples / source
function (math/root-mean-square xs)
Gets the root mean square from `xs`.
Community Examples / source
function (math/rows m)
Returns numbers of rows of matrix `m`.
Community Examples / source
function (math/sample-correlation xs ys)
Gets the sample correlation between `xs` and `ys`.
Community Examples / source
function (math/sample-covariance xs ys)
Gets the sample covariance between `xs` and `ys`.
Community Examples / source
function (math/sample-skewness xs)
Gets the sample skeweness from the `xs`.
Community Examples / source
function (math/sample-standard-deviation xs)
Gets sample standard deviation from `xs`.
Community Examples / source
function (math/sample-variance xs)
Get the sample variance from `xs`.
Community Examples / source
function (math/scalar c s)
Creates scalar `s` matrix with `c` x `c` size.
Community Examples / source
function (math/shuffle-in-place xs)
Generate random permutation of the array `xs`
which is shuffled in place.
Community Examples / source
function (math/size m)
Returns tuple with the matrix `m` size [rows cols].
Community Examples / source
function (math/sop m op & a)
Mutates every cell of the matrix `m` with `op`
and variadic args `a`.
Community Examples / source
function (math/standard-deviation xs)
Gets the standard deviation from `ds`.
Community Examples / source
tuple math/standard-normal-table
Computed standard normal table.
Community Examples / source
function (math/sum-compensated xs)
Returns sum of the members of `xs` with Kahan-Babushka algorithm.
Community Examples / source
function (math/sum-nth-power-deviations xs n)
Get the sum of deviations to the n power.
Community Examples / source
function (math/swap arr i j)
Swaps members with indices `i` and `j` of arr.
Noop when `i` equals `j`.
Community Examples / source
function (math/t-test xs expv)
Computes one sample t-test comparing the mean of `xs`
to known value `expv`.
Community Examples / source
function (math/t-test-2 xs ys &opt d)
Computes two sample t-test of two samples `xs` and `ys`
with difference optional `d` which defaults to 0.
Community Examples / source
function (math/trans m)
Returns a new transposed matrix from `m`.
Community Examples / source
function (math/variance xs)
Get the variance from the `xs`.
Community Examples / source
function (math/z-score x m d)
Gets the standard score for number `x` from mean `m` 
and standard deviation `d`.
Community Examples / source
function (math/zero c &opt r)
Creates vector of length `c`, or matrix if `r`
is provided, and fills it with zeros.
Community Examples / source