Skip to contents

SarProbitGibbs, SarTobitGibbs and SarOrderedProbitGibbs: LeSage-Pace SAR probit, Tobit and ordered probit with truncated normal latent draws and griddy Gibbs for rho. SpatialBayesGibbs: Bayesian spatial lag, error and Durbin regressions with flat priors. The uniforms come from the Philox stream seed, so the draws equal the Python arm morie.fn.sarbayes.

Usage

SarProbitGibbs(
  y,
  X,
  W,
  ndraw = 1000,
  burn_in = 200,
  seed = 0,
  a1 = 1,
  a2 = 1,
  prior_var = 1e+12,
  method = "exact"
)

SarTobitGibbs(y, X, W, ndraw = 1000, burn_in = 200, seed = 0, a1 = 1, a2 = 1)

SarOrderedProbitGibbs(
  y,
  X,
  W,
  ndraw = 1000,
  burn_in = 200,
  seed = 0,
  a1 = 1,
  a2 = 1,
  prior_var = 1e+12,
  method = "exact"
)

SpatialBayesGibbs(
  y,
  X,
  W,
  model = "lag",
  ndraw = 1000,
  burn_in = 200,
  seed = 0,
  a1 = 1,
  a2 = 1
)

Arguments

y

Response (0/1, censored at 0, or categories 1 to J).

X

Design matrix with the intercept in the first column.

W

Spatial weights (n by n).

ndraw

Retained draws.

burn_in

Burn-in draws.

seed

Philox seed.

a1, a2

Beta prior on rho over (-1, 1).

prior_var

Prior variance of the probit coefficients.

method

"exact" (unit latent variance) or "lesage" (concentrated rho conditional of LeSage and Pace).

model

"lag", "error" or "durbin".

Value

A list of posterior means, standard deviations and draws.

References

LeSage, J. P. and Pace, R. K. (2009). Introduction to Spatial Econometrics. CRC Press.

Albert, J. H. and Chib, S. (1993). Bayesian analysis of binary and polychotomous response data. Journal of the American Statistical Association 88, 669-679.

Examples

W <- rbind(c(0, 1, 0, 0), c(0.5, 0, 0.5, 0), c(0, 0.5, 0, 0.5), c(0, 0, 1, 0))
X <- cbind(1, c(1, 0.5, -0.5, -1))
SpatialBayesGibbs(c(2, 1.4, 0.3, -0.5), X, W, ndraw = 50, burn_in = 10)$beta
#> [1] 0.9673918 1.3417797