In [27]:

```
# I was greatly inspired by StatsWithJuliaBook
# https://statisticswithjulia.org/index.html
using StatsPlots, LaTeXStrings, Measures, LinearAlgebra, Distributions, Random, StatsBase
```

The vertical lines are the means

In [18]:

```
lambda, N = 1/3, 10^5
bulbs = [0.4,1,2]
xGrid = 0:0.1:10
C = [:blue :red :green]
dists = [Gamma(n,2) for n in bulbs]
L = [ "α = "*string.(shape.(i))*", β = "*
string.(round.(scale.(i),digits=2)) for i in dists ]
p=plot(xGrid, [pdf.(i,xGrid) for i in dists], c=C, label=reshape(L, 1,:))
[vline!(p,[mean(dists[i])], c=C[i], label=:none, ls=:dash) for i in 1:3]
p
```

Out[18]:

In [23]:

```
N = 10000
support = -4:0.1:4
a = 1.5
X = rand(Normal(0,1), N)
f(x,a) = abs(x)>a ? x : -x
Y = f.(X,a)
plot(x->pdf(Normal(0,1),x),support, label="pdf Normal(0,1)")
histogram!(X, label = "X", alpha = 0.5, norm = :pdf)
histogram!(Y, label = "Y", alpha = 0.5, norm = :pdf)
```

Out[23]:

In [24]:

```
# support = -4:0.1:4
p1 = scatter(X,Y,xlabel = "X", ylabel= "Y", label = :none)
p2 = histogram2d(X,Y,xlabel = "X", ylabel= "Y")
plot(p1, p2, size = (1000,600))
```

Out[24]: