Finding the CDF from a PDF with absolute value function

In summary, the absolute value function in a PDF is a mathematical function that outputs a non-negative value for any input. To find the CDF from a PDF with absolute value function, one must integrate the function over a given range, resulting in a piecewise function. The CDF is a useful tool in probability and statistics, allowing us to make predictions about the distribution of data. However, there are limitations to using the CDF from a PDF with absolute value function, such as complexity and potential discontinuities.
  • #1
TeenieBopper
29
0

Homework Statement


Find the CDF of [tex]f(x) =
|\frac{x}{4}| if -2<x<2 \\
0 otherwise
[/tex]

Homework Equations


The Attempt at a Solution



I have to integrate the pdf and to do so, I have to split it into two parts

[tex]\int_{-x}^{0}\frac{-t}{4}dt + \int_{0}{x}\frac{t}{4}dt[/tex]

integrating I get [tex]\frac{x^2}{8} + \frac{x^2}{8} = \frac{x^2}{4}[/tex]

This isn't a strictly increasing function, which is a requirement to be a CDF. So I need to break it into cases. This is where I'm running into trouble (sorry, I don't know if/how to use cases environment here).
F(x)
[tex]
0 if x < -2 \\
1-\frac{x^2}{4} if -2<x<0 \\
some equation if 0<x<2 \\
1 if x>2
[/tex]

I know that the CDF must have a value of .5 if X=0, but I'm not sure how to set up the rest of the cases so that F(0)=.5 and F(2)=1

Am I allowed to keep the two integrals from above "split"? Because if I am, then the following should work:

F(x)=
[tex]
0 x<-2 \\
\frac{1}{2} -\frac{x^2}{8} if -2<x<0 \\
\frac{1}{2} + \frac{x^2}{8} if 0<x<2 \\
1 if x > 2
[/tex]

Am I just overthinking it, or can I just use that for the CDF?
 
Last edited:
Physics news on Phys.org
  • #2
Your limits are wrong. You want
$$F(x) = \int_{-\infty}^x f(x)\,dx = P(X \le x)$$
 
  • #3
The CDF F(x) is by definition the integral of the PDF from -∞ to x. So I'm not sure what the question is asking for.

Edit: I see you've changed the problem statement. It makes more sense now.
 
Last edited:
  • #4
I changed the pdf so it should be technically correct now

vela said:
Your limits are wrong. You want
$$F(x) = \int_{-\infty}^x f(x)\,dx = P(X \le x)$$

So, because it's an absolute value function, it should be:

$$\int_{-2}^{x}\frac{-x}{4} dt + \int_{0}^{x}\frac{x}{4}dt$$? Because then I get $$F(x) = \frac{x^2}{4} - \frac{1}{2}$$ which again, isn't monotone increasing.

Ultimately, my I need to use the inversion method to generate observations from f(x), but in order to do that, I need the CDF.
 
  • #5
No, that's not correct. You need to look at different cases. It may help to sketch the PDF and the region of integration for the various cases.
 
  • #6
TeenieBopper said:
I changed the pdf so it should be technically correct now



So, because it's an absolute value function, it should be:

$$\int_{-2}^{x}\frac{-\color{red}{x}}{4} dt + \int_{0}^{x}\frac{\color{red}{x}}{4}dt$$? Because then I get $$F(x) = \frac{x^2}{4} - \frac{1}{2}$$

Those ##x##'s should be ##t##'s, and those two integrals, separately, will be part of your work. By as vela points out, you aren't setting up the problem correctly. Consider the cases ##-2<x<0## and ##0<x<2## separately when considering the integral ##\int_{-\infty}^xf(t)~dt##.
 
  • #7
It's an absolute value function, so if I graph it, it's essentially two triangles, each with a point at 0,0 and then vertical edges at x=-2 and x=2. So there's two cases, -2<x<0 and 0<x<2, that I look at seperately.

Looking at the first case, the integral is

$$\int_{-2}^{x} \frac{-t}{4} dt = \frac{t^2}{8} |_{-2}^x = \frac{x^2}{8} - \frac{1}{2}$$

But this can't be part of a CDF because it's a decreasing function on (-2, 0), which is why I thought the function for the CDF in this case was $$\frac{1}{2} - \frac{x^2}{8}$$Looking at the case 0<x<2, the integral is

$$\int_{0}^{x} \frac{t}{4}dt = \frac{t^2}{8} |_{0}^{x} = \frac{x^2}{8}$$

Now, this is increasing on (0, 2), but the value at 2 is only 1/2, which is why I thought I could add 1/2 to this case of the CDF (which is the area under the curve from the first case), making it $$\frac{1}{2} + \frac{x^2}{8}$$

This would make the complete cdf

F(x)=
0 if x<-2
$$\frac{1}{2} -\frac{x^2}{8}$$ if -2<x<0
$$\frac{1}{2} + \frac{x^2}{8}$$ if 0<x<2
1 if x > 2

I don't understand why this isn't it.
 
  • #8
What you wrote down is the CDF, you just made a couple mistakes. In calculating the CDF for the -2<x<0 part, you are integrating negative t/4, and the negative sign simply disappeared. When doing the 0<x<2 part, remember what you are calculating is
[tex] \int_{-2}^{x} f(t) dt = \int_{-2}^{0} f(t) dt + \int_{0}^{x} f(t) dt. [/tex]

You know from your previous calculation that
[tex] \int_{-2}^{0} f(t) dt = 1/2, [/tex]
and this is exactly the 1/2 that you are missing.
 
  • #9
TeenieBopper said:
I changed the pdf so it should be technically correct now



So, because it's an absolute value function, it should be:

$$\int_{-2}^{x}\frac{-x}{4} dt + \int_{0}^{x}\frac{x}{4}dt$$? Because then I get $$F(x) = \frac{x^2}{4} - \frac{1}{2}$$ which again, isn't monotone increasing.

Ultimately, my I need to use the inversion method to generate observations from f(x), but in order to do that, I need the CDF.

If you plot f(t) and recognize that F(x) = area under the f(t)-curve to the left of t=x, you can see immediately that F(x) = 0 if x < -2 and F(x) = 1 if x > +2. For -2 < x < 0, the area to the left of x is the whole area from t=-2 to t=0, minus the area from t = x to t = 0. So, if you know how to compute areas of triangles you are home free. For 0 < x < 2 you have F(x) = F(0) + area between t=0 and t=x, and that is easy, too.
 

Related to Finding the CDF from a PDF with absolute value function

1. What is the absolute value function in a PDF?

The absolute value function in a PDF (probability density function) is a mathematical function that takes the absolute value of a variable, resulting in a non-negative output. In the context of finding the CDF (cumulative distribution function) from a PDF with absolute value function, this means that the PDF values for negative inputs will be reflected and added to the corresponding positive inputs in the CDF.

2. How do you find the CDF from a PDF with absolute value function?

To find the CDF from a PDF with absolute value function, you will need to integrate the absolute value function over a given range. This will result in a piecewise function, where the CDF values for negative inputs are the absolute values of the corresponding PDF values, and the CDF values for positive inputs are the total area under the curve up to that point.

3. Can the absolute value function in a PDF ever be negative?

No, the absolute value function in a PDF can never be negative. This is because the absolute value function always outputs a non-negative value, regardless of the input value. Therefore, when finding the CDF from a PDF with absolute value function, the resulting CDF will also always be non-negative.

4. What is the significance of finding the CDF from a PDF with absolute value function?

The CDF is a useful tool in probability and statistics, as it allows us to determine the probability of a random variable being less than or equal to a given value. In the context of a PDF with absolute value function, finding the CDF allows us to better understand the distribution of the data and make predictions about the likelihood of certain outcomes.

5. Are there any limitations to using the CDF from a PDF with absolute value function?

One limitation of using the CDF from a PDF with absolute value function is that it can become quite complex and difficult to interpret, especially for more complex PDFs. Additionally, if the PDF has discontinuities, the resulting CDF may not be differentiable, which can make it more challenging to use in certain calculations.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
722
  • Calculus and Beyond Homework Help
Replies
3
Views
305
  • Calculus and Beyond Homework Help
Replies
8
Views
404
  • Calculus and Beyond Homework Help
Replies
8
Views
482
  • Calculus and Beyond Homework Help
Replies
5
Views
672
  • Calculus and Beyond Homework Help
Replies
1
Views
609
  • Calculus and Beyond Homework Help
Replies
5
Views
428
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
272
  • Calculus and Beyond Homework Help
Replies
9
Views
257
Back
Top