blmpSDPD {SDPDmod}R Documentation

Bayesian log-marginal posterior probabilities for spatial panel models

Description

Calculates log-marginal posterior probabilities for model comparison purposes.

Usage

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

Details

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

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(\rho|y) = \frac{1}{p(y)} p(\rho) \Gamma(a) (2\pi)^{-a} \frac{|P|}{|Z'Z|^{1/2}} (e'e)^{-a}

where p(\lambda) is prior on \lambda and p(\rho) is prior on \rho, either uniform \frac{1}{D}, D = 1/\omega_{max}-1/\omega_{min} or beta prior; No priors on beta and sige; \omega_{max} and \omega_{min} are the maximum and minimum eigenvalues of W - spatial weights matrix; Z = X for lag or error model and Z = [X WX] 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)

Value

A list

lmarginal

log-marginal posterior

probs

model probability

Author(s)

Rozeta Simonovska

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.

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


[Package SDPDmod version 0.0.5 Index]