Public Variables and Functions
->Beta-rec
function
Usage: (->Beta-rec alpha beta)
Positional factory function for class incanter.distributions.Beta-rec.
Source
->Binomial-rec
function
Usage: (->Binomial-rec n p)
Positional factory function for class incanter.distributions.Binomial-rec.
Source
->ChiSquare-rec
function
Usage: (->ChiSquare-rec df)
Positional factory function for class incanter.distributions.ChiSquare-rec.
Source
->Combination
function
Usage: (->Combination n k u)
Positional factory function for class incanter.distributions.Combination.
Source
function
Usage: (->DoubleUniform-rec min max)
Positional factory function for class incanter.distributions.DoubleUniform-rec.
Source
->Exponential-rec
function
Usage: (->Exponential-rec rate)
Positional factory function for class incanter.distributions.Exponential-rec.
Source
->F
function
Usage: (->F df1 df2)
Positional factory function for class incanter.distributions.F.
Source
->Gamma-rec
function
Usage: (->Gamma-rec shape rate)
Positional factory function for class incanter.distributions.Gamma-rec.
Source
->NegativeBinomial-rec
function
Usage: (->NegativeBinomial-rec size prob)
Positional factory function for class incanter.distributions.NegativeBinomial-rec.
Source
->Normal-rec
function
Usage: (->Normal-rec mean sd)
Positional factory function for class incanter.distributions.Normal-rec.
Source
->Poisson-rec
function
Usage: (->Poisson-rec lambda)
Positional factory function for class incanter.distributions.Poisson-rec.
Source
->StudentT-rec
function
Usage: (->StudentT-rec df)
Positional factory function for class incanter.distributions.StudentT-rec.
Source
function
Usage: (->UniformInt start end)
Positional factory function for class incanter.distributions.UniformInt.
Source
beta-distribution
function
Usage: (beta-distribution)
(beta-distribution alpha beta)
Returns a Beta distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
alpha (default 1)
beta (default 1)
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Beta.html
http://en.wikipedia.org/wiki/Beta_distribution
Example:
(pdf (beta-distribution 1 2) 0.5)
Source
binomial-distribution
function
Usage: (binomial-distribution)
(binomial-distribution n p)
Returns a Binomial distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
size (default 1)
prob (default 1/2)
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Binomial.html
http://en.wikipedia.org/wiki/Binomial_distribution
Example:
(pdf (binomial-distribution 20 1/4) 10)
Source
chisq-distribution
function
Usage: (chisq-distribution)
(chisq-distribution df)
Returns a Chi-square distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
df (default 1)
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/ChiSquare.html
http://en.wikipedia.org/wiki/Chi_square_distribution
Example:
(pdf (chisq-distribution 2) 5.0)
Source
combination-distribution
function
Usage: (combination-distribution n k)
Create a distribution of all the k-sized combinations of n integers.
Can be considered a multivariate distribution over k-dimensions, where
each dimension is a discrete random variable on the (0, n] range (though
these variables are decidedly non-independent).
A draw from this distribution can also be considered a sample without
replacement from any finite set, where the values in the returned
vector represent the indices of the items in the set.
Arguments:
n The number of possible items from which to select.
k The size of a sample (without replacement) to draw.
See also:
test-statistic-distribution, integer-distribution, pdf, cdf, draw, support
References:
http://en.wikipedia.org/wiki/Combination
Examples:
Source
exponential-distribution
function
Usage: (exponential-distribution)
(exponential-distribution rate)
Returns a Exponential distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
rate (default 1)
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Exponential.html
http://en.wikipedia.org/wiki/Exponential_distribution
Example:
(pdf (exponential-distribution 1/2) 2.0)
Source
f-distribution
function
Usage: (f-distribution)
(f-distribution df1 df2)
Returns a F-distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
df1 (default 1)
df2 (default 1)
See also:
Distribution, pdf, cdf, draw, support
References:
http://en.wikipedia.org/wiki/F_distribution
http://mathworld.wolfram.com/F-Distribution.html
Example:
(pdf (f-distribution 5 2) 1.0)
Source
gamma-distribution
function
Usage: (gamma-distribution)
(gamma-distribution shape rate)
Returns a Gamma distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
shape (default 1)
rate (default 1)
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Gamma.html
http://en.wikipedia.org/wiki/Gamma_distribution
Example:
(pdf (gamma-distribution 1 2) 10)
Source
integer-distribution
function
Usage: (integer-distribution)
(integer-distribution end)
(integer-distribution start end)
Create a uniform distribution over a set of integers over
the (start, end] interval. An alternative method of creating
a distribution would be to just use a sequence of integers
(e.g. (draw (range 100000))). For large sequences, like the one
in the example, using a sequence will be require realizing the
entire sequence before a draw can be taken. This less efficient than
computing random draws based on the end points of the distribution.
Arguments:
start The lowest end of the interval, such that (>= (draw d) start)
is always true. (Default 0)
end The value at the upper end of the interval, such that
(> end (draw d)) is always true. Note the strict inequality.
(Default 1)
See also:
pdf, cdf, draw, support
References:
http://en.wikipedia.org/wiki/Uniform_distribution_(discrete)
Examples:
(pdf (integer-distribution 0 10) 3) ; returns 1/10 for any value
(draw (integer-distribution -5 5))
(draw (integer-distribution (bit-shift-left 2 1000))) ; probably a very large value
Source
map->Beta-rec
function
Usage: (map->Beta-rec m#)
Factory function for class incanter.distributions.Beta-rec, taking a map of keywords to field values.
Source
map->Binomial-rec
function
Usage: (map->Binomial-rec m#)
Factory function for class incanter.distributions.Binomial-rec, taking a map of keywords to field values.
Source
map->ChiSquare-rec
function
Usage: (map->ChiSquare-rec m#)
Factory function for class incanter.distributions.ChiSquare-rec, taking a map of keywords to field values.
Source
map->Combination
function
Usage: (map->Combination m#)
Factory function for class incanter.distributions.Combination, taking a map of keywords to field values.
Source
function
Usage: (map->DoubleUniform-rec m#)
Factory function for class incanter.distributions.DoubleUniform-rec, taking a map of keywords to field values.
Source
map->Exponential-rec
function
Usage: (map->Exponential-rec m#)
Factory function for class incanter.distributions.Exponential-rec, taking a map of keywords to field values.
Source
map->F
function
Usage: (map->F m#)
Factory function for class incanter.distributions.F, taking a map of keywords to field values.
Source
map->Gamma-rec
function
Usage: (map->Gamma-rec m#)
Factory function for class incanter.distributions.Gamma-rec, taking a map of keywords to field values.
Source
map->NegativeBinomial-rec
function
Usage: (map->NegativeBinomial-rec m#)
Factory function for class incanter.distributions.NegativeBinomial-rec, taking a map of keywords to field values.
Source
map->Normal-rec
function
Usage: (map->Normal-rec m#)
Factory function for class incanter.distributions.Normal-rec, taking a map of keywords to field values.
Source
map->Poisson-rec
function
Usage: (map->Poisson-rec m#)
Factory function for class incanter.distributions.Poisson-rec, taking a map of keywords to field values.
Source
map->StudentT-rec
function
Usage: (map->StudentT-rec m#)
Factory function for class incanter.distributions.StudentT-rec, taking a map of keywords to field values.
Source
function
Usage: (map->UniformInt m#)
Factory function for class incanter.distributions.UniformInt, taking a map of keywords to field values.
Source
neg-binomial-distribution
function
Usage: (neg-binomial-distribution)
(neg-binomial-distribution size prob)
Returns a Negative binomial distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
size (default 10)
prob (default 1/2)
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/NegativeBinomial.html
http://en.wikipedia.org/wiki/Negative_binomial_distribution
Example:
(pdf (neg-binomial-distribution 20 1/2) 10)
Source
normal-distribution
function
Usage: (normal-distribution)
(normal-distribution mean sd)
Returns a Normal distribution that implements the
incanter.distributions.Distribution protocol.
Arguments:
mean The mean of the distribution. One of two parameters
that summarize the Normal distribution (default 0).
sd The standard deviation of the distribution.
The second parameter that describes the Normal (default 1).
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Normal.html
http://en.wikipedia.org/wiki/Normal_distribution
Example:
(pdf (normal-distribution -2 (sqrt 0.5)) 1.96)
Source
poisson-distribution
function
Usage: (poisson-distribution)
(poisson-distribution lambda)
Returns a Poisson distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
lambda (default 1)
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Poisson.html
http://en.wikipedia.org/wiki/Poisson_distribution
Example:
(pdf (poisson-distribution 10) 5)
Source
roulette-wheel
function
Usage: (roulette-wheel freqs)
Perform a roulette wheel selection given a list of frequencies
Source
t-distribution
function
Usage: (t-distribution)
(t-distribution df)
Returns a Student-t distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
df (default 1)
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/StudentT.html
http://en.wikipedia.org/wiki/Student-t_distribution
Example:
(pdf (t-distribution 10) 1.2)
Source
test-statistic-distribution
function
Usage: (test-statistic-distribution test-statistic n k)
Create a distribution of the test-statistic over the possible
random samples of treatment units from the possible units.
There are two methods for generating the distribution. The
first method is enumerating all possible randomizations and
performing the test statistic on each. This gives the exact
distribution, but is only feasible for small problems.
The second method uses a combination-distribution to sample
for the space of possible treatment assignments and applies
the test statistic the sampled randomizations. While the
resulting distribution is not exact, it is tractable for
larger problems.
The algorithm automatically chooses between the two methods
by computing the number of possible randomizations and
comparing it to *test-statistic-iterations*. If the exact
distribution requires fewer than *test-statistic-iterations*
the enumeration method is used. Otherwise, it draws
*test-statistic-iterations* total samples for the simulated
method.
By default, the algorithm uses parallel computation. This is
controlled by the function *test-statistic-map*, which is
bound to pmap by default. Bind it to map to use a single
thread for computation.
Arguments:
test-statistic A function that takes two vectors and summarizes
the difference between them
n The number of total units in the pool
k The number of treatment units per sample
See also:
combination-distribution, pdf, cdf, draw, support
References:
http://en.wikipedia.org/wiki/Sampling_distribution
http://en.wikipedia.org/wiki/Exact_test
http://en.wikipedia.org/wiki/Randomization_test
http://en.wikipedia.org/wiki/Lady_tasting_tea
Examples:
Source
function
Usage: (uniform-distribution)
(uniform-distribution min max)
Returns a Uniform distribution that implements the incanter.distributions.Distribution protocol.
Arguments:
min (default 0)
max (default 1)
See also:
Distribution, pdf, cdf, draw, support
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/DoubleUniform.html
http://en.wikipedia.org/wiki/Uniform_distribution
Example:
(pdf (uniform-distribution 1.0 10.0) 5)
Source