Matteo Villa
2015-Jun-13 19:16 UTC
[R] Error in ginv(A) : 'X' must be a numeric or complex matrix
Dear all, I tried searching the archives for a problem that I encountered today, but to no avail, so here I am sending my first e-mail to the list! I am estimating a binary spatial autoregressive model via a Gibbs sampler. When I do this with a neighborhood matrix, everything goes perfectly fine, but when I switch to a distance matrix, the program stops almost immediately, and outputs the infamous (but hardly ever occurring) line: "Error in ginv(A) : 'X' must be a numeric or complex matrix" What strikes me as odd is that when I try to compute the generalized inverse myself, everything goes smoothly, and all the matrixes seem to be numeric. Below you will find the data and code for the replicable example. Data for the replicable example: https://gist.github.com/lessermatter/66b6488cfe6f5d7893bf And here is the code (the error occurs after executing the final line, which is also a toy model to be estimated through the bsar function): https://gist.github.com/lessermatter/0284be117a19620750aa Any ideas? Kind regards, Matteo Villa Universit? degli Studi di Milano Italy [[alternative HTML version deleted]]