class_docstr: First-order k-regime Markov switching regression model
  
  Parameters
  ----------
  endog : array_like
      The endogenous variable.
  k_regimes : int
      The number of regimes.
  trend : {'n', 'c', 't', 'ct'}
      Whether or not to include a trend. To include an intercept, time trend,
      or both, set `trend='c'`, `trend='t'`, or `trend='ct'`. For no trend,
      set `trend='n'`. Default is an intercept.
  exog : array_like, optional
      Array of exogenous regressors, shaped nobs x k.
  order : int, optional
      The order of the model describes the dependence of the likelihood on
      previous regimes. This depends on the model in question and should be
      set appropriately by subclasses.
  exog_tvtp : array_like, optional
      Array of exogenous or lagged variables to use in calculating
      time-varying transition probabilities (TVTP). TVTP is only used if this
      variable is provided. If an intercept is desired, a column of ones must
      be explicitly included in this array.
  switching_trend : bool or iterable, optional
      If a boolean, sets whether or not all trend coefficients are
      switching across regimes. If an iterable, should be of length equal
      to the number of trend variables, where each element is
      a boolean describing whether the corresponding coefficient is
      switching. Default is True.
  switching_exog : bool or iterable, optional
      If a boolean, sets whether or not all regression coefficients are
      switching across regimes. If an iterable, should be of length equal
      to the number of exogenous variables, where each element is
      a boolean describing whether the corresponding coefficient is
      switching. Default is True.
  switching_variance : bool, optional
      Whether or not there is regime-specific heteroskedasticity, i.e.
      whether or not the error term has a switching variance. Default is
      False.
  
  Notes
  -----
  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:
  
  .. math::
  
      y_t = a_{S_t} + x_t' \beta_{S_t} + \varepsilon_t \\
      \varepsilon_t \sim N(0, \sigma_{S_t}^2)
  
  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 accommodated by prepending columns to the `exog` array. Thus
  if `trend='c'`, the passed `exog` array should not already have a column of
  ones.
  
  See the notebook `Markov switching dynamic regression
  <../examples/notebooks/generated/markov_regression.html>`__ for an
  overview.
  
  References
  ----------
  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.
class_docstr_tok: ["First-order","k-regime","Markov","switching","regression","model","Parameters","--","--","--","--","--","endog",":","array_like","The","endogenous","variable",".","k_regimes",":","int","The","number","of","regimes",".","trend",":","{","'n","'",",","'","c","'",",","'t","'",",","'ct","'","}","Whether","or","not","to","include","a","trend",".","To","include","an","intercept",",","time","trend",",","or","both",",","set","`","trend=","'","c","'","`",",","`","trend='t","'","`",",","or","`","trend='ct","'","`",".","For","no","trend",",","set","`","trend='n","'","`",".","Default","is","an","intercept",".","exog",":","array_like",",","optional","Array","of","exogenous","regressors",",","shaped","nobs","x","k.","order",":","int",",","optional","The","order","of","the","model","describes","the","dependence","of","the","likelihood","on","previous","regimes",".","This","depends","on","the","model","in","question","and","should","be","set","appropriately","by","subclasses",".","exog_tvtp",":","array_like",",","optional","Array","of","exogenous","or","lagged","variables","to","use","in","calculating","time-varying","transition","probabilities","(","TVTP",")",".","TVTP","is","only","used","if","this","variable","is","provided",".","If","an","intercept","is","desired",",","a","column","of","ones","must","be","explicitly","included","in","this","array",".","switching_trend",":","bool","or","iterable",",","optional","If","a","boolean",",","sets","whether","or","not","all","trend","coefficients","are","switching","across","regimes",".","If","an","iterable",",","should","be","of","length","equal","to","the","number","of","trend","variables",",","where","each","element","is","a","boolean","describing","whether","the","corresponding","coefficient","is","switching",".","Default","is","True",".","switching_exog",":","bool","or","iterable",",","optional","If","a","boolean",",","sets","whether","or","not","all","regression","coefficients","are","switching","across","regimes",".","If","an","iterable",",","should","be","of","length","equal","to","the","number","of","exogenous","variables",",","where","each","element","is","a","boolean","describing","whether","the","corresponding","coefficient","is","switching",".","Default","is","True",".","switching_variance",":","bool",",","optional","Whether","or","not","there","is","regime-specific","heteroskedasticity",",","i.e",".","whether","or","not","the","error","term","has","a","switching","variance",".","Default","is","False",".","Notes","--","--","-","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",":","..","math",":",":","y_t","=","a_","{","S_t","}","+","x_t","'","\\beta_","{","S_t","}","+","\\varepsilon_t","\\\\","\\varepsilon_t","\\sim","N","(","0",",","\\sigma_","{","S_t","}","^2",")","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","accommodated","by","prepending","columns","to","the","`","exog","`","array",".","Thus","if","`","trend=","'","c","'","`",",","the","passed","`","exog","`","array","should","not","already","have","a","column","of","ones",".","See","the","notebook","`","Markov","switching","dynamic","regression","<","..","\/examples\/notebooks\/generated\/markov_regression.html",">","`","__","for","an","overview",".","References","--","--","--","--","--","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","."]
docstr: (array) Starting parameters for maximum likelihood estimation.
  
  Notes
  -----
  These are not very sophisticated and / or good. We set equal transition
  probabilities and interpolate regression coefficients between zero and
  the OLS estimates, where the interpolation is based on the regime
  number. We rely heavily on the EM algorithm to quickly find much better
  starting parameters, which are then used by the typical scoring
  approach.
docstr_tok: ["(","array",")","Starting","parameters","for","maximum","likelihood","estimation",".","Notes","--","--","-","These","are","not","very","sophisticated","and","\/","or","good",".","We","set","equal","transition","probabilities","and","interpolate","regression","coefficients","between","zero","and","the","OLS","estimates",",","where","the","interpolation","is","based","on","the","regime","number",".","We","rely","heavily","on","the","EM","algorithm","to","quickly","find","much","better","starting","parameters",",","which","are","then","used","by","the","typical","scoring","approach","."]
code: def start_params(self):
      """
      (array) Starting parameters for maximum likelihood estimation.
  
      Notes
      -----
      These are not very sophisticated and / or good. We set equal transition
      probabilities and interpolate regression coefficients between zero and
      the OLS estimates, where the interpolation is based on the regime
      number. We rely heavily on the EM algorithm to quickly find much better
      starting parameters, which are then used by the typical scoring
      approach.
      """
      # Inherited parameters
      params = markov_switching.MarkovSwitching.start_params.fget(self)
  
      # Regression coefficients
      if self._k_exog > 0:
          beta = np.dot(np.linalg.pinv(self.exog), self.endog)
          variance = np.var(self.endog - np.dot(self.exog, beta))
  
          if np.any(self.switching_coeffs):
              for i in range(self.k_regimes):
                  params[self.parameters[i, "exog"]] = beta * (
                      i / self.k_regimes
                  )
          else:
              params[self.parameters["exog"]] = beta
      else:
          variance = np.var(self.endog)
  
      # Variances
      if self.switching_variance:
          params[self.parameters["variance"]] = np.linspace(
              variance / 10.0, variance, num=self.k_regimes
          )
      else:
          params[self.parameters["variance"]] = variance
  
      return params
  
imports: import numpy
  import statsmodels.base.wrapper
  from statsmodels.tsa.regime_switching import markov_switching
label_desc: Use image node_id 9 for calling the MarkovRegression obj's underlying member method code with example usage: obj.start_params() and returns: params