Learn R Programming

spatialprobit (version 0.9-8)

sar_eigs: compute the eigenvalues for the spatial weight matrix W

Description

compute the eigenvalues $\lambda$ for the spatial weight matrix $W$ and lower and upper bound for parameter $\rho$.

Usage

sar_eigs(eflag, W)

Arguments

eflag
if eflag==1, then eigen values
W
spatial weight matrix

Value

  • function returns a list of
  • rminminimum value for $\rho$. if eflag==1, then $1/\lambda_{min}$ , else -1
  • rmaxmaximum value for $\rho$. Always 1.
  • timeexecution time

Examples

Run this code
set.seed(123)
# sparse matrix representation for spatial weight matrix W (d x d) 
# and m nearest neighbors
d <- 100
m <- 6
W <- sparseMatrix(i=rep(1:d, each=m), 
  j=replicate(d, sample(x=1:d, size=m, replace=FALSE)), x=1/m, dims=c(d, d))
sar_eigs(eflag=1, W)

Run the code above in your browser using DataLab