Generating a number belonging to N(0,1) using *m* numbers from U(0,1) using central limit theorem












1












$begingroup$


I was going through a blog which details how to generate a multivariate Gaussian vector, given a mean vector μ and co-variance matrix σ.



As a starting point, author uses generated uniform random numbers to simulate Gaussian random numbers using central limit theorem. The relevant extract from the blog is below:



Let's say you generate m uniform random numbers (each between 0 and 1) and you use the variable xi to denote each of these. The Central Limit Theorem allows us to convert these m numbers belonging to U(0,1) into a single number that belongs to the Guassian distribution N(0,1).



$$x = frac{sum_ix_i-frac{m}{2}}{sqrt{frac{m}{12}}}$$



Here, x is a one dimensional Gaussian random number - produced using the help of m uniform random variables. The $frac{m}{2}$ is derived from the term mμu (where μu is the mean of the uniform distribution - $frac{1-0}{2} = 0.5$). The denominator is derived from the term σ$sqrt{m}$ where $sigma^2$ is the variance of the uniform distribution between 0 and 1 (comes to exactly $frac{1}{12}$).



Link to the article : http://www.aishack.in/tutorials/generating-multivariate-gaussian-random/



I wanted to understand the details of the underlying math as I am not sure how central limit theorem is used to generate N(0,1) number from m U(0,1) numbers. I googled the same but was not able to find an explanation for this.










share|cite|improve this question









