class statsmodels.tsa.regime_switching.markov_regression.MarkovRegression(endog, k_regimes, trend='c', exog=None, order=0, exog_tvtp=None, switching_trend=True, switching_exog=True, switching_variance=False, dates=None, freq=None, missing='none')
[source]
First-order k-regime Markov switching regression model
Parameters: |
|
---|
This model is new and API stability is not guaranteed, although changes will be made in a backwards compatible way if possible.
The model can be written as:
i.e. the model is a dynamic linear regression where the coefficients and the variance of the error term may be switching across regimes.
The trend
is accomodated by prepending columns to the exog
array. Thus if trend=’c’
, the passed exog
array should not already have a column of ones.
Kim, Chang-Jin, and Charles R. Nelson. 1999. “State-Space Models with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications”. MIT Press Books. The MIT Press.
filter (params[, transformed, cov_type, …]) | Apply the Hamilton filter |
fit ([start_params, transformed, cov_type, …]) | Fits the model by maximum likelihood via Hamilton filter. |
from_formula (formula, data[, subset, drop_cols]) | Create a Model from a formula and dataframe. |
hessian (params[, transformed]) | Hessian matrix of the likelihood function, evaluated at the given parameters |
information (params) | Fisher information matrix of model |
initial_probabilities (params[, …]) | Retrieve initial probabilities |
initialize () | Initialize (possibly re-initialize) a Model instance. |
initialize_known (probabilities[, tol]) | Set initialization of regime probabilities to use known values |
initialize_steady_state () | Set initialization of regime probabilities to be steady-state values |
loglike (params[, transformed]) | Loglikelihood evaluation |
loglikeobs (params[, transformed]) | Loglikelihood evaluation for each period |
predict (params[, start, end, probabilities, …]) | In-sample prediction and out-of-sample forecasting |
predict_conditional (params) | In-sample prediction, conditional on the current regime |
regime_transition_matrix (params[, exog_tvtp]) | Construct the left-stochastic transition matrix |
score (params[, transformed]) | Compute the score function at params. |
score_obs (params[, transformed]) | Compute the score per observation, evaluated at params |
smooth (params[, transformed, cov_type, …]) | Apply the Kim smoother and Hamilton filter |
transform_params (unconstrained) | Transform unconstrained parameters used by the optimizer to constrained parameters used in likelihood evaluation |
untransform_params (constrained) | Transform constrained parameters used in likelihood evaluation to unconstrained parameters used by the optimizer |
endog_names | Names of endogenous variables |
exog_names | |
k_params | (int) Number of parameters in the model |
param_names | (list of str) List of human readable parameter names (for parameters actually included in the model). |
start_params | (array) Starting parameters for maximum likelihood estimation. |
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.tsa.regime_switching.markov_regression.MarkovRegression.html