TU Wien:Statistik und Wahrscheinlichkeitstheorie UE (Bura)/Übungen 2019W/5.7

From VoWi
Jump to navigation Jump to search
N(0, 1)-distribution and neighborhoods
(a) Plot the density of the N(0, 1) distribution.
(b) Which quantiles of N(0, 1) mark the neighborhoods of zero that contain first 95%, second 99% and third 99.9% of the probability mass? Which values do they take?
(c) Add these neighborhoods to your plot.

Hint: plot(), qnorm()

Lösungsvorschlag von Ikaly[edit]

a)

x=seq(-3,3,0.01)
y=dnorm(x, 0, 1)
plot(x, y)

b)

q_95 = qnorm(0.95,0,1)
q_99 = qnorm(0.99,0,1)
q_999 = qnorm(0.999,0,1)
q_95
q_99
q_999

c)

abline(v=c(q_95, q_99, q_999), col=c("blue", "red", "green"))

legend("topleft", legend=c("95%", "99%", "99.9%"), col=c("blue", "red", "green"), lty=1:3, cex=0.8)