Parameter estimation using method of maximum likelihood. What am I doing wrong?












1












$begingroup$


Question from Michael Baron's Probability and Statistics for Computer Scientists, 2nd edition:



Data: 3 7 5 3 2. Assume data is produced from Geometric distribution. Estimate $p$, the geometric distribution parameter. (Geometric distribution: $P(x) = (1-p)^{x-1}p$, $x=1,2,...$)



My solution, using method of maximum likelihood: Find $M = sum_{i=1}^5 ln(P(x_i))$. Then solve for $frac{dM}{dp}=0$.




  • $M = sum_{i=1}^5 ln((1-p)^{x_i - 1}p)=15ln(1-p)+ 5ln p$

  • $frac{dM}{dp}=0=frac{15}{1-p}+frac{5}{p} to p=-frac{1}{2}$


This is obviously wrong, as $p$ is a probability. I did this twice, what am I doing wrong?










share|cite|improve this question









$endgroup$

















    1












    $begingroup$


    Question from Michael Baron's Probability and Statistics for Computer Scientists, 2nd edition:



    Data: 3 7 5 3 2. Assume data is produced from Geometric distribution. Estimate $p$, the geometric distribution parameter. (Geometric distribution: $P(x) = (1-p)^{x-1}p$, $x=1,2,...$)



    My solution, using method of maximum likelihood: Find $M = sum_{i=1}^5 ln(P(x_i))$. Then solve for $frac{dM}{dp}=0$.




    • $M = sum_{i=1}^5 ln((1-p)^{x_i - 1}p)=15ln(1-p)+ 5ln p$

    • $frac{dM}{dp}=0=frac{15}{1-p}+frac{5}{p} to p=-frac{1}{2}$


    This is obviously wrong, as $p$ is a probability. I did this twice, what am I doing wrong?










    share|cite|improve this question









    $endgroup$















      1












      1








      1





      $begingroup$


      Question from Michael Baron's Probability and Statistics for Computer Scientists, 2nd edition:



      Data: 3 7 5 3 2. Assume data is produced from Geometric distribution. Estimate $p$, the geometric distribution parameter. (Geometric distribution: $P(x) = (1-p)^{x-1}p$, $x=1,2,...$)



      My solution, using method of maximum likelihood: Find $M = sum_{i=1}^5 ln(P(x_i))$. Then solve for $frac{dM}{dp}=0$.




      • $M = sum_{i=1}^5 ln((1-p)^{x_i - 1}p)=15ln(1-p)+ 5ln p$

      • $frac{dM}{dp}=0=frac{15}{1-p}+frac{5}{p} to p=-frac{1}{2}$


      This is obviously wrong, as $p$ is a probability. I did this twice, what am I doing wrong?










      share|cite|improve this question









      $endgroup$




      Question from Michael Baron's Probability and Statistics for Computer Scientists, 2nd edition:



      Data: 3 7 5 3 2. Assume data is produced from Geometric distribution. Estimate $p$, the geometric distribution parameter. (Geometric distribution: $P(x) = (1-p)^{x-1}p$, $x=1,2,...$)



      My solution, using method of maximum likelihood: Find $M = sum_{i=1}^5 ln(P(x_i))$. Then solve for $frac{dM}{dp}=0$.




      • $M = sum_{i=1}^5 ln((1-p)^{x_i - 1}p)=15ln(1-p)+ 5ln p$

      • $frac{dM}{dp}=0=frac{15}{1-p}+frac{5}{p} to p=-frac{1}{2}$


      This is obviously wrong, as $p$ is a probability. I did this twice, what am I doing wrong?







      maximum-likelihood






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Jan 8 at 9:39









      an apprenticean apprentice

      978




      978






















          2 Answers
          2






          active

          oldest

          votes


















          1












          $begingroup$

          From chain rule, when we differentiate, you miss out a negative sign.



          It is suppose to be



          $$-frac{15}{1-p}+frac5p=0$$






          share|cite|improve this answer









          $endgroup$





















            0












            $begingroup$

            You may also proceed directly:



            $$f(p)=prod_{i=1}^5P(x_i) = p^5(1-p)^{3+7+5+3+2-5}= p^5(1-p)^{15} stackrel{!}{rightarrow}mbox{Max for } p in (0,1)$$
            You get
            $$f'(p) = 0 Leftrightarrow 5(1-p)-15p = 0 Leftrightarrow boxed{p = frac{1}{4}}$$






            share|cite|improve this answer











            $endgroup$













            • $begingroup$
              Power of the $1-p$ should be 15, not 20. Is not it? So $p=1/4$.
              $endgroup$
              – an apprentice
              Jan 8 at 11:31










            • $begingroup$
              OOOps. Yes. Editing correspondingly. Thanks a lot.
              $endgroup$
              – trancelocation
              Jan 8 at 11:33











            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%2f3065976%2fparameter-estimation-using-method-of-maximum-likelihood-what-am-i-doing-wrong%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1












            $begingroup$

            From chain rule, when we differentiate, you miss out a negative sign.



            It is suppose to be



            $$-frac{15}{1-p}+frac5p=0$$






            share|cite|improve this answer









            $endgroup$


















              1












              $begingroup$

              From chain rule, when we differentiate, you miss out a negative sign.



              It is suppose to be



              $$-frac{15}{1-p}+frac5p=0$$






              share|cite|improve this answer









              $endgroup$
















                1












                1








                1





                $begingroup$

                From chain rule, when we differentiate, you miss out a negative sign.



                It is suppose to be



                $$-frac{15}{1-p}+frac5p=0$$






                share|cite|improve this answer









                $endgroup$



                From chain rule, when we differentiate, you miss out a negative sign.



                It is suppose to be



                $$-frac{15}{1-p}+frac5p=0$$







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Jan 8 at 9:44









                Siong Thye GohSiong Thye Goh

                101k1466117




                101k1466117























                    0












                    $begingroup$

                    You may also proceed directly:



                    $$f(p)=prod_{i=1}^5P(x_i) = p^5(1-p)^{3+7+5+3+2-5}= p^5(1-p)^{15} stackrel{!}{rightarrow}mbox{Max for } p in (0,1)$$
                    You get
                    $$f'(p) = 0 Leftrightarrow 5(1-p)-15p = 0 Leftrightarrow boxed{p = frac{1}{4}}$$






                    share|cite|improve this answer











                    $endgroup$













                    • $begingroup$
                      Power of the $1-p$ should be 15, not 20. Is not it? So $p=1/4$.
                      $endgroup$
                      – an apprentice
                      Jan 8 at 11:31










                    • $begingroup$
                      OOOps. Yes. Editing correspondingly. Thanks a lot.
                      $endgroup$
                      – trancelocation
                      Jan 8 at 11:33
















                    0












                    $begingroup$

                    You may also proceed directly:



                    $$f(p)=prod_{i=1}^5P(x_i) = p^5(1-p)^{3+7+5+3+2-5}= p^5(1-p)^{15} stackrel{!}{rightarrow}mbox{Max for } p in (0,1)$$
                    You get
                    $$f'(p) = 0 Leftrightarrow 5(1-p)-15p = 0 Leftrightarrow boxed{p = frac{1}{4}}$$






                    share|cite|improve this answer











                    $endgroup$













                    • $begingroup$
                      Power of the $1-p$ should be 15, not 20. Is not it? So $p=1/4$.
                      $endgroup$
                      – an apprentice
                      Jan 8 at 11:31










                    • $begingroup$
                      OOOps. Yes. Editing correspondingly. Thanks a lot.
                      $endgroup$
                      – trancelocation
                      Jan 8 at 11:33














                    0












                    0








                    0





                    $begingroup$

                    You may also proceed directly:



                    $$f(p)=prod_{i=1}^5P(x_i) = p^5(1-p)^{3+7+5+3+2-5}= p^5(1-p)^{15} stackrel{!}{rightarrow}mbox{Max for } p in (0,1)$$
                    You get
                    $$f'(p) = 0 Leftrightarrow 5(1-p)-15p = 0 Leftrightarrow boxed{p = frac{1}{4}}$$






                    share|cite|improve this answer











                    $endgroup$



                    You may also proceed directly:



                    $$f(p)=prod_{i=1}^5P(x_i) = p^5(1-p)^{3+7+5+3+2-5}= p^5(1-p)^{15} stackrel{!}{rightarrow}mbox{Max for } p in (0,1)$$
                    You get
                    $$f'(p) = 0 Leftrightarrow 5(1-p)-15p = 0 Leftrightarrow boxed{p = frac{1}{4}}$$







                    share|cite|improve this answer














                    share|cite|improve this answer



                    share|cite|improve this answer








                    edited Jan 8 at 11:34

























                    answered Jan 8 at 10:01









                    trancelocationtrancelocation

                    10.6k1722




                    10.6k1722












                    • $begingroup$
                      Power of the $1-p$ should be 15, not 20. Is not it? So $p=1/4$.
                      $endgroup$
                      – an apprentice
                      Jan 8 at 11:31










                    • $begingroup$
                      OOOps. Yes. Editing correspondingly. Thanks a lot.
                      $endgroup$
                      – trancelocation
                      Jan 8 at 11:33


















                    • $begingroup$
                      Power of the $1-p$ should be 15, not 20. Is not it? So $p=1/4$.
                      $endgroup$
                      – an apprentice
                      Jan 8 at 11:31










                    • $begingroup$
                      OOOps. Yes. Editing correspondingly. Thanks a lot.
                      $endgroup$
                      – trancelocation
                      Jan 8 at 11:33
















                    $begingroup$
                    Power of the $1-p$ should be 15, not 20. Is not it? So $p=1/4$.
                    $endgroup$
                    – an apprentice
                    Jan 8 at 11:31




                    $begingroup$
                    Power of the $1-p$ should be 15, not 20. Is not it? So $p=1/4$.
                    $endgroup$
                    – an apprentice
                    Jan 8 at 11:31












                    $begingroup$
                    OOOps. Yes. Editing correspondingly. Thanks a lot.
                    $endgroup$
                    – trancelocation
                    Jan 8 at 11:33




                    $begingroup$
                    OOOps. Yes. Editing correspondingly. Thanks a lot.
                    $endgroup$
                    – trancelocation
                    Jan 8 at 11:33


















                    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%2f3065976%2fparameter-estimation-using-method-of-maximum-likelihood-what-am-i-doing-wrong%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

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith