Skip to contents

SpatialPanelMl: maximum likelihood spatial lag, error and Durbin panel models with individual, time or two-way fixed effects, or pooled (Elhorst), with the optional Lee-Yu variance correction. SpatialPanelReLag: random-effects spatial lag model (Elhorst 2003). InformationCriteria: AIC, AICc and BIC. Rows are stacked by period. Identical to the Python arm morie.fn.sppanel.

Usage

SpatialPanelMl(
  y,
  X,
  W,
  n_units,
  model = "lag",
  effects = "individual",
  lee_yu = FALSE,
  interval = c(-0.99, 0.99)
)

SpatialPanelReLag(
  y,
  X,
  W,
  n_units,
  interval = c(-0.99, 0.99),
  tol = 1e-10,
  maxit = 500
)

InformationCriteria(loglik, k, n)

Arguments

y

Response.

X

Regressor matrix (no intercept).

W

Spatial weights (N by N).

n_units

Number of units N.

model

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

effects

"individual", "time", "twoways" or "pooled".

lee_yu

Apply the Lee-Yu variance correction.

interval

Search interval of the spatial parameter.

tol, maxit

Convergence controls.

loglik

Log-likelihood.

k

Number of parameters.

n

Number of observations.

Value

A list.

References

Elhorst, J. P. (2003). Specification and estimation of spatial panel data models. International Regional Science Review 26, 244-268.

Lee, L.-F. and Yu, J. (2010). Estimation of spatial autoregressive panel data models with fixed effects. Journal of Econometrics 154, 165-185.

Examples

InformationCriteria(-120.5, 4, 100)$bic
#> [1] 259.4207