SLIDE 48 Visualising a probability density function
Given some sample data, useful to plot a pdf. This can be done by binning data and plotting a histogram. Divide range [a, b] for possible values of X into N bins. Count mi, the number of times X lies in ri = [a + i(b−a)
N
, a + (i+1)(b−a)
N
). Plot mi vs x Care must be taken choosing bin-size; too big, structure will be lost, too small, fluctuations will add features.
Visualising the exponential distribution - 10,000 samples
2 4 6 8 10
x
1
pX(x) 10 bins in range 0 to 10
2 4 6 8 10
x
1
pX(x) 100 bins in range 0 to 10
2 4 6 8 10
x
1
pX(x) 1000 bins in range 0 to 10
Slides by Mike Peardon (2011) minor modifs. by S. Sint (TCD) MAU22S06 - Data analysis Hilary T erm 2019 44 / 96