balance_fh_th_conserve_24hr#

caf.mat.direction.od_to_pa.balance_fh_th_conserve_24hr(fh, th)[source]#

Balance fh and th to each other, conserving the 24hr total.

This method calculates the average total value for fh and th, then factors both to match this across all time periods. This means the sum of the returned values for fh and th matches the sum for the inputs.

Parameters:
  • fh (From home matrices by time period. The index should be a multiindex of o)

  • d (and)

  • periods (and the columns should be the time)

  • th (To home matrices, same format as fh)

Return type:

fh and th balanced