Announcement

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

  • Bayesian MCMC for Spatial Econometric Marginal Effects in Mata

    Stata offers the spreg package for estimation of spatial models. In most spatial model specifications, the marginal effects are not simply the beta estimates. LeSage and Pace explain this well in chapter 2 of their book Introduction to Spatial Econometrics. The spreg package does not calculate the direct, indirect, and total effects for you. The package documentation, however, does walk you through how to get those results. There are two methods, one is tedious and not very useful. The other comes from LeSage and Pace's book in chapter 2 and involves, for the direct effect, multiplying the beta estimates divided by the sample size times the trace of a matrix. Specifically, it is

    (B/n)*trace(S)

    where S = (I - lam*W)^-1, I is the nxn identity matrix, and W is a spatial weights adjacency matrix. Lambda is the parameter estimate from the spatial lag of the dependent variable. This formula is for the direct effect, the total effect is a similar process. These results are simply obtained in Mata after running a spatial model with spreg. Unfortunately, the spreg documentation provides no illustration or discussion of obtaining estimates of the dispersion for these effects. LeSage and Pace recommend a Bayesian Markov Chain Monte Carlo approach to provide a large number of draws for the model parameters (depends on the spatial model but in my case lam, rho, beta, theta, a, and sigma^2) and subsequently obtain an estimate of the dispersion parameter for the marginal effect.

    Does anyone have any clue how to implement this in Mata? There is a user-written Mata function that can be downloaded called amcmc. This function is for adaptive Markov Chain Monte Carlo sampling from the distributions. I am attempting to see if it will work but so far no luck. Any input here is greatly appreciated. Since the spreg creators never mentioned anything about obtaining estimates of the dispersion parameters for ATI, ATDI, and indirect effects maybe it cannot be done in Mata. But if so, the above formula is of little use. Any thoughts?

  • #2
    I have come to realize that although LeSage and Pace are keen on the MCMC route, this is not feasible unless you estimate the model entirely as a Bayesian model (my bad I'm still learning). However, one can simulate the marginal effects to gain dispersion parameters. Note, that bootstrapping after spreg does not work because it will destroy the spatial weights matrix. However, Elhorst (2014) in Spatial Econometrics chapter 2 pages 24-25 show a method for simulating based on the VCV and estimated parameters. I worked up an inelegant solution and posted a challenge on stack overflow for a better program. That can be found here.

    http://stackoverflow.com/questions/3...ming-challenge

    Comment

    Working...
    X