-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zero.policy= in listw2dgCMatrix #17
Comments
Hi Roger: sorry for the delay in my response. From what I recall, when I wrote listw2dgCMatrix() I was having issues with Na's. In fact, the help of listw2dgCMatrix() make reference to lagsarlm() in spatialreg pakage. From the help in lagsarlm(): zero.policy | default NULL, use global option value; if TRUE assign zero to the lagged value of zones without neighbours, if FALSE (default) assign NA - causing lagsarlm() to terminate with an error I think I was applying the same logic in listw2dgCMatrix(). Does this make sense? |
I also posted to R-sig-geo: https://stat.ethz.ch/pipermail/r-sig-geo/2023-November/029353.html and subsequent, and https://stat.ethz.ch/pipermail/r-sig-geo/2023-November/029356.html. I'm working through |
Yes, I would probably try to involve more people from r-spatial in the discussion. |
Also, should I wait before making any changes to listw2dgCMatrix()? |
Yes, please wait until upstream stabilises. |
Thanks for including me! Quick heads up: there's a typo in the reprex: |
@gpiras
listw2dgCMatrix
insphet
andsplm
seems to do the same asas(, "CsparseMatrix")
inspatialreg
. The apparent difference is thatlistw2dgCMatrix
takes azero.policy
argument, but:M1a <- listw2dgCMatrix(lw1, zero.policy=FALSE)
fails with:The only other difference is in
listw2dgCMatrix
not providing row or column names.I'm thinking of adding an attribute recording whether a
listw
object was created withzero.policy
TRUE
orFALSE
, but in this case I don't see what thezero.policy
argument does inlistw2dgCMatrix
over and above the coercion - which implicitly assumeszero.policy
is TRUE because the alternative is full rows and columns of NAs for observations without neighbours. This is part of trying to tidy up interfaces between the SE packages.The text was updated successfully, but these errors were encountered: