Some statistics memo written in math, Haskell, and Maxima.
-
Mathematical Statistics with Applications (7th Edition) (Wackerly, Mendenhall, Scheaffer)
The following function:
f k = V.length . V.filter (\x -> (av-k*sd)<x && x< (av+k*sd)) $ samples
counts the number of element within k-sigma (k=1,2,3 ..), where samples is a vector of numerical data.
- non-negative definite
- normalized
- sum. rule (for mutually disjoint events)
P(A|B) := P(A ∩ B)/P(B), if P(B)>0, where the right hand side is read "probability of A given B."
Two events A and B are independent iff:
- P(A|B) = P(A)
- P(B|A) = P(B)
- P(A ∩ B) = P(A)P(B)
For a discrete distribution, use
probability :: d -> Int -> Double
Statistics.Distribution.Hypergeometric
hypergeometric
:: Int -- m = r in the text, the number of red
-> Int -- l = N of the total population
-> Int -- k = n of the sample size
-> HypergeometricDistribution
cumulative
h -- :: HypergeometricDistribution
x -- :: y = x of a random variable
A powerful simplification can be provided by loading:
load(simplify_sum)$
Discrete Distribution | Examples and Theorems |
---|---|
Binomial | ex3_21.hs |
Geometric | ex3_11.hs theo3_8.mac |
Hypergeometric | ex3_16.hs ex3_10.mac (ex3_10.pdf) ex3_17.hs |
Poisson | theo3_11.mac ex3_18.mac ex3_20.hs ex3_21.hs ex3_23.mac ex3_24.mac |
Negative binomial | theo3_9.mac (no .hs code) |
Continuous Distribution | TBA |
---|---|
Uniform | |
Normal | |
Gamma | |
Beta |