blmpSDPD function

Bayesian log-marginal posterior probabilities for spatial panel models

Bayesian log-marginal posterior probabilities for spatial panel models

Calculates log-marginal posterior probabilities for model comparison purposes.

blmpSDPD( formula, data, W, index, model = list("ols", "slx", "sar", "sdm", "sem", "sdem"), effect = "individual", ldet = NULL, lndetspec = list(m = NULL, p = NULL, sd = NULL), dynamic = FALSE, tlaginfo = list(ind = NULL), LYtrans = FALSE, incr = NULL, rintrv = TRUE, prior = "uniform", bprarg = 1.01 )

Arguments

  • formula: a symbolic description for the model to be estimated
  • data: a data.frame
  • W: spatial weights matrix (row-normalized)
  • index: the indexes (names of the variables for the spatial and time component)
  • model: a list of models for which the Bayesian log-marginal posterior probabilities need to be calculated, list("ols","slx","sar","sdm","sem","sdem")
  • effect: type of fixed effects, c("none","individual","time","twoways"), default ="individual"
  • ldet: Type of computation of log-determinant, c("full","mc"). Default "full" for smaller problems, "mc" for large problems.
  • lndetspec: specifications for the calculation of the log-determinant
  • dynamic: logical, if TRUE time lag of the dependent variable is included. Default = FALSE
  • tlaginfo: specification for the time lag, default = list(ind=NULL), ind - i-th column in the data frame which represents the time lag
  • LYtrans: logical, default FALSE. If Lee-Yu transformation should be used for demeaning of the variables
  • incr: increment for vector of values for rho
  • rintrv: logical, default TRUE, calculates eigenvalues of W. If FALSE, the interval for rho is (-1,1).
  • prior: type of prior to be used c("uniform","beta"). Default "uniform"
  • bprarg: argument for the beta prior. Default = 1.01

Returns

A list - lmarginal: log-marginal posterior

  • probs: model probability

Details

For the Spatial Durbin Error Model (SDEM) the marginal distribution is:

p(λy)=1p(y)p(λ)Γ(a)(2π)aPT1ZZ1/2(ee)a p(\lambda|y) = \frac{1}{p(y)} p(\lambda) \Gamma(a) (2\pi)^{-a} \frac{|P|^{T-1}}{|Z'Z|^{1/2}} (e'e)^{-a}

For the Spatial Durbin Model (SDM) the marginal distribution is:

p(ρy)=1p(y)p(ρ)Γ(a)(2π)aPZZ1/2(ee)a p(\rho|y) = \frac{1}{p(y)} p(\rho) \Gamma(a) (2\pi)^{-a} \frac{|P|}{|Z'Z|^{1/2}} (e'e)^{-a}

where p(λ)p(\lambda) is prior on λ\lambda and p(ρ)p(\rho) is prior on ρ\rho, either uniform 1D\frac{1}{D}, D=1/ωmax1/ωminD = 1/\omega_{max}-1/\omega_{min} or beta prior; No priors on beta and sige; ωmax\omega_{max} and ωmin\omega_{min} are the maximum and minimum eigenvalues of W - spatial weights matrix; Z=XZ = X for lag or error model and Z=[XWX]Z = [X WX] for Durbin model; X - matrix of kk covariates.

For more details, see LeSage (2014).

Based on MatLab function log_marginal_panelprob.m.

In tlaginfo = list(ind = NULL):

ind i-th column in data which represents the time lag, if not specified then the lag from the dependent variable is created and the panel is reduced from nt to n(t-1)

Examples

## US States Production data data(Produc, package = "plm") ## Spatial weights row-normalized matrix of 48 US states data(usaww, package = "splm") isrownor(usaww) form1 <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp res1 <- blmpSDPD(formula = form1, data=Produc, W = usaww, index = c("state","year"), model = list("sar","sdm","sem","sdem"), effect = "twoways") res1 res2 <- blmpSDPD(formula = form1, data = Produc, W = usaww, index = c("state","year"), model = list("sar","sdm","sem","sdem"), effect = "twoways", dynamic = TRUE) res2

References

LeSage, J. P., & Parent, O. (2007). Bayesian model averaging for spatial econometric models. Geographical Analysis, 39(3), 241-267.

LeSage, J. P. (2014). Spatial econometric panel data model specification: A Bayesian approach. Spatial Statistics, 9, 122-145.

Author(s)

Rozeta Simonovska

  • Maintainer: Rozeta Simonovska
  • License: GPL (>= 3)
  • Last published: 2024-04-13

Useful links