chainopy.markov_switching¶
Classes
MarkovSwitchingModel estimates 1D target values given the current regime. |
- class chainopy.markov_switching.MarkovSwitchingModel[source]¶
MarkovSwitchingModel estimates 1D target values given the current regime. The regimes follow a first-order Markov process.
- evaluate(ts_test, ts_pred)[source]¶
Evaluates the accuracy of the model using the mean squared error metric.
- Parameters:
ts_test (ndarray) – Real target values of the Time Series
ts_pred (ndarray) – Predicted target values of the Time Series
- Returns:
float
- Return type:
mean square error between ts_test and ts_pred
- fit(ts_data, regime_sequence, lags=1)[source]¶
Trains and sets the models self.models and self._markov_chain attributes