IPF for Discrete Chain Factor Graphs