Assuming is fixed, the cost function can be written, up to an additive constant, in the form

where is the value of , i.e. the ``cost'' of current data sample given the HMM state.

By defining

Equation (6.11) can be written in the form

The expression is minimised with respect to by setting where is the appropriate normalising constant [39]. This can be proved with similar reasoning as in Equation (3.13).

The cost in Equation (6.13) can thus be minimised by setting

where is the appropriate normalising constant.

The derived optimal approximation is very similar in form to the exact posterior in Equation (4.6). Therefore the point probabilities of and can be evaluated with a modified forward-backward iteration. The result is the same as in Equation (4.9) except that in the iteration, is replaced with , is replaced with and is replaced with .