Announcement

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

  • An error: amcmc_init() not found when using bayesmlogit

    Hi,

    I'm learning Bayesian approach to estimate coefficients of multinomial logit. I got the error when using the command bayesmlogit that amcmc_init() is not found. I've installed moremata and I use Stata/SE 17.0. Please check the codes below. Thank you for any help in advance!

    Codes:
    ssc install bayesmlogit
    ssc install moremata
    use http://fmwww.bc.edu/repec/bocode/t/traindata.dta, clear
    global randvars "contract local wknown tod seasonal"
    bayesmlogit y price, rand($randvars) group(gid) id(pid) draws(20000) burn(10000) thin(10) saving(beta1) replace

    Error in result:
    initialize_rand(): 3499 amcmc_init() not found
    <istmt>: - function returned error
    r(3499);

  • #2
    Is there a reason why you're not using the official Stata bayes:? According to the user's manual entry for it, it can be used with both mlogit and xtmlogit.
    Code:
    help bayes

    Comment


    • #3
      Originally posted by Joseph Coveney View Post
      Is there a reason why you're not using the official Stata bayes:? According to the user's manual entry for it, it can be used with both mlogit and xtmlogit.
      Code:
      help bayes
      Thanks for the information, Joseph! I checked the manual for the prefix bayes and it supports mlogit (multinomial logit) and many other estimations but not mixlogit (mixed multinomial logit). I realized that I should have installed amcmc and used the command bayesmixedlogit instead of bayesmlogit. The following codes work well now. (The simulation takes around 22 min.)

      Codes:
      ssc install bayesmixedlogit
      net install amcmc.pkg, from(http://fmwww.bc.edu/RePEc/bocode/a/)
      use http://fmwww.bc.edu/repec/bocode/t/traindata.dta, clear
      global randvars "contract local wknown tod seasonal"
      bayesmlogit y price, rand($randvars) group(gid) id(pid) draws(20000) burn(10000) thin(10) saving(beta1) replace
      Last edited by Xiaogeng Xu; 09 Jul 2023, 10:46.

      Comment

      Working...
      X