############ # Blatt 10 # ############ #aufgabe 4 #b p<-c(0.10, 0.25, 0.50, 0.75, 0.90) bed_wsk<-function(p, x){ return(exp(-0.015 * x) * p / (exp(-0.015 * x) * p + exp(-0.02 * x) * (1-p))) } plot(0, 0, type = "n", ylim = c(0,1), xlim = c(0,1500), xlab = "Meter", ylab = "Wahrscheinlichkeit") for(i in 1:5){ lines(seq(0,1500, 0.01), bed_wsk(p[i], seq(0,1500,0.01)), type = "l", col = i) } legend(800, 0.4, p, col =1:5, pch =19) #aufgabe 5 gumb<-function(x) exp(-exp(-x)) frech<-function(x) exp(-(1+0.05 * x)^(-20)) plot(gumb, ylim = c(0.85,1), xlim = c(2,20), ylab = "Dichte") lines(seq(2,20, 0.01), frech(seq(2,20, 0.01)), type = "l", col = "blue") plot(seq(2,20, 0.01), gumb(seq(2,20, 0.01))-frech(seq(2,20, 0.01)), type = "l",xlab ="x", ylab = "Differenz") seq(2, 20, 0.01)[gumb(seq(2,20, 0.01))-frech(seq(2,20, 0.01)) == max(gumb(seq(2,20, 0.01))-frech(seq(2,20, 0.01)))]