From 57175dbf3472fc3a12b23b39010f779c40cb40b2 Mon Sep 17 00:00:00 2001 From: aaaakshat <33050725+aaaakshat@users.noreply.github.com> Date: Thu, 21 Oct 2021 12:06:24 -0400 Subject: [PATCH] Add pdf/cdf of a urv --- ch04.r | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 ch04.r diff --git a/ch04.r b/ch04.r new file mode 100644 index 0000000..c0ee293 --- /dev/null +++ b/ch04.r @@ -0,0 +1,12 @@ +# Chapter 4.3 (Cumulative Distribution Function) + +## CDF of a Gaussian mixture + +# R code to generate the PDF and CDF +x = seq(-5, 10, (15)/1500) +f = dunif(x, -3, 4) +F = punif(x, -3, 4) +plot(x, f, type="n") +lines(x, f, lwd=5) +plot(x, F, type="n") +lines(x, F, lwd=5)