Announcement

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

  • Cauchy prior in Bayesian regression models

    Hi everyone, I'm trying to get to grips with the Bayesian regression models in Stata 14. Most Bayesian analysis in my field uses a specific combination of priors which I'm trying to replicate.

    For the prior distribution they use a Jeffrey's prior for the variance (which should be no problem in Stata) but also a Cauchy(1) distribution for the effect size.

    Page 78 of the Stata Bayesian regression handbook shows how to specify the Jeffreys prior:

    bayesmh mpg, likelihood(normal({var})) prior({mpg:_cons}, flat) prior({var}, jeffreys)

    But I'm stuck on the Cauchy distribution, as it isn't in the set of pre-defined prior distributions.

    Thanks!

  • #2
    From the [BAYESMH] manual, page 65:

    For example, suppose we want to specify a Cauchy distribution with location a and scale b. We
    can specify the expression for the observation-level likelihood function in the llf() option within
    likelihood().
    . bayesmh y, likelihood(llf(ln({b})-ln({b}^2+(y-{a})^2)-ln(_pi))) noconstant : : :
    It is fortunate that despite its reputation for being a "pathological" distribution, writing the density of the Cauchy distribution is simplicity itself!

    To use this as a prior instead of a likelihood, you would use the same expression (with x instead of y) in the -prior(density())- option.

    Comment


    • #3
      Helo dear,
      A query: if I have 4 return variables: x1 x2 x3 x4, how can you declare this "bayesmh command" that you very well exemplifies for prior of Cauchy?
      Thanks

      Comment

      Working...
      X