 This inference task is usually called "smoothing".The algorithm makes use of the principle of dynamic programming to efficiently compute the values that are required to obtain the posterior marginal distributions in two passes.The first pass goes forward in time while the second goes backward in time; hence the name "forward–backward algorithm".