curve(dslash, col = "blue", ylab = "f(x)", -5, 5, ylim = c(0, 0.4),
main = "Standard slash, normal and Cauchy densities", lwd = 2)
curve(dnorm, col = "black", lty = 2, lwd = 2, add = TRUE)
curve(dcauchy, col = "orange", lty = 3, lwd = 2, add = TRUE)
legend(x = 2, y = 0.3, c("slash", "normal", "Cauchy"), lty = 1:3,
col = c("blue","black","orange"), lwd = 2)
curve(pslash, col = "blue", -5, 5, ylim = 0:1)
Run the code above in your browser using DataLab