Description Usage Arguments Details Value Examples

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

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

`formula` |
an object of class |

`data` |
the data set containing the variables of the model. |

`W` |
the spatial weight matrix of class |

`DGP` |
the data generating process of |

`method` |
the optimisation method: |

`varcov` |
the likelihood function is computed using the
variance-covariance matrix ( |

`control` |
a list of control parameters. See 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-ρ W)^{-1}(Xβ + ε),*

where the disturbances *ε* are iid standard normally distributed,
*W* is a sparse spatial weight matrix and *ρ* is the spatial lag
parameter. The variance of the error term is equal
to *Σ=σ^2((I_n-ρ W)^{-1}((I_n-ρ W)^{-1})^{t})*.
The DGP of the spatial error model (SEM) is as follows

*y = Xβ+(I_n-ρ W)^{-1}ε,*

where the disturbances *ε* are iid standard normally distributed,
*W* is a sparse spatial weight matrix and *ρ* is the spatial
error parameter. The variance of the error term
is equal to *Σ=σ^2((I_n-ρ W)^{-1}((I_n-ρ 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 *Σ*.

The `SpatialProbitFit`

command estimates the model by maximising the
approximate log-likelihood. We propose two optimisation method:

`"conditional"`

:it relies on a standard probit estimation (we use

`speedglm`

) which applies to the model estimated conditional on*ρ*.`"full-lik"`

:it minimises the full-log-likelihood using the analytical gradient functions. The optimisation is performed by means of the

`optim`

function with`method = "BFGS"`

.

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:

`iW_CL`

the order of approximation of

*(I_n-ρ W)^{-1}*used in the`"conditional"`

method. Default is 6, while 0 means no approximation (it uses exact inversion of matrixes, not suitable for big sample sizes). See Martinetti and Geniaux (2015) for further references.`iW_FL`

the order of approximation of

*(I_n-ρ W)^{-1}*used in the computation of the likelihood function for the`"full-lik"`

method. Default is 0, meaning no approximation.`iW_FG`

the order of approximation of

*(I_n-ρ W)^{-1}*used in the computation of the gradient functions for the`"full-lik"`

method. Default is 0, meaning no approximation.`reltol`

relative convergence tolerance. It represents

`tol`

in`optimize`

function for`method="conditional"`

and`reltol`

in`optim`

function for`method="full-lik"`

. Default is 1e-5.`prune`

the pruning value used in the gradients. Default is 0, meaning no pruning. Typacl values are around 1e-3 and 1e-6. They help reducing the estimation time of the gradient functions.

Return a structure of class `SpatialProbit`

:

- beta
the estimated parameters for the covariates

- rho
the estimated spatial dependence parameter

- coeff
all estimated parameters

- loglik
the log-likelihood associated to the estimated model

- formula
same as

`formula`

- nobs
number of observations

- nvar
number of covariates or explanatory variables

- y
the vector of the dependent variable

- X
the matrix of covariates or explanatory variables

- time
estimation time

- DGP
the chosen DGP (SAR or SEM)

- method
the estimation method (see Details)

- varcov
the matrix used in the approximation (see Details)

- W
the spatial weight matrix

- iW_CL
the order of approximation used in the conditional method

- iW_FL
the order of approximation used in the likelihood function for the

`full-lik`

method- iW_FG
the order of approximation used in the gradient functions for the

`full-lik`

method- reltol
the relative convergence tolerance

- prune
the pruning used in the gradient functions

- env
an

`environment`

containing information for use in later function calls to save time- message
a integer giving any additional information or NULL.

1 2 3 4 5 6 7 8 9 10 11 | ```
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")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.