histogram(x[1000:end], norm=true, label=["Empirical distribution"])
xGrid = -4:0.1:4
pdfnormalDensity(z) = pdf(Normal(0,1),z)
pdf_normal=pdfnormalDensity.(xGrid)
plot!(xGrid, pdf_normal, xlims=(-4,4), label=["Normal pdf"])
Can someone explain me the code here? I understand that we are creating a normal distribution of mean 0 and standard deviation 1, and we are drawing a histogram and a normal graph of the axis from -4 to 4. However, my question is pdfnormalDensity(z) = pdf(Normal(0,1),z)
, can someone explain z and what is z doing here, and then what happens in pdfnormalDensity(z)? Thanks