def update_transmission_parameters(parameters, compartments_to_update):
    """
    Update parameters with transmission rates for each compartment with altered immunity/sucseptibility to infection
    """
    for compartment in compartments_to_update:
        parameters.update(
            {
                "contact_rate_"
                + compartment: parameters["contact_rate"]
                * parameters["rr_transmission_" + compartment]
            }
        )
    return parameters