$endgroup$

















    1












    $begingroup$


    I was going through a blog which details how to generate a multivariate Gaussian vector, given a mean vector μ and co-variance matrix σ.



    As a starting point, author uses generated uniform random numbers to simulate Gaussian random numbers using central limit theorem. The relevant extract from the blog is below:



    Let's say you generate m uniform random numbers (each between 0 and 1) and you use the variable xi to denote each of these. The Central Limit Theorem allows us to convert these m numbers belonging to U(0,1) into a single number that belongs to the Guassian distribution N(0,1).



    $$x = frac{sum_ix_i-frac{m}{2}}{sqrt{frac{m}{12}}}$$



    Here, x is a one dimensional Gaussian random number - produced using the help of m uniform random variables. The $frac{m}{2}$ is derived from the term mμu (where μu is the mean of the uniform distribution - $frac{1-0}{2} = 0.5$). The denominator is derived from the term σ$sqrt{m}$ where $sigma^2$ is the variance of the uniform distribution between 0 and 1 (comes to exactly $frac{1}{12}$).



    Link to the article : http://www.aishack.in/tutorials/generating-multivariate-gaussian-random/



    I wanted to understand the details of the underlying math as I am not sure how central limit theorem is used to generate N(0,1) number from m U(0,1) numbers. I googled the same but was not able to find an explanation for this.










    share|cite|improve this question









    $endgroup$















      1












      1








      1





      $begingroup$


      I was going through a blog which details how to generate a multivariate Gaussian vector, given a mean vector μ and co-variance matrix σ.



      As a starting point, author uses generated uniform random numbers to simulate Gaussian random numbers using central limit theorem. The relevant extract from the blog is below:



      Let's say you generate m uniform random numbers (each between 0 and 1) and you use the variable xi to denote each of these. The Central Limit Theorem allows us to convert these m numbers belonging to U(0,1) into a single number that belongs to the Guassian distribution N(0,1).



      $$x = frac{sum_ix_i-frac{m}{2}}{sqrt{frac{m}{12}}}$$



      Here, x is a one dimensional Gaussian random number - produced using the help of m uniform random variables. The $frac{m}{2}$ is derived from the term mμu (where μu is the mean of the uniform distribution - $frac{1-0}{2} = 0.5$). The denominator is derived from the term σ$sqrt{m}$ where $sigma^2$ is the variance of the uniform distribution between 0 and 1 (comes to exactly $frac{1}{12}$).



      Link to the article : http://www.aishack.in/tutorials/generating-multivariate-gaussian-random/



      I wanted to understand the details of the underlying math as I am not sure how central limit theorem is used to generate N(0,1) number from m U(0,1) numbers. I googled the same but was not able to find an explanation for this.










      share|cite|improve this question









      $endgroup$




      I was going through a blog which details how to generate a multivariate Gaussian vector, given a mean vector μ and co-variance matrix σ.



      As a starting point, author uses generated uniform random numbers to simulate Gaussian random numbers using central limit theorem. The relevant extract from the blog is below:



      Let's say you generate m uniform random numbers (each between 0 and 1) and you use the variable xi to denote each of these. The Central Limit Theorem allows us to convert these m numbers belonging to U(0,1) into a single number that belongs to the Guassian distribution N(0,1).



      $$x = frac{sum_ix_i-frac{m}{2}}{sqrt{frac{m}{12}}}$$



      Here, x is a one dimensional Gaussian random number - produced using the help of m uniform random variables. The $frac{m}{2}$ is derived from the term mμu (where μu is the mean of the uniform distribution - $frac{1-0}{2} = 0.5$). The denominator is derived from the term σ$sqrt{m}$ where $sigma^2$ is the variance of the uniform distribution between 0 and 1 (comes to exactly $frac{1}{12}$).



      Link to the article : http://www.aishack.in/tutorials/generating-multivariate-gaussian-random/



      I wanted to understand the details of the underlying math as I am not sure how central limit theorem is used to generate N(0,1) number from m U(0,1) numbers. I googled the same but was not able to find an explanation for this.







      normal-distribution uniform-distribution central-limit-theorem






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Jan 30 at 10:04









      confused_certaintiesconfused_certainties

      82




      82






















          1 Answer
          1






          active

          oldest

          votes


















          2












          $begingroup$

          The idea is that the if there are $m$ independent random variables $X_i$ each uniformly distributed on $[0,1]$, so with mean $frac12$ and variance $frac1{12}$, then their sum $S_m$ has mean $frac{m}2$ and variance $frac{m}{12}$ while their average $frac1m S_m$ has mean $frac{1}2$ and variance $frac{1}{12m}$



          The Central Limit theorem says that $sqrt{m}left(frac1m S_m - frac{1}2right)$ converges in distribution to $mathcal Nleft(0,frac1{12}right)$, i.e. $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ converges in distribution to $mathcal N(0,1)$ as $m$ increases



          So for sufficiently large $m$, you might use $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ to generate a random variable which has a distribution close to that of a standard normal random variable






          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%2f3093331%2fgenerating-a-number-belonging-to-n0-1-using-m-numbers-from-u0-1-using-cent%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









            2












            $begingroup$

            The idea is that the if there are $m$ independent random variables $X_i$ each uniformly distributed on $[0,1]$, so with mean $frac12$ and variance $frac1{12}$, then their sum $S_m$ has mean $frac{m}2$ and variance $frac{m}{12}$ while their average $frac1m S_m$ has mean $frac{1}2$ and variance $frac{1}{12m}$



            The Central Limit theorem says that $sqrt{m}left(frac1m S_m - frac{1}2right)$ converges in distribution to $mathcal Nleft(0,frac1{12}right)$, i.e. $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ converges in distribution to $mathcal N(0,1)$ as $m$ increases



            So for sufficiently large $m$, you might use $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ to generate a random variable which has a distribution close to that of a standard normal random variable






            share|cite|improve this answer









            $endgroup$


















              2












              $begingroup$

              The idea is that the if there are $m$ independent random variables $X_i$ each uniformly distributed on $[0,1]$, so with mean $frac12$ and variance $frac1{12}$, then their sum $S_m$ has mean $frac{m}2$ and variance $frac{m}{12}$ while their average $frac1m S_m$ has mean $frac{1}2$ and variance $frac{1}{12m}$



              The Central Limit theorem says that $sqrt{m}left(frac1m S_m - frac{1}2right)$ converges in distribution to $mathcal Nleft(0,frac1{12}right)$, i.e. $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ converges in distribution to $mathcal N(0,1)$ as $m$ increases



              So for sufficiently large $m$, you might use $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ to generate a random variable which has a distribution close to that of a standard normal random variable






              share|cite|improve this answer









              $endgroup$
















                2












                2








                2





                $begingroup$

                The idea is that the if there are $m$ independent random variables $X_i$ each uniformly distributed on $[0,1]$, so with mean $frac12$ and variance $frac1{12}$, then their sum $S_m$ has mean $frac{m}2$ and variance $frac{m}{12}$ while their average $frac1m S_m$ has mean $frac{1}2$ and variance $frac{1}{12m}$



                The Central Limit theorem says that $sqrt{m}left(frac1m S_m - frac{1}2right)$ converges in distribution to $mathcal Nleft(0,frac1{12}right)$, i.e. $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ converges in distribution to $mathcal N(0,1)$ as $m$ increases



                So for sufficiently large $m$, you might use $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ to generate a random variable which has a distribution close to that of a standard normal random variable






                share|cite|improve this answer









                $endgroup$



                The idea is that the if there are $m$ independent random variables $X_i$ each uniformly distributed on $[0,1]$, so with mean $frac12$ and variance $frac1{12}$, then their sum $S_m$ has mean $frac{m}2$ and variance $frac{m}{12}$ while their average $frac1m S_m$ has mean $frac{1}2$ and variance $frac{1}{12m}$



                The Central Limit theorem says that $sqrt{m}left(frac1m S_m - frac{1}2right)$ converges in distribution to $mathcal Nleft(0,frac1{12}right)$, i.e. $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ converges in distribution to $mathcal N(0,1)$ as $m$ increases



                So for sufficiently large $m$, you might use $dfrac{ S_m - frac{m}2}{sqrt{frac{m}{12}}}$ to generate a random variable which has a distribution close to that of a standard normal random variable







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Jan 30 at 10:19









                HenryHenry

                101k482170




                101k482170






























                    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%2f3093331%2fgenerating-a-number-belonging-to-n0-1-using-m-numbers-from-u0-1-using-cent%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

                    android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                    SQL update select statement

                    WPF add header to Image with URL pettitions [duplicate]