### Navigation

- index
- modules |
- next |
- previous |
- statsmodels v0.2.0 documentation »
- Regression »

# scikits.statsmodels.regression.yule_walker

`scikits.statsmodels.regression.``yule_walker`(X, order=1, method='unbiased', df=None, inv=False)

  Estimate AR(p) parameters from a sequence X using Yule-Walker equation.

  Unbiased or maximum-likelihood estimator (mle)

  See, for example:

  http://en.wikipedia.org/wiki/Autoregressive_moving_average_model

  Parameters: | X : array-like 1d array order : integer, optional The order of the autoregressive process. Default is 1. method : string, optional Method can be “unbiased” or “mle” and this determines denominator in estimate of autocorrelation function (ACF) at lag k. If “mle”, the denominator is n=X.shape[0], if “unbiased” the denominator is n-k. The default is unbiased. df : integer, optional Specifies the degrees of freedom. If df is supplied, then it is assumed the X has df degrees of freedom rather than n. Default is None. inv : Bool If inv is True the inverse of R is also returned. Default is False.
  Returns: | rho : The autoregressive coefficients sigma : TODO

  Examples

      >>> import scikits.statsmodels as sm
      >>> from scikits.statsmodels.datasets.sunspots import Load
      >>> data = Load()
      >>> rho, sigma = sm.regression.yule_walker(data.endog,                                              order=4, method="mle")

      >>> rho
      array([ 1.28310031, -0.45240924, -0.20770299,  0.04794365])
      >>> sigma
      16.808022730464351

### Navigation

- index
- modules |
- next |
- previous |
- statsmodels v0.2.0 documentation »
- Regression »