bayespecon.graph.origin_weights

bayespecon.graph.origin_weights(G)[source]

Build the N×N origin weight matrix \(W_o = W \otimes I_n\).

A non-zero entry at position \((i \cdot n + j,\; k \cdot n + j)\) indicates that origin k is a spatial neighbour of origin i (for flows terminating at j).

Parameters:
G

Row-standardised libpysal.graph.Graph of shape n×n.

Returns:

\(N \times N\) origin weight matrix (\(N = n^2\)).

Return type:

scipy.sparse.csr_matrix