clip_01_02

Load Julia packages (libraries) needed

using StatisticalRethinking
gr(size=(600,300))
Plots.GRBackend()

snippet 2.1

ways  = [0, 3, 8, 9, 0]
5-element Array{Int64,1}:
 0
 3
 8
 9
 0
ways/sum(ways)
5-element Array{Float64,1}:
 0.0
 0.15
 0.4
 0.45
 0.0

snippet 2.2

Create a distribution with n = 9 (e.g. tosses) and p = 0.5.

d = Binomial(9, 0.5)
Binomial{Float64}(n=9, p=0.5)

Probability density for 6 waters holding n = 9 and p = 0.5.

pdf(d, 6)
0.1640625000000001

This page was generated using Literate.jl.