Sensitivity analysis in HMMs with application to likelihood maximization