Create random variable Expo from Unif(0,1)












0












$begingroup$



Working through some problems from Introduction to Probability (Blitzstein)



Let U~Unif(0,1). Using U, construct X~Expo($lambda$).




My work:
(edited with updates on CDF and inverse function)




  • PDF of X is $lambda e^{-lambda x}$ by definition of exponential
    distribution


  • CDF is therefore $1-e^{-lambda x}$


  • Use Universality of the Uniform: find inverse function for F


  • $F^{-1}(x) = frac{ln(1-x)}{-lambda}$



( $y=1-e^{-lambda x} -> 1-y = e^{-lambda x}) -> x = frac{ln(1-y)}{-lambda} $)




  • $F^{-1}(U) = frac{ln(1-U)}{-lambda}$


I am pretty confused by the process of getting a random variable from a Uniform distribution. Any help?










share|cite|improve this question











$endgroup$












  • $begingroup$
    Your CDF and your $F^{-1}$ are incorrect. Please revise your work with much more care.
    $endgroup$
    – Did
    Dec 2 '18 at 16:41










  • $begingroup$
    A very big red flag should be the fact that you're getting negative values for the CDF!
    $endgroup$
    – Boshu
    Dec 2 '18 at 17:18
















0












$begingroup$



Working through some problems from Introduction to Probability (Blitzstein)



Let U~Unif(0,1). Using U, construct X~Expo($lambda$).




My work:
(edited with updates on CDF and inverse function)




  • PDF of X is $lambda e^{-lambda x}$ by definition of exponential
    distribution


  • CDF is therefore $1-e^{-lambda x}$


  • Use Universality of the Uniform: find inverse function for F


  • $F^{-1}(x) = frac{ln(1-x)}{-lambda}$



( $y=1-e^{-lambda x} -> 1-y = e^{-lambda x}) -> x = frac{ln(1-y)}{-lambda} $)




  • $F^{-1}(U) = frac{ln(1-U)}{-lambda}$


I am pretty confused by the process of getting a random variable from a Uniform distribution. Any help?










share|cite|improve this question











$endgroup$












  • $begingroup$
    Your CDF and your $F^{-1}$ are incorrect. Please revise your work with much more care.
    $endgroup$
    – Did
    Dec 2 '18 at 16:41










  • $begingroup$
    A very big red flag should be the fact that you're getting negative values for the CDF!
    $endgroup$
    – Boshu
    Dec 2 '18 at 17:18














0












0








0


1



$begingroup$



Working through some problems from Introduction to Probability (Blitzstein)



Let U~Unif(0,1). Using U, construct X~Expo($lambda$).




My work:
(edited with updates on CDF and inverse function)




  • PDF of X is $lambda e^{-lambda x}$ by definition of exponential
    distribution


  • CDF is therefore $1-e^{-lambda x}$


  • Use Universality of the Uniform: find inverse function for F


  • $F^{-1}(x) = frac{ln(1-x)}{-lambda}$



( $y=1-e^{-lambda x} -> 1-y = e^{-lambda x}) -> x = frac{ln(1-y)}{-lambda} $)




  • $F^{-1}(U) = frac{ln(1-U)}{-lambda}$


I am pretty confused by the process of getting a random variable from a Uniform distribution. Any help?










share|cite|improve this question











$endgroup$





Working through some problems from Introduction to Probability (Blitzstein)



Let U~Unif(0,1). Using U, construct X~Expo($lambda$).




My work:
(edited with updates on CDF and inverse function)




  • PDF of X is $lambda e^{-lambda x}$ by definition of exponential
    distribution


  • CDF is therefore $1-e^{-lambda x}$


  • Use Universality of the Uniform: find inverse function for F


  • $F^{-1}(x) = frac{ln(1-x)}{-lambda}$



( $y=1-e^{-lambda x} -> 1-y = e^{-lambda x}) -> x = frac{ln(1-y)}{-lambda} $)




  • $F^{-1}(U) = frac{ln(1-U)}{-lambda}$


I am pretty confused by the process of getting a random variable from a Uniform distribution. Any help?







random-variables uniform-distribution






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 3 '18 at 11:43







user603569

















asked Dec 2 '18 at 16:31









user603569user603569

728




728












  • $begingroup$
    Your CDF and your $F^{-1}$ are incorrect. Please revise your work with much more care.
    $endgroup$
    – Did
    Dec 2 '18 at 16:41










  • $begingroup$
    A very big red flag should be the fact that you're getting negative values for the CDF!
    $endgroup$
    – Boshu
    Dec 2 '18 at 17:18


















  • $begingroup$
    Your CDF and your $F^{-1}$ are incorrect. Please revise your work with much more care.
    $endgroup$
    – Did
    Dec 2 '18 at 16:41










  • $begingroup$
    A very big red flag should be the fact that you're getting negative values for the CDF!
    $endgroup$
    – Boshu
    Dec 2 '18 at 17:18
















$begingroup$
Your CDF and your $F^{-1}$ are incorrect. Please revise your work with much more care.
$endgroup$
– Did
Dec 2 '18 at 16:41




$begingroup$
Your CDF and your $F^{-1}$ are incorrect. Please revise your work with much more care.
$endgroup$
– Did
Dec 2 '18 at 16:41












$begingroup$
A very big red flag should be the fact that you're getting negative values for the CDF!
$endgroup$
– Boshu
Dec 2 '18 at 17:18




$begingroup$
A very big red flag should be the fact that you're getting negative values for the CDF!
$endgroup$
– Boshu
Dec 2 '18 at 17:18










1 Answer
1






active

oldest

votes


















0












$begingroup$

So there's a mistake in your CDF as has been pointed out (hint: you need to add something) and I'll leave it to you to correct subsequent errors. If you want to know why this method works, then consider the fact that the CDF is a mapping of the support on the interval $[0,1]$. Therefore, if you have a random variable $Usimtext{Unif}[0,1]$, then the random variable $Z=F^{-1}_X(U)$ has the distribution $F_X$. So what you're doing is essentially this: you have the graph of the CDF of your distribution of interest. You pick a number $xin[0,1]$ and you see where the CDF attains this value. This is your simulated random variable, and your $x$ is generated by the uniform distribution.






share|cite|improve this answer









$endgroup$













    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',
    autoActivateHeartbeat: false,
    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%2f3022846%2fcreate-random-variable-expo-from-unif0-1%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









    0












    $begingroup$

    So there's a mistake in your CDF as has been pointed out (hint: you need to add something) and I'll leave it to you to correct subsequent errors. If you want to know why this method works, then consider the fact that the CDF is a mapping of the support on the interval $[0,1]$. Therefore, if you have a random variable $Usimtext{Unif}[0,1]$, then the random variable $Z=F^{-1}_X(U)$ has the distribution $F_X$. So what you're doing is essentially this: you have the graph of the CDF of your distribution of interest. You pick a number $xin[0,1]$ and you see where the CDF attains this value. This is your simulated random variable, and your $x$ is generated by the uniform distribution.






    share|cite|improve this answer









    $endgroup$


















      0












      $begingroup$

      So there's a mistake in your CDF as has been pointed out (hint: you need to add something) and I'll leave it to you to correct subsequent errors. If you want to know why this method works, then consider the fact that the CDF is a mapping of the support on the interval $[0,1]$. Therefore, if you have a random variable $Usimtext{Unif}[0,1]$, then the random variable $Z=F^{-1}_X(U)$ has the distribution $F_X$. So what you're doing is essentially this: you have the graph of the CDF of your distribution of interest. You pick a number $xin[0,1]$ and you see where the CDF attains this value. This is your simulated random variable, and your $x$ is generated by the uniform distribution.






      share|cite|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        So there's a mistake in your CDF as has been pointed out (hint: you need to add something) and I'll leave it to you to correct subsequent errors. If you want to know why this method works, then consider the fact that the CDF is a mapping of the support on the interval $[0,1]$. Therefore, if you have a random variable $Usimtext{Unif}[0,1]$, then the random variable $Z=F^{-1}_X(U)$ has the distribution $F_X$. So what you're doing is essentially this: you have the graph of the CDF of your distribution of interest. You pick a number $xin[0,1]$ and you see where the CDF attains this value. This is your simulated random variable, and your $x$ is generated by the uniform distribution.






        share|cite|improve this answer









        $endgroup$



        So there's a mistake in your CDF as has been pointed out (hint: you need to add something) and I'll leave it to you to correct subsequent errors. If you want to know why this method works, then consider the fact that the CDF is a mapping of the support on the interval $[0,1]$. Therefore, if you have a random variable $Usimtext{Unif}[0,1]$, then the random variable $Z=F^{-1}_X(U)$ has the distribution $F_X$. So what you're doing is essentially this: you have the graph of the CDF of your distribution of interest. You pick a number $xin[0,1]$ and you see where the CDF attains this value. This is your simulated random variable, and your $x$ is generated by the uniform distribution.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Dec 2 '18 at 17:09









        BoshuBoshu

        705315




        705315






























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3022846%2fcreate-random-variable-expo-from-unif0-1%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

            Plaza Victoria

            Puebla de Zaragoza

            Musa