invIrM                 package:spdep                 R Documentation

_C_o_m_p_u_t_e _S_A_R _g_e_n_e_r_a_t_i_n_g _o_p_e_r_a_t_o_r

_D_e_s_c_r_i_p_t_i_o_n:

     Computes the matrix used for generating simultaneous
     autoregressive random variables, for a given value of rho, a
     neighbours list object, a chosen coding scheme style, and
     optionally a list of general weights corresponding to neighbours.

_U_s_a_g_e:

     invIrM(neighbours, rho, glist=NULL, style="W")
     invIrW(listw, rho)

_A_r_g_u_m_e_n_t_s:

neighbours: an object of class 'nb'

     rho: autoregressive parameter

   glist: list of general weights corresponding to neighbours

   style: 'style' can take values W, B, C, and S

   listw: a 'listw' object from for example 'nb2listw'

_D_e_t_a_i_l_s:

     The function generates the full weights matrix V, checks that rho
     lies in its feasible range between 1/min(eigen(V)) and
     1/max(eigen(V)), and returns the nxn inverted matrix 

                           (I - rho V)^{-1}

_V_a_l_u_e:

     An nxn matrix with a "call" attribute.

_A_u_t_h_o_r(_s):

     Roger Bivand Roger.Bivand@nhh.no

_R_e_f_e_r_e_n_c_e_s:

     Tiefelsdorf, M., Griffith, D. A., Boots, B. 1999 A
     variance-stabilizing coding scheme for spatial link matrices,
     Environment and Planning A, 31, pp. 165-180; Tiefelsdorf, M. 2000
     Modelling spatial processes, Lecture notes in earth sciences,
     Springer, p. 76; Haining, R. 1990 Spatial data analysis in the
     social and environmental sciences, Cambridge University Press, p.
     117; Cliff, A. D., Ord, J. K. 1981 Spatial processes, Pion, p.
     152.

_S_e_e _A_l_s_o:

     'nb2listw'

_E_x_a_m_p_l_e_s:

     nb7rt <- cell2nb(7, 7, torus=TRUE)
     x <- matrix(rnorm(500*length(nb7rt)), nrow=length(nb7rt))
     res0 <- apply(invIrM(nb7rt, rho=0.0) %*% x, 2, function(x) var(x)/length(x))
     res2 <- apply(invIrM(nb7rt, rho=0.2) %*% x, 2, function(x) var(x)/length(x))
     res4 <- apply(invIrM(nb7rt, rho=0.4) %*% x, 2, function(x) var(x)/length(x))
     res6 <- apply(invIrM(nb7rt, rho=0.6) %*% x, 2, function(x) var(x)/length(x))
     res8 <- apply(invIrM(nb7rt, rho=0.8) %*% x, 2, function(x) var(x)/length(x))
     res9 <- apply(invIrM(nb7rt, rho=0.9) %*% x, 2, function(x) var(x)/length(x))
     plot(density(res9), col="red", xlim=c(-0.01, max(density(res9)$x)),
       ylim=range(density(res0)$y),
       xlab="estimated variance of the mean",
       main=expression(paste("Effects of spatial autocorrelation for different ",
         rho, " values")))
     lines(density(res0), col="black")
     lines(density(res2), col="brown")
     lines(density(res4), col="green")
     lines(density(res6), col="orange")
     lines(density(res8), col="pink")
     legend(c(-0.02, 0.01), c(7, 25), legend=c("0.0", "0.2", "0.4", "0.6", "0.8", "0.9"), col=c("black", "brown", "green", "orange", "pink", "red"), lty=1, bty="n")

