Learn R Programming

ProbitSpatial (version 1.0)

SpatialProbitFit: Fit a spatial probit model.

Description

Approximate likelihood estimation of the spatial autoregressive probit model (SAR) or spatial error probit model (SEM).

Usage

SpatialProbitFit(formula,data,W,
         DGP='SAR',method="conditional",varcov="varcov",control=list())

Arguments

formula
an object of class formula: a symbolic description of the model to be fitted.
data
the data set containing the variables of the model.
W
the spatial weight matrix of class "dgCMatrix".
DGP
the data generating process of data: SAR or SEM (Default is SAR).
method
the optimisation method: "conditional" or "full-lik" (Defaul is "conditional", see Details).
varcov
the likelihood function is computed using the variance-covariance matrix ("varcov") or the precision matrix ("precision")? Default is "varcov".
control
a list of control parameters. See Details.

Value

  • Return a structure of class SpatialProbit: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Details

The estimation is based on the approximate value of the true likelihood of spatial autoregressive (SAR) or spatial error (SEM) probit models. The DGP of the spatial autoregressive model (SAR) model is the following $$y = (I_n-\rho W)^{-1}(X\beta + \epsilon),$$ where the disturbances $\epsilon$ are iid standard normally distributed, $W$ is a sparse spatial weight matrix and $\rho$ is the spatial lag parameter. The variance of the error term is equal to $\Sigma=\sigma^2((I_n-\rho W)^{-1}((I_n-\rho W)^{-1})^{t})$. The DGP of the spatial error model (SEM) is as follows $$y = X\beta+(I_n-\rho W)^{-1}\epsilon,$$ where the disturbances $\epsilon$ are iid standard normally distributed, $W$ is a sparse spatial weight matrix and $\rho$ is the spatial error parameter. The variance of the error term is equal to $\Sigma=\sigma^2((I_n-\rho W)^{-1}((I_n-\rho W )^{-1})^{t})$.

The approximation is inspired by the Mendell-Elston approximation of the multivariante normal probabilities (see References). It makes use of the Cholesky decomposition of the variance-covariance matrix $\Sigma$.

The SpatialProbitFit command estimates the model by maximising the approximate log-likelihood. We propose two optimisation method: [object Object],[object Object] In both cases a "conditional" estimation is performed. If method="conditional", then SpatialProbitFit returns the results of this first estimation. In case method="full-lik", the function tries to improve the log-likelihood by means of a further exploration around the value of the parameters found by the conditional step. The conditional step is usually very accurate and particularly fast. The second step is more time consuming and does not always improve the results of the first step. We dissuade the user from using the full-likelihood method for sample sizes bigger than ten thousands, since the computation of the gradients is quite slow. Simulation studies reported in Martinetti and Geniaux (2015) prove that the conditional estimation is highly reliable, even if compared to the full-likelihood ones.

In order to reduce the computation time of the function SpatialProbitFit, we propose a variant of the likelihood-function estimation that uses the inverse of the variance-covariance matrix (a.k.a. precision matrix). This variant applies to both the "conditional" and the "full-lik" methods and can be invoked by setting varcov="precision". Simulation studies reported in Martinetti and Geniaux (2015) suggest that the accuracy of the results with the precision matrix are sometimes worst than the one with the true variance-covariance matrix, but the estimation time is considerably reduced.

The control argument is a list that can supply any of the following components: [object Object],[object Object],[object Object],[object Object],[object Object]

Examples

Run this code
n <- 1000
nneigh <- 3
rho <- 0.5
beta <- c(4,-2,1)
W <- generate_W(n,nneigh,seed=123)
X <- cbind(1,rnorm(n,2,2),rnorm(n,0,1))
colnames(X) <- c("intercept","X1","X2")
y <- sim_binomial_probit(W=W,X=X,beta=beta,rho=rho,model="SAR")
d <- as.data.frame(cbind(y,X))
mod <- SpatialProbitFit(y~X1+X2,d,W,
       DGP='SAR',method="conditional",varcov="varcov")

Run the code above in your browser using DataLab