Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • bayesmh - error message: "errors in model specification"

    Dear Statalisters,

    I've tried to repeat the example presented by Stata here (https://www.youtube.com/watch?v=0F0QoMCSKJ4) under a very simple data set:

    Code:
    . list
    
         +-------+
         | heads |
         |-------|
      1. |     0 |
      2. |     0 |
      3. |     1 |
      4. |     0 |
      5. |     0 |
         |-------|
      6. |     1 |
      7. |     1 |
      8. |     0 |
      9. |     0 |
     10. |     1 |
         +-------+

    What intrigued me is: whenever I perform these commands

    Code:
    . bayesmh heads, likelihood(dbernoulli({theta})) prior({theta}, beta(1,1))
    in the command window, it works fine.

    Code:
    Burn-in ...
    Simulation ...
    
    Model summary
    ------------------------------------------------------------------------------
    Likelihood:
      heads ~ bernoulli({theta})
    
    Prior:
      {theta} ~ beta(1,1)
    ------------------------------------------------------------------------------
    
    Bayesian Bernoulli model                         MCMC iterations  =     12,500
    Random-walk Metropolis-Hastings sampling         Burn-in          =      2,500
                                                     MCMC sample size =     10,000
                                                     Number of obs    =         10
                                                     Acceptance rate  =      .4823
    Log marginal likelihood = -7.8194591             Efficiency       =      .2291
     
    ------------------------------------------------------------------------------
                 |                                                Equal-tailed
                 |      Mean   Std. Dev.     MCSE     Median  [95% Cred. Interval]
    -------------+----------------------------------------------------------------
           theta |  .4187117   .1342192   .002804   .4152274   .1746616   .6876875
    ------------------------------------------------------------------------------
    I can change the alpha and beta parameters, and it still works perfectly:


    Code:
    . bayesmh heads, likelihood(dbernoulli({theta})) prior({theta}, beta(30,30))
      
    Burn-in ...
    Simulation ...
    
    Model summary
    ------------------------------------------------------------------------------
    Likelihood:
      heads ~ bernoulli({theta})
    
    Prior:
      {theta} ~ beta(30,30)
    ------------------------------------------------------------------------------
    
    Bayesian Bernoulli model                         MCMC iterations  =     12,500
    Random-walk Metropolis-Hastings sampling         Burn-in          =      2,500
                                                     MCMC sample size =     10,000
                                                     Number of obs    =         10
                                                     Acceptance rate  =      .4245
    Log marginal likelihood = -6.9942639             Efficiency       =      .2376
     
    ------------------------------------------------------------------------------
                 |                                                Equal-tailed
                 |      Mean   Std. Dev.     MCSE     Median  [95% Cred. Interval]
    -------------+----------------------------------------------------------------
           theta |  .4864921   .0591096   .001213   .4884325    .370204   .6015751
    ------------------------------------------------------------------------------
    However, if I try to use the drop-down menu, exactly as demonstrated by Chuck Huber in the tutorial, I got the message "errors in model specification" whenever clicking on "Create" to define the priors of model parameters.

    I'm using Stata 14.1 on Windows 10, and the error message (only under the point-and-click menu) persisted even after I updated the Stata today.

    I suspect it might be a bug, probably related to the menu commands.

    Thank you in advance for any help!

    Kind regards,

    Marcos
    Last edited by Marcos Almeida; 11 Jul 2016, 13:41.
    Best regards,

    Marcos

  • #2
    I have the same problem but using Mac Book Pro OS X El Capitan

    Anybody knows what to do?

    Thanks

    Comment


    • #3
      Maybe it is a bug with bayesmh or some sort of conflict inside the software, for it seems not to be related to the operating system, be it Windows or Mac.

      Let's hope StataCorp notice this and give us good news!
      Best regards,

      Marcos

      Comment


      • #4
        Dear Marcos and Daniel,

        Yes, this is a bug in the dialogue system related to bayesmh which we are going to fix at earliest possibility.

        Thank you for your patience,
        Nikolay

        Comment


        • #5
          Dear Nikolay,

          Thank you so much for the reply and the auspicious information!

          Best,

          Marcos
          Best regards,

          Marcos

          Comment


          • #6
            Thank you both

            Comment


            • #7
              Hello All, This bug has apparently re-appeared. I'm using Stata/SE 17.0 and I have exactly the same problem as Marcos in #1.

              Comment

              Working...
              X