Log in

View Full Version : Cumulative distribution


powerpuff_gal
Dec 18, 2010, 01:41 AM
f(y)={c(2-y), 0<y<1
{3c , 1<y<2
{0 , otherwise


find the cumulative distribution function F(y)



I really stuck on this question!! I hope any expert can help me!thanks a lot

jcaron2
Dec 18, 2010, 08:48 AM
The cumulative distribution function (CDF) at any point is just the total area under the curve (i.e. the integral) of the probability density function (PDF) to the left of that point.

A good easy-to-visualize analogy for this is as follows: Pretend that you're standing on a road, and you're going to go for a walk. Now look at the plot of the PDF and pretend it's actually a plot of how fast you'll be walking as a function of time. The CDF is then just a plot of how far you've walked as a function of time. If you walk at a constant speed of 2 mph, for example, then after 1 hour of walking you will travel a total of 2 miles. If you then slowed down to 1 mph and walked for an additional hour, you'd travel 1 additional mile, for a total of 3 miles. If you were to plot your progress as a function of time (i.e. the CDF), you would have started at (0,0) (since at the beginning of the walk when t=0 you hadn't actually gotten anywhere yet) and ended up at 2 miles after 1 hour (1,2) with a straight line between those two points (which has a slope of 2, since you were traveling 2 mph). Then, at the end of the second hour (t = 2), you'd have reached the 3 mile point. Your plot of progress would correspondingly have a straight line between (1,2) and (2,3) (which has a slope of 1 mph). If you decided at that point that you'd had enough exercise, and you ended your walk, your total distance traveled would stop increasing. It would just stay stuck at 3 for ever.

So getting back to PDFs and CDFs, to find the CDF at any point, you just need to integrate the PDF over the entire interval to the left of that point. If you want to know the value of the CDF at y=1.5, for example, you need to find the integral of the PDF from -infinity to 1.5.

In your specific example, the horizontal axis is y (as opposed to t in my walking analogy above), and the PDF is 0 for all y<0. That means your definite integral doesn't need to start all the way back at -infinity. You can just calculate the definite integral starting from y=0.

Unlike the walking analogy, there's one other property of PDFs and CDFs that you can use check your work or to calculate the value of an unknown variable (like c in your question). The integral from -infinity to +infinity of the PDF is always 1. Correspondingly, the CDF will always, therefore, have a value of 1 when you get to +infinity (or, in this specific example, by the time you get to y=2, since everything to the right of that has 0 probability).

I don't have a pen and paper with me, but if I did it correctly in my head, I think you should find that c has a value of 2/9 in your problem.

powerpuff_gal
Dec 20, 2010, 02:36 AM
Err... err... err actually I wish to see the solution but anywhere thanks for your comment!thank you!

jcaron2
Dec 20, 2010, 09:44 AM
Okay, so we have the following:

f(y)=0 \; \left | \; y<0
f(y)=c(2-y) \; \left | \; 0<y<1
f(y)=3c \; \left | \; 1<y<2
f(y)=0 \; \left | \; y>2

So to find the CDF as a function of y, we just integrate f(\hat{y}) from -infty to y. Notice that I replaced the y with a \hat{y} in the PDF. It's the same thing; it just makes sure we don't confuse the variable over which we're integrating (\hat{y}) with the value at the upper limit of the definite integral (y).

F(y)=\int_{-\infty}^y{f(\hat{y})\,d\hat{y}}

So for all y < 0, we have

F(y)=\int_{-\infty}^y{0 \; d\hat{y}} \; = 0 \; \left | \; y<0.

Then, from 0 to 1 we have
F(y)=\int_{-\infty}^0{0 \; d\hat{y}} \; + \; \int_{0}^y{c(2-\hat{y}) \;\; d\hat{y}}
= \; 0 \; + \; c\left (2y-\frac{y^2}{2} \right ) \; - \; c\left (2\cdot 0-\frac{0^2}{2} \right )
= \; 2y-\frac{y^2}{2} \; \left | \; 0<y<1 [\math].

From 1 to 2 we then have
[math] F(y)=\int_{-\infty}^0{0 \; d\hat{y}} \; + \; \int_{0}^1{c(2-\hat{y}) \;\; d\hat{y}} \; + \; \int_{1}^y{3c \;\; d\hat{y}}
= \; 0\; + \; c\left (2\cdot 1-\frac{1^2}{2} \right ) \; - \; c\left (2\cdot 0-\frac{0^2}{2} \right ) \;+\; 3c \cdot y \; - \; 3c \cdot 1
= \; c\left (3y-\frac{3}{2} \right ) \; \left | \; 1<y<2

And finally after 2 we have
[math] F(y)=\int_{-\infty}^0{0 \; d\hat{y}} \; + \; \int_{0}^1{c(2-\hat{y}) \;\; d\hat{y}} \; + \; \int_{1}^2{3c \;\; d\hat{y}} \; + \; \int_2^{y}{0 \; d\hat{y}}
= \; 0\; + \; c\left (2\cdot 1-\frac{1^2}{2} \right ) \; - \; c\left (2\cdot 0-\frac{0^2}{2} \right ) \;+\; 3c \cdot 2 \; - \; 3c \cdot 1 \; + \; 0
= \; c\left (\frac{9}{2} \right ) \; \left | \; y>2

Since we know that F(y) is always 1 when y=\infty, we can solve for c.
c\left (\frac{9}{2} \right ) \; = \; 1
c \; = \; \frac{2}{9}

jcaron2
Dec 20, 2010, 09:47 AM
Have i mentioned how annoying it is that you can't preview or edit your post? Sorry about the "[math]" lines buried in there that didn't format correctly. I screwed up the construct in a few places.