As the probability graph of the SMNARX has a tree structure similar to Hidden Markov Models (and Hidden Markov Experts), the posterior can be computed efficiently through a slight modification of a widely adopted message passing algorithm, often referred to as forward-backward or Baum-Welch algorithm [1]},[2]}.
Specifically, two auxiliary variables are introduced to recursively perform the estimation step, namely the forward and backward variables.
By introducing a specific term for the probability of being in state \(s\)  at \(k\)  after seeing the first t observations (given the model parameters):
\(p(z_k=i, y_k,...,y_1):= \alpha _k^i\) 
