XIV Statistics and Probability

plt;pdf;cdf
hist;ecdf;kde
Graphs of cdf, pdf/pmf, ecdf, epdf/KDE, and histograms
plt;n(0,1);pdf || plt;epn(2);pdf || plt;f(3,6);pdf || plt;epn(2);cdf || plt;gam(3,2);cdf || plt;poi(10);hist || plt;t(20);hist || plt;n(0.5,1.5);hist ||
n;t;f;epn
uni;gam;bet
cau;chi
Common continuous distributions
n(a, b)—Normal(a, b) with mean=a and std=b || t(n)—Student-t with df=n || uni(q,b)—Uniform(a, b) || epn(λ)—Exponential(λ) || gam(a, b)—Gamma(a, b) || bet(a,b)—Beta(a, b) || cau(a, b)—Cauchy(a, b) || chi(n)—Chi-squared(n) || f(m, n)—F-distribution with df1=m, df2=n ||
stt;t(5);pdf(x) || stt;cau(0,1);pdf(x) || stt;epn(3);cdf(x) || stt;uni(0,1);E(x) || stt;f(5,8);pdf(x) || stt;gam(2,6);V(z) || stt;n(0,1);P(x>0|x<2) ||
poi;ber;bin
nbn;geo;hyp
die
Common discrete distributions
poi(λ)—Poisson(λ) || ber(p)—Bernoulli(p) || bin(n, p)—Binomial(n, p) || nbn(n, p)—Negative Binomial(n, p) || geo(p)—Geometric(p) || hyp(N,K,n)—Hypergeometric(N, K, n) || die(n)—Die(n) || stt;poi(5);m || stt;bin(5,0.5);v || stt;hyp(10,5,7);rvs || stt;nbn(6,0.4);rvs || stt;geo(0.5);m || stt;die(6);P(x<3|x>1) ||
m;v;s;k;q;h
cdf;pdf;svf;P
std;med;isf
M;rvs;ecdf
probabilities, mean, variance/std, moments/MGF, cdf/svf/isf, pdf/pmf, quantiles/percentiles, skewness, kurtosis, entropy, median
m—mean || std—standard deviation || v—variance || cdf—cumulative density function || pdf—probability density (mass) function || svf—survive function || isf—inverse survive function || q—quantile || h—entropy || s—skewness || k—kurtosis || rvs—simulate random variables || M—moments || med—median
stt;epn(2.5);m || stt;t(11);cdf(2) || stt;f(3,5);pdf(x) || stt;uni(1,3);v || stt;poi(5);E(x) || stt;epn(2.1);svf(1) || stt;n(0,1);q(0.025) || stt;bin(5,0.5);v || stt;poi(10);std || stt;t(7);med || stt;n(0,1);s || stt;n(0,1);M(3) || plt;nbn(14,0.6);ecdf;34 || stt;n(0,1);P(x>-1.65&x<1.65) || stt;bin(20,0.5);P(x>10|x>3) || stt;epn(0.5);P(x>1|x<3)
mni;mnm;cov
crv;drv;dmc
cmc;ppr;gpr
wpr;rvs
Multivariate distributions, user-defined distributions, and stochastic processes
cov—covariance || crv—continuous r.v. || drv—discrete r.v. || dmc—discrete Markov chain || cmc—continuous Markov chain || mni(n, p1, p2, ..., pn)—multinomial(n, (p1, p2, ..., pn)) || mnm(μ, Σ)—multivariate normal N(μ, Σ) || stt;crv(3*x**2,0,1);E(x) || stt;drv((1,2,3),(0.2,0.3,0.5));cdf(x) || stt;mni(3,0.2,0.3,0.5);cov || stt;mni(10,0.2,0.3,0.2,0.3);rvs(20) || stt;mnm([3,4],[[2,1],[1,2]]);rvs(20) || stt;gam(2,4);V(x) || stt;chi(6);E(x) || stt;n(0,1);E(exp(t)) || stt;drv((1,2,3,4),(0.2,0.3,0.25,0.25));rvs(50) || stt;cmc((0,1,2),[[-1,1/10,9/10],[2/5,-1,3/5],[1/2,1/2,-1]]);P(x(43.2)>0|x(3.29),2) || stt;dmc((0,1,2),[[0.5,0.2,0.3],[0.2,0.5,0.3],[0.2,0.3,0.5]]);P(x[10]>0|x[2]>0) || stt;dmc((0,1,2),[[5/10,3/10,2/10],[2/10,7/10,1/10],[3/10,3/10,4/10]]);E(x[3]|x[1],1) || stt;dmc((0,1,2),[[0.5,0.2,0.3],[0.2,0.5,0.3],[0.2,0.3,0.5]]);rvs(50);(0,1,0) || stt;cmc((0,1,2),[[-1,1/10,9/10],[2/5,-1,3/5],[1/2,1/2,-1]]);P(x(1.57)<=x(3.14)|x(1.22),1) || stt;dat([[0,2],[1,1],[2,0]]);cov ||
E;P;V;H
pdf;cdf;std
Symbolic computing
E(X)—expectation || V(X)—variance || P(X>a|X< b)—conditional probability || pdf(X)—probability density (mass) function ||
cdf(X)—cumulative density function || H(X)—entropy || stt;crv(x**2/9,0,3);E(2*x+1) || stt;drv((1,2,3),(1/5,2/5,2/5));V(2*x) || stt;gam(2,4);V(x) || stt;chi(6);E(x) || stt;n(0,1);E(exp(t)) || stt;epn(2);E(x^3) || stt;chi(5);E(x^2) || stt;epn(4);H(x) || stt;n(0,1);E(exp(I*w*x));x ||
dat Data analysis: descriptive statistics, hypothesis testing, curve fitting and generalized linear models
d—descriptive statistics || z—Z scores || q—quantile or percentile || cov—covariance/correlation matrices || rp—Pearson correlation || pt—scatter plot || box—boxplot || ecdf—plot for ecdf || rs—Spearman correlation || rk—Kendall correlation || kde—Gaussian kernel density estimates || t1—one sample t-test || t2—two sample t-test || pt—paired samples test || n—normality test || ks1—Kolmogorov-Smirnov test (1s) || ks2—Kolmogorov-Smirnov test (2s) || f1—one-way ANOVA || f2—two-way ANOVA || w—Wilcoxson test || mw—Mann-Whitney test || kw—Kruskal-Wallis test || chi—chi-square test || cnt—goodness of fit test || ols—linear regression || pr—polynomial regression || glm—generalized linear model || log—log linear model || stt;dat((10,25,10,13,11,11),(15,15,15,15,15,5));chi || stt;dat((2,3,5,7,1,9,8,6),(13,15,23,24,10,25,23,18));ols || stt;dat((2,3,5,7,1,9,8,6),(13,15,23,24,10,25,23,18));ols;pr || plt;dat(-0.19,-0.01,4.35,1.71,-1.37,-0.93,-1.11,-2.47);pt || plt;dat((-0.19,-0.01,4.35,1.71,-1.37,-0.93,-1.11,-2.47),(13.19,15.01,18.65,22.29,11.37,25.93, 24.11,20.47));pt || stt;dat((8.8,6.4,7.1,5.1,6.7,6.7,9.9,9.4,9.9,9.5,8.7,10.9),(0,0,0,0,0,0,1,1,1,1,1,1));glm;b || stt;dat((1,1,1,1,0,0,0,0),(0,1,0,1,0,1,0,1),(0,1,0,1,0,1,0,1),(56,80,48,133,63,98,47,97));log || stt;poi(9);rvs(30);d || stt;dat(14,4,7,11,5,8,8,8,6,12,12,7,8,12,9);d || stt;dat(14,4,7,11,5,8,8,8,6,12,12,7,8,12,9);z ||