Smoothed probabilities

How does Dynare calculate smoothed probabilities (for example in hidden Markov chain framework)? Am I right that we should calculate P( state_1,state_2…state_n | Y_T, parameters)? If I have n states, then this distribution is discrete with k^n points (n - number of time periods, k - number of states). Am I right that Dynare doesn’t calculate explicitly this probability but uses backward recursion for simulation and then takes posterior mode?

Thank you in advance.
Best regards.

Which smoothed probabilities are you referring to?
Most objects are computed using a Kalman smoother. For a linearized DSGE model, the posterior will follow a normal distribution (note the continuous distribution). The Kalman smoother provides exact formulas for computing the mean and standard deviation, which is all that is needed to fully characterize the distribution of all endogenous objects. All you then need to do after Bayesian estimation is take a particular quantile of these objects over the different posterior parameter draws.