The State Space Formulation of Active Inference