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)=p(y)1p(λ)Γ(a)(2π)−a∣Z′Z∣1/2∣P∣T−1(e′e)−a
For the Spatial Durbin Model (SDM) the marginal distribution is:
p(ρ∣y)=p(y)1p(ρ)Γ(a)(2π)−a∣Z′Z∣1/2∣P∣(e′e)−a
where p(λ) is prior on λ and p(ρ) is prior on ρ, either uniform D1, D=1/ωmax−1/ωmin or beta prior; No priors on beta and sige; ωmax and ωmin are the maximum and minimum eigenvalues of W - spatial weights matrix; Z=X for lag or error model and Z=[XWX] for Durbin model; X - matrix of k 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 datadata(Produc, package ="plm")## Spatial weights row-normalized matrix of 48 US statesdata(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.