Decomposition for stochastic dynamic systems