balance_fh_th_by_op#
- caf.mat.direction.od_to_pa.balance_fh_th_by_op(fh, th, tps, seed_val)[source]#
Balance fh and th, conserving all but the final time period.
fh and th are balanced to match each other at the 24hr level. Only the final time period is altered in either fh or th, so the others remain identical. In this method the returned values for fh and th sum to greater than the input overall.
- 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)
tps (Sequence of ints. These must match fh and th column names.)
seed_val (float) – This is a scaler for ho much op will be increased by in balancing.
- Return type:
fh and th balanced to one another