Obtaining a marginal PDF from a condtional PDF











up vote
0
down vote

favorite












I was given that that $f_{X|Y}(x|y=1)=lambda_1e^{-lambda_1 x}$ for $xgeq 0$ and $f_{X|Y}(x|y=-1)=lambda_2e^{lambda_2 x}$ for $xleq 0$. $X$ is continuous. $Y$ is discrete and can only take on those two values, $1$ and $-1$, with probability $p$ and $1-p$ respectively. $lambda_1$ and $lambda_2$ are positive values. I am trying to get the marginal PDF, $f_x(x)$ for when $xgt 0$ and for when $xlt 0 $.



I got $f_x(x)$ = $sum_{y}P(Y)f_{X|Y}(x|y) = plambda_1e^{-lambda_1 x} +(1-p)lambda_2e^{lambda_2 x}$, but after this , I am not sure how to interpret it for $xgt 0$ and $xlt 0 $. If I plot $f_{X|Y}(x|1)=lambda_1e^{-lambda_1 x}$ for $xgeq 0$, $f_{X|Y}(x|-1)=lambda_2e^{lambda_2 x}$ for $xleq 0$, and $lambda_1e^{-lambda_1 x} +lambda_2e^{lambda_2 x}$ on the same graph, I obtain the following:
plot for a fixed $lambda$, but even visualizing it doesn't help me understand it any better.










share|cite|improve this question


























    up vote
    0
    down vote

    favorite












    I was given that that $f_{X|Y}(x|y=1)=lambda_1e^{-lambda_1 x}$ for $xgeq 0$ and $f_{X|Y}(x|y=-1)=lambda_2e^{lambda_2 x}$ for $xleq 0$. $X$ is continuous. $Y$ is discrete and can only take on those two values, $1$ and $-1$, with probability $p$ and $1-p$ respectively. $lambda_1$ and $lambda_2$ are positive values. I am trying to get the marginal PDF, $f_x(x)$ for when $xgt 0$ and for when $xlt 0 $.



    I got $f_x(x)$ = $sum_{y}P(Y)f_{X|Y}(x|y) = plambda_1e^{-lambda_1 x} +(1-p)lambda_2e^{lambda_2 x}$, but after this , I am not sure how to interpret it for $xgt 0$ and $xlt 0 $. If I plot $f_{X|Y}(x|1)=lambda_1e^{-lambda_1 x}$ for $xgeq 0$, $f_{X|Y}(x|-1)=lambda_2e^{lambda_2 x}$ for $xleq 0$, and $lambda_1e^{-lambda_1 x} +lambda_2e^{lambda_2 x}$ on the same graph, I obtain the following:
    plot for a fixed $lambda$, but even visualizing it doesn't help me understand it any better.










    share|cite|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I was given that that $f_{X|Y}(x|y=1)=lambda_1e^{-lambda_1 x}$ for $xgeq 0$ and $f_{X|Y}(x|y=-1)=lambda_2e^{lambda_2 x}$ for $xleq 0$. $X$ is continuous. $Y$ is discrete and can only take on those two values, $1$ and $-1$, with probability $p$ and $1-p$ respectively. $lambda_1$ and $lambda_2$ are positive values. I am trying to get the marginal PDF, $f_x(x)$ for when $xgt 0$ and for when $xlt 0 $.



      I got $f_x(x)$ = $sum_{y}P(Y)f_{X|Y}(x|y) = plambda_1e^{-lambda_1 x} +(1-p)lambda_2e^{lambda_2 x}$, but after this , I am not sure how to interpret it for $xgt 0$ and $xlt 0 $. If I plot $f_{X|Y}(x|1)=lambda_1e^{-lambda_1 x}$ for $xgeq 0$, $f_{X|Y}(x|-1)=lambda_2e^{lambda_2 x}$ for $xleq 0$, and $lambda_1e^{-lambda_1 x} +lambda_2e^{lambda_2 x}$ on the same graph, I obtain the following:
      plot for a fixed $lambda$, but even visualizing it doesn't help me understand it any better.










      share|cite|improve this question













      I was given that that $f_{X|Y}(x|y=1)=lambda_1e^{-lambda_1 x}$ for $xgeq 0$ and $f_{X|Y}(x|y=-1)=lambda_2e^{lambda_2 x}$ for $xleq 0$. $X$ is continuous. $Y$ is discrete and can only take on those two values, $1$ and $-1$, with probability $p$ and $1-p$ respectively. $lambda_1$ and $lambda_2$ are positive values. I am trying to get the marginal PDF, $f_x(x)$ for when $xgt 0$ and for when $xlt 0 $.



      I got $f_x(x)$ = $sum_{y}P(Y)f_{X|Y}(x|y) = plambda_1e^{-lambda_1 x} +(1-p)lambda_2e^{lambda_2 x}$, but after this , I am not sure how to interpret it for $xgt 0$ and $xlt 0 $. If I plot $f_{X|Y}(x|1)=lambda_1e^{-lambda_1 x}$ for $xgeq 0$, $f_{X|Y}(x|-1)=lambda_2e^{lambda_2 x}$ for $xleq 0$, and $lambda_1e^{-lambda_1 x} +lambda_2e^{lambda_2 x}$ on the same graph, I obtain the following:
      plot for a fixed $lambda$, but even visualizing it doesn't help me understand it any better.







      probability exponential-function conditional-probability






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Nov 18 at 10:55









      ChocolateChip

      33




      33






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          To better keep track of the conditional statements you can rewrite the conditional densities as functions over $mathbb{R}$ using indicator functions, so
          $$
          f_{X|Y}(x|y=1) = lambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0}, qquad f_{X|Y}(x|y=-1)=lambda_2e^{lambda_2 x}mathbb{1}_{x < 0},
          $$

          we haven't added any new information, but it might help to keep track of everything. So now when you carry out your marginalisation you have
          $$
          begin{align}
          f_X(x) &= sum_{y in {-1, 1}} f_Y(y)f_{X|Y}(x|y) \
          &= plambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0} + (1-p)lambda_2 e^{lambda_2 x}mathbb{1}_{x < 0},
          end{align}
          $$

          again nothing new, but hopefully now it should be just a little clearer how to interpret it, so you could also rewrite the density as
          $$
          f_X(x) =
          begin{cases}
          plambda_1 e^{-lambda_1 x} & x geq 0 \
          (1-p)lambda_2 e^{lambda_2 x} & mbox{otherwise}.
          end{cases}
          $$



          So on the sets ${ x < 0 }$ and ${ x > 0 }$ you are going to have a graph that looks like the density function of an exponential random variable weighted by the probabilities $p$ or $(1-p)$ and you will have a discontinuity at $0$.



          A good thing to do next for your own understanding is to probably rewrite the density function in terms of the absolute value of $x$, $| x |$, and see if you can realise the Laplace distribution as a special case of this setup.






          share|cite|improve this answer





















            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "69"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3003393%2fobtaining-a-marginal-pdf-from-a-condtional-pdf%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            To better keep track of the conditional statements you can rewrite the conditional densities as functions over $mathbb{R}$ using indicator functions, so
            $$
            f_{X|Y}(x|y=1) = lambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0}, qquad f_{X|Y}(x|y=-1)=lambda_2e^{lambda_2 x}mathbb{1}_{x < 0},
            $$

            we haven't added any new information, but it might help to keep track of everything. So now when you carry out your marginalisation you have
            $$
            begin{align}
            f_X(x) &= sum_{y in {-1, 1}} f_Y(y)f_{X|Y}(x|y) \
            &= plambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0} + (1-p)lambda_2 e^{lambda_2 x}mathbb{1}_{x < 0},
            end{align}
            $$

            again nothing new, but hopefully now it should be just a little clearer how to interpret it, so you could also rewrite the density as
            $$
            f_X(x) =
            begin{cases}
            plambda_1 e^{-lambda_1 x} & x geq 0 \
            (1-p)lambda_2 e^{lambda_2 x} & mbox{otherwise}.
            end{cases}
            $$



            So on the sets ${ x < 0 }$ and ${ x > 0 }$ you are going to have a graph that looks like the density function of an exponential random variable weighted by the probabilities $p$ or $(1-p)$ and you will have a discontinuity at $0$.



            A good thing to do next for your own understanding is to probably rewrite the density function in terms of the absolute value of $x$, $| x |$, and see if you can realise the Laplace distribution as a special case of this setup.






            share|cite|improve this answer

























              up vote
              1
              down vote



              accepted










              To better keep track of the conditional statements you can rewrite the conditional densities as functions over $mathbb{R}$ using indicator functions, so
              $$
              f_{X|Y}(x|y=1) = lambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0}, qquad f_{X|Y}(x|y=-1)=lambda_2e^{lambda_2 x}mathbb{1}_{x < 0},
              $$

              we haven't added any new information, but it might help to keep track of everything. So now when you carry out your marginalisation you have
              $$
              begin{align}
              f_X(x) &= sum_{y in {-1, 1}} f_Y(y)f_{X|Y}(x|y) \
              &= plambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0} + (1-p)lambda_2 e^{lambda_2 x}mathbb{1}_{x < 0},
              end{align}
              $$

              again nothing new, but hopefully now it should be just a little clearer how to interpret it, so you could also rewrite the density as
              $$
              f_X(x) =
              begin{cases}
              plambda_1 e^{-lambda_1 x} & x geq 0 \
              (1-p)lambda_2 e^{lambda_2 x} & mbox{otherwise}.
              end{cases}
              $$



              So on the sets ${ x < 0 }$ and ${ x > 0 }$ you are going to have a graph that looks like the density function of an exponential random variable weighted by the probabilities $p$ or $(1-p)$ and you will have a discontinuity at $0$.



              A good thing to do next for your own understanding is to probably rewrite the density function in terms of the absolute value of $x$, $| x |$, and see if you can realise the Laplace distribution as a special case of this setup.






              share|cite|improve this answer























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                To better keep track of the conditional statements you can rewrite the conditional densities as functions over $mathbb{R}$ using indicator functions, so
                $$
                f_{X|Y}(x|y=1) = lambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0}, qquad f_{X|Y}(x|y=-1)=lambda_2e^{lambda_2 x}mathbb{1}_{x < 0},
                $$

                we haven't added any new information, but it might help to keep track of everything. So now when you carry out your marginalisation you have
                $$
                begin{align}
                f_X(x) &= sum_{y in {-1, 1}} f_Y(y)f_{X|Y}(x|y) \
                &= plambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0} + (1-p)lambda_2 e^{lambda_2 x}mathbb{1}_{x < 0},
                end{align}
                $$

                again nothing new, but hopefully now it should be just a little clearer how to interpret it, so you could also rewrite the density as
                $$
                f_X(x) =
                begin{cases}
                plambda_1 e^{-lambda_1 x} & x geq 0 \
                (1-p)lambda_2 e^{lambda_2 x} & mbox{otherwise}.
                end{cases}
                $$



                So on the sets ${ x < 0 }$ and ${ x > 0 }$ you are going to have a graph that looks like the density function of an exponential random variable weighted by the probabilities $p$ or $(1-p)$ and you will have a discontinuity at $0$.



                A good thing to do next for your own understanding is to probably rewrite the density function in terms of the absolute value of $x$, $| x |$, and see if you can realise the Laplace distribution as a special case of this setup.






                share|cite|improve this answer












                To better keep track of the conditional statements you can rewrite the conditional densities as functions over $mathbb{R}$ using indicator functions, so
                $$
                f_{X|Y}(x|y=1) = lambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0}, qquad f_{X|Y}(x|y=-1)=lambda_2e^{lambda_2 x}mathbb{1}_{x < 0},
                $$

                we haven't added any new information, but it might help to keep track of everything. So now when you carry out your marginalisation you have
                $$
                begin{align}
                f_X(x) &= sum_{y in {-1, 1}} f_Y(y)f_{X|Y}(x|y) \
                &= plambda_1e^{-lambda_1 x}mathbb{1}_{x geq 0} + (1-p)lambda_2 e^{lambda_2 x}mathbb{1}_{x < 0},
                end{align}
                $$

                again nothing new, but hopefully now it should be just a little clearer how to interpret it, so you could also rewrite the density as
                $$
                f_X(x) =
                begin{cases}
                plambda_1 e^{-lambda_1 x} & x geq 0 \
                (1-p)lambda_2 e^{lambda_2 x} & mbox{otherwise}.
                end{cases}
                $$



                So on the sets ${ x < 0 }$ and ${ x > 0 }$ you are going to have a graph that looks like the density function of an exponential random variable weighted by the probabilities $p$ or $(1-p)$ and you will have a discontinuity at $0$.



                A good thing to do next for your own understanding is to probably rewrite the density function in terms of the absolute value of $x$, $| x |$, and see if you can realise the Laplace distribution as a special case of this setup.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Nov 18 at 12:55









                Nadiels

                2,350413




                2,350413






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Mathematics Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3003393%2fobtaining-a-marginal-pdf-from-a-condtional-pdf%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?