inference for state space models