annual_pa_to_od#

caf.van.lgv_model.annual_pa_to_od(matrix, col_total, row_total)[source]#

Convert annual PA matrix to OD by adding on the transpose after factoring to totals.

Simple PA to OD conversion by factoring the matrix up to the row_total and factoring the transposed matrix to the col_total, then adding the transposed to matrix. If the totals are the same then the matrices don’t need to be factored.

Parameters:
  • matrix (np.ndarray) – Square annual PA trip matrix.

  • col_total (np.ndarray) – Expected column totals.

  • row_total (np.ndarray) – Expected row totals.

Returns:

Matrix after conversion to OD.

Return type:

np.ndarray