Skip to content

Latest commit

 

History

History
106 lines (93 loc) · 10 KB

stats-cheatsheet.rst

File metadata and controls

106 lines (93 loc) · 10 KB

Distributions cheatsheet

Inspired by page 114 of Hansen's: https://www.ssc.wisc.edu/~bhansen/probability/Probability.pdf

CDF

  Julia MATLAB Base R STATA
N(0,1)
cdf(Normal(0,1),x)
normcdf(x)
pnorm(x)
normal(x)
χ²(r)
cdf(Chisq(r),x)
chi2cdf(x,r)
pchisq(x,r)
chi2(r,x)
t(r)
cdf(TDist(r),x)
tcdf(x,r)
pt(x,r)
1-ttail(r,x)
F(r,k)
cdf(FDist(r,k),x)
fcdf(x,r,k)
pf(x,r,k)
F(r,k,x)
         
D(θ)
cdf(D(θ),x)
Dcdf(x,θ)
pD(x,θ)
?

Inverse Probabilities (quantiles)

  Julia MATLAB Base R STATA
N(0,1)
quantile(Normal(0,1),p)
norminv(p)
qnorm(p)
invnormal(p)
χ²(r)
quantile(Chisq(r),p)
chi2inv(x,r)
qchisq(p,r)
invchi2(r,p)
t(r)
quantile(TDist(r),p)
tinv(x,r)
qt(p,r)
invttail(r,1-p)
F(r,k)
quantile(FDist(r,k),p)
finv(x,r,k)
qf(p,r,k)
invF(r,k,p)
         
D(θ)
quantile(D(θ),p)
Dinv(p,θ)
qD(p,θ)
invD(p,θ)

General syntax in Julia:

D(θ)
property(D(θ),x)
cdf(D(θ),x)
quantile(D(θ),p)
mean(D(θ))
Julia R
pdf(Normal(μ,σ),x) dnorm(x,μ,σ)
pdf(Truncated(Normal(μ,σ),0,1),x)
google for a package
...

dtrunc(x, spec="norm", a=0, b=1, mean=μ, sd=σ)

MixtureModel([Normal(μ1,σ1), Normal(μ2,σ2)],[1/2,1/2])
google for a package
pdf(BetaBinomial(n,α,β),x)
google for a package