Finding CDF of a Continuous R.V.

In summary, the conversation discussed finding the density and CDF of a function, f(x) = (1 + cx)/2 for x between -1 and 1 and f(x)=0 otherwise, where c is between -1 and 1. The CDF was found to be F(x) = (x+1)/2 + c/4(x^2 -1) for -1≤x≤1, 1 for x>1, and 0 for x<-1. The conversation also touched on finding the quartiles and median of the distribution in terms of c. It was suggested to solve the quadratic equation F(x) = p to find the 100p percentile, and the parameter c was noted
  • #1
gajohnson
73
0

Homework Statement



Let
f(x) = (1 + cx)/2 for x between -1 and 1 and f(x)=0 otherwise, where c is between -1 and 1. Show that f is a density and find the corresponding cdf. Find the quartiles and the median of the distribution in terms c.

Homework Equations



NA

The Attempt at a Solution



I simply showed that this was a density by integrating f(x) from -1 to 1 and showing that this is 1.

For the second part of the problem, I found the CDF to be F(x) = 1/2(x+(cx^2)/2) for -1≤x≤1.
Clearly, F(x) = 0 for -1<x. However, is F(x) = 1 for x>1?

In addition, I am having trouble properly interpreting the directions for finding the quartiles and median. Should my answer be a function of c? If so, how do I go about getting there? Thank you!
 
Last edited:
Physics news on Phys.org
  • #2
gajohnson said:

Homework Statement



Let
f(x) = (1 + cx)/2 for x between -1 and 1 and f(x)=0 otherwise, where c is between -1 and 1. Show that f is a density and find the corresponding cdf. Find the quartiles and the median of the distribution in terms c.

Homework Equations



NA

The Attempt at a Solution



I simply showed that this was a density by integrating f(x) from -1 to 1 and showing that this is 1.

For the second part of the problem, I found the CDF to be F(x) = 1/2(x+(cx^2)/2) for -1≤x≤1.
Clearly, F(x) = 0 for -1<x. However, is F(x) = 1 for x>1?

In addition, I am having trouble properly interpreting the directions for finding the quartiles and median. Should my answer be a function of c? If so, how do I go about getting there? Thank you!

Your CDF is wrong. For ##x<-1, F(x) = \int_{-\infty}^x 0\, dx = 0##. For ##x## bewteen -1 and 1, you should be calculating$$
F(x) = \int_{-\infty}^x f(x)\, dx =\int_{-\infty}^{-1} 0\, dx +
\int_{-1}^x \frac {1+cx} 2\, dx$$Now do you see what to do for ##x>1##?
 
Last edited:
  • #3
LCKurtz said:
Your CDF is wrong. For ##x<-1, F(x) = \int_{-\infty}^x 0\, dx = 0##. For ##x## bewteen -1 and 1, you should be calculating$$
F(x) = \int_{-\infty}^x f(x)\, dx =\int_{-\infty}^{-1} 0\, dx +
\int_{-1}^x \frac 1 2 (x + \frac{cx^2}{2})\, dx$$Now do you see what to do for ##x>1##?

Thanks for your response! Why would I be taking the integral of 1/2(x+(cx^2)/2) to find the CDF, and not the integral of (1+cx)/2, which is my density function?
 
  • #4
gajohnson said:
Thanks for your response! Why would I be taking the integral of 1/2(x+(cx^2)/2) to find the CDF, and not the integral of (1+cx)/2, which is my density function?

You shouldn't, of course. My eyes fell on the wrong function while typing. I will correct it.
 
  • #5
LCKurtz said:
You shouldn't, of course. My eyes fell on the wrong function while typing. I will correct it.

Got it. Thanks!

Do you have any suggestions on the quartiles and medians?
 
  • #6
gajohnson said:
Thanks for your response! Why would I be taking the integral of 1/2(x+(cx^2)/2) to find the CDF, and not the integral of (1+cx)/2, which is my density function?

Despite that observation, your cdf is still wrong.
[tex]F(x) = \frac{1}{2} \int_{-1}^x 1 \, dt + \frac{1}{2} \int_{-1}^x c t \, dt, \:
-1 \leq x \leq 1.[/tex] This will = 0 at x = -1 and = 1 at x = 1, no matter what is the value of c.

To get a 100p percentile, solve the quadratic equation F(x) = p.
 
  • #7
Ray Vickson said:
Despite that observation, your cdf is still wrong.
[tex]F(x) = \frac{1}{2} \int_{-1}^x 1 \, dt + \frac{1}{2} \int_{-1}^x c t \, dt, \:
-1 \leq x \leq 1.[/tex] This will = 0 at x = -1 and = 1 at x = 1, no matter what is the value of c.

To get a 100p percentile, solve the quadratic equation F(x) = p.

I am not entirely sure where my CDF is wrong or what you mean about c.
Currently my CDF is as follows:

P(X≤x) = 1/2(x+(cx^2)/2) if -1≤x≤1
0 if x < -1
1 if x > 1

1/2(x+(cx^2)/2) was found by taking exactly the integral that you described.

Do you mean instead that it should be:

P(X≤x) = 1/2(x+(cx^2)/2) if -1<x<1
0 if x ≤ -1
1 if x ≥ 1

Thank you!
 
  • #8
gajohnson said:
I am not entirely sure where my CDF is wrong or what you mean about c.
Currently my CDF is as follows:

P(X≤x) = 1/2(x+(cx^2)/2) if -1≤x≤1
0 if x < -1
1 if x > 1

1/2(x+(cx^2)/2) was found by taking exactly the integral that you described.

Do you mean instead that it should be:

P(X≤x) = 1/2(x+(cx^2)/2) if -1<x<1
0 if x ≤ -1
1 if x ≥ 1

Thank you!

Do either of the above formulas give ##\lim_{x \downarrow -1} P(X \leq x) = 0## and ##\lim_{x \uparrow 1} P(X \leq x) = 1?## Since X is continuous, these must happen.
 
  • #9
gajohnson: don't confuse integral and antiderivate. For instance, try to compute the value of your CDF


[itex]F\left ( x \right ) = \frac{1}{2}\left ( x + \frac{cx^2}{2} \right )[/itex]

for [itex]x=-1[/itex]. Is it what you expected?

The parameter [itex]c[/itex] will govern "how fast" your CDF climbs. Here is a graph of it between [itex]-1[/itex] and [itex]1[/itex], for various values of [itex]c[/itex].
 

Attachments

  • cdf.png
    cdf.png
    22.7 KB · Views: 706
  • #10
jfgobin said:
gajohnson: don't confuse integral and antiderivate. For instance, try to compute the value of your CDF


[itex]F\left ( x \right ) = \frac{1}{2}\left ( x + \frac{cx^2}{2} \right )[/itex]

for [itex]x=-1[/itex]. Is it what you expected?

The parameter [itex]c[/itex] will govern "how fast" your CDF climbs. Here is a graph of it between [itex]-1[/itex] and [itex]1[/itex], for various values of [itex]c[/itex].

Ahhhh, yes. Not sure what I was thinking there.

So, I ought to get F(x) = (x+1)/2 + c/4(x^2 -1) for -1≤x≤1
=1 for x>1
=0 for x<-1

I believe I see what you were getting it (should not have taken so long). How does that look?
 
  • #11
Looks better to me :-)
 
  • #12
jfgobin said:
Looks better to me :-)

Great, thanks for the help, everyone!
 
Last edited:

Related to Finding CDF of a Continuous R.V.

1. What is a continuous random variable?

A continuous random variable is a type of variable that can take on an infinite number of values within a given range. It is usually represented by a measurement or a quantity, such as time, weight, or height.

2. How is the cumulative distribution function (CDF) defined for a continuous random variable?

The cumulative distribution function (CDF) for a continuous random variable is a function that maps each possible value of the random variable to the probability that the variable takes on a value less than or equal to that value. It is usually denoted as F(x) and is used to determine the probability of a certain range of values occurring.

3. What is the difference between a probability density function (PDF) and a cumulative distribution function (CDF)?

A probability density function (PDF) represents the probability of a continuous random variable taking on a specific value, while a cumulative distribution function (CDF) represents the probability of the variable taking on a value less than or equal to a given value. In other words, the PDF shows the likelihood of a single value occurring, while the CDF shows the likelihood of a range of values occurring.

4. How is the CDF calculated for a continuous random variable?

The CDF for a continuous random variable is calculated by integrating the probability density function (PDF) from negative infinity to the value of interest. This integral from negative infinity to x gives the area under the curve of the PDF up to the value x. Alternatively, the CDF can also be calculated by summing up the probabilities of all values less than or equal to x.

5. Why is the CDF important in statistics and data analysis?

The CDF is important in statistics and data analysis because it allows us to determine the probability of a certain range of values occurring for a continuous random variable. This can help us make predictions and decisions based on the likelihood of certain outcomes. The CDF can also be used to calculate other important statistical measures, such as the median and quartiles.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
457
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
4K
  • Calculus and Beyond Homework Help
Replies
6
Views
397
  • Calculus and Beyond Homework Help
Replies
4
Views
864
  • Calculus and Beyond Homework Help
2
Replies
58
Views
3K
  • Calculus and Beyond Homework Help
Replies
11
Views
2K
  • Calculus and Beyond Homework Help
Replies
5
Views
373
  • Calculus and Beyond Homework Help
Replies
6
Views
770
Back
Top