This function computes the contribution of spatially lagged X variables based on
provided coefficients. The function takes the spatially lagged variables (wx, see make_wx())
and multiplies them by their corresponding regression coefficients (gamma), returning
the predicted influence of the spatial lags. Only spatial lags are considered;
the original X variables are not included in this calculation.
Examples
grid <- make_square_grid(5)
listw <- spdep::nb2listw(spdep::poly2nb(grid))
x <- make_x(25, c(0,1), c(1,4))
wx <- make_wx(x, listw)
gamma <- c(1.75, 0.4)
make_wxg(wx, gamma) 
#>  [1] 4.128413 4.034193 4.551843 4.820518 5.919594 3.596112 4.575163 4.515919
#>  [9] 5.550536 4.770773 4.200564 4.677603 4.975429 5.660185 5.755570 4.756337
#> [17] 5.194738 5.884477 6.207445 6.179575 4.405995 4.000445 5.343971 5.981874
#> [25] 5.364768