Time series anomaly detection with reconstruction-based state-space models