Help on class ARIMA in module statsmodels.tsa.arima_model:
class ARIMA(ARMA)
| ARIMA(endog, order, exog=None, dates=None, freq=None, missing='none')
|
| Autoregressive Integrated Moving Average ARIMA(p,d,q) Model
|
| Parameters
| ----------
| endog : array-like
| The endogenous variable.
| order : iterable
| The (p,d,q) order of the model for the number of AR parameters,
| differences, and MA parameters to use.
| exog : array-like, optional
| An optional array of exogenous variables. This should *not* include a
| constant or trend. You can specify this in the `fit` method.
| dates : array-like of datetime, optional
| An array-like object of datetime objects. If a pandas object is given
| for endog or exog, it is assumed to have a DateIndex.
| freq : str, optional
| The frequency of the time-series. A Pandas offset or 'B', 'D', 'W',
| 'M', 'A', or 'Q'. This is optional if dates are given.
|
|
| Notes
| -----
| If exogenous variables are given, then the model that is fit is
|
| .. math::
|
| \phi(L)(y_t - X_t\beta) = \theta(L)\epsilon_t
|
| where :math:`\phi` and :math:`\theta` are polynomials in the lag
| operator, :math:`L`. This is the regression model with ARMA errors,
| or ARMAX model. This specification is used, whether or not the model
| is fit using conditional sum of square or maximum-likelihood, using
| the `method` argument in
| :meth:`statsmodels.tsa.arima_model.ARIMA.fit`. Therefore, for
| now, `css` and `mle` refer to estimation methods only. This may
| change for the case of the `css` model in future versions.
|
| Method resolution order:
| ARIMA
| ARMA
| statsmodels.tsa.base.tsa_model.TimeSeriesModel
| statsmodels.base.model.LikelihoodModel
| statsmodels.base.model.Model
| builtins.object
|
| Methods defined here:
|
| __getnewargs__(self)
|
| __init__(self, endog, order, exog=None, dates=None, freq=None, missing='none')
| Initialize self. See help(type(self)) for accurate signature.
|
| fit(self, start_params=None, trend='c', method='css-mle', transparams=True, solver='lbfgs', maxiter=500, full_output=1, disp=5, callback=None, start_ar_lags=None, **kwargs)
| Fits ARIMA(p,d,q) model by exact maximum likelihood via Kalman filter.
|
| Parameters
| ----------
| start_params : array-like, optional
| Starting parameters for ARMA(p,q). If None, the default is given
| by ARMA._fit_start_params. See there for more information.
| transparams : bool, optional
| Whehter or not to transform the parameters to ensure stationarity.
| Uses the transformation suggested in Jones (1980). If False,
| no checking for stationarity or invertibility is done.
| method : str {'css-mle','mle','css'}
| This is the loglikelihood to maximize. If "css-mle", the
| conditional sum of squares likelihood is maximized and its values
| are used as starting values for the computation of the exact
| likelihood via the Kalman filter. If "mle", the exact likelihood
| is maximized via the Kalman Filter. If "css" the conditional sum
| of squares likelihood is maximized. All three methods use
| `start_params` as starting parameters. See above for more
| information.
| trend : str {'c','nc'}
| Whether to include a constant or not. 'c' includes constant,
| 'nc' no constant.
| solver : str or None, optional
| Solver to be used. The default is 'lbfgs' (limited memory
| Broyden-Fletcher-Goldfarb-Shanno). Other choices are 'bfgs',
| 'newton' (Newton-Raphson), 'nm' (Nelder-Mead), 'cg' -
| (conjugate gradient), 'ncg' (non-conjugate gradient), and
| 'powell'. By default, the limited memory BFGS uses m=12 to
| approximate the Hessian, projected gradient tolerance of 1e-8 and
| factr = 1e2. You can change these by using kwargs.
| maxiter : int, optional
| The maximum number of function evaluations. Default is 500.
| tol : float
| The convergence tolerance. Default is 1e-08.
| full_output : bool, optional
| If True, all output from solver will be available in
| the Results object's mle_retvals attribute. Output is dependent
| on the solver. See Notes for more information.
| disp : int, optional
| If True, convergence information is printed. For the default
| l_bfgs_b solver, disp controls the frequency of the output during
| the iterations. disp < 0 means no output in this case.
| callback : function, optional
| Called after each iteration as callback(xk) where xk is the current
| parameter vector.
| start_ar_lags : int, optional
| Parameter for fitting start_params. When fitting start_params,
| residuals are obtained from an AR fit, then an ARMA(p,q) model is
| fit via OLS using these residuals. If start_ar_lags is None, fit
| an AR process according to best BIC. If start_ar_lags is not None,
| fits an AR process with a lag length equal to start_ar_lags.
| See ARMA._fit_start_params_hr for more information.
| kwargs
| See Notes for keyword arguments that can be passed to fit.
|
| Returns
| -------
| `statsmodels.tsa.arima.ARIMAResults` class
|
| See Also
| --------
| statsmodels.base.model.LikelihoodModel.fit : for more information
| on using the solvers.
| ARIMAResults : results class returned by fit
|
| Notes
| -----
| If fit by 'mle', it is assumed for the Kalman Filter that the initial
| unknown state is zero, and that the initial variance is
| P = dot(inv(identity(m**2)-kron(T,T)),dot(R,R.T).ravel('F')).reshape(r,
| r, order = 'F')
|
| predict(self, params, start=None, end=None, exog=None, typ='linear', dynamic=False)
| ARIMA model in-sample and out-of-sample prediction
|
| Parameters
| ----------
| params : array-like
| The fitted parameters of the model.
| start : int, str, or datetime
| Zero-indexed observation number at which to start forecasting, ie.,
| the first forecast is start. Can also be a date string to
| parse or a datetime type.
| end : int, str, or datetime
| Zero-indexed observation number at which to end forecasting, ie.,
| the first forecast is start. Can also be a date string to
| parse or a datetime type. However, if the dates index does not
| have a fixed frequency, end must be an integer index if you
| want out of sample prediction.
| exog : array-like, optional
| If the model is an ARMAX and out-of-sample forecasting is
| requested, exog must be given. Note that you'll need to pass
| `k_ar` additional lags for any exogenous variables. E.g., if you
| fit an ARMAX(2, q) model and want to predict 5 steps, you need 7
| observations to do this.
| dynamic : bool, optional
| The `dynamic` keyword affects in-sample prediction. If dynamic
| is False, then the in-sample lagged values are used for
| prediction. If `dynamic` is True, then in-sample forecasts are
| used in place of lagged dependent variables. The first forecasted
| value is `start`.
| typ : str {'linear', 'levels'}
|
| - 'linear' : Linear prediction in terms of the differenced
| endogenous variables.
| - 'levels' : Predict the levels of the original endogenous
| variables.
|
|
| Returns
| -------
| predict : array
| The predicted values.
|
|
|
| Notes
| -----
| Use the results predict method instead.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(cls, endog, order, exog=None, dates=None, freq=None, missing='none')
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from ARMA:
|
| geterrors(self, params)
| Get the errors of the ARMA process.
|
| Parameters
| ----------
| params : array-like
| The fitted ARMA parameters
| order : array-like
| 3 item iterable, with the number of AR, MA, and exogenous
| parameters, including the trend
|
| hessian(self, params)
| Compute the Hessian at params,
|
| Notes
| -----
| This is a numerical approximation.
|
| loglike(self, params, set_sigma2=True)
| Compute the log-likelihood for ARMA(p,q) model
|
| Notes
| -----
| Likelihood used depends on the method set in fit
|
| loglike_css(self, params, set_sigma2=True)
| Conditional Sum of Squares likelihood function.
|
| loglike_kalman(self, params, set_sigma2=True)
| Compute exact loglikelihood for ARMA(p,q) model by the Kalman Filter.
|
| score(self, params)
| Compute the score function at params.
|
| Notes
| -----
| This is a numerical approximation.
|
| ----------------------------------------------------------------------
| Class methods inherited from ARMA:
|
| from_formula(formula, data, subset=None, drop_cols=None, *args, **kwargs) from builtins.type
| Create a Model from a formula and dataframe.
|
| Parameters
| ----------
| formula : str or generic Formula object
| The formula specifying the model
| data : array-like
| The data for the model. See Notes.
| subset : array-like
| An array-like object of booleans, integers, or index values that
| indicate the subset of df to use in the model. Assumes df is a
| `pandas.DataFrame`
| drop_cols : array-like
| Columns to drop from the design matrix. Cannot be used to
| drop terms involving categoricals.
| args : extra arguments
| These are passed to the model
| kwargs : extra keyword arguments
| These are passed to the model with one exception. The
| ``eval_env`` keyword is passed to patsy. It can be either a
| :class:`patsy:patsy.EvalEnvironment` object or an integer
| indicating the depth of the namespace to use. For example, the
| default ``eval_env=0`` uses the calling namespace. If you wish
| to use a "clean" environment set ``eval_env=-1``.
|
| Returns
| -------
| model : Model instance
|
| Notes
| -----
| data must define __getitem__ with the keys in the formula terms
| args and kwargs are passed on to the model instantiation. E.g.,
| a numpy structured or rec array, a dictionary, or a pandas DataFrame.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from statsmodels.tsa.base.tsa_model.TimeSeriesModel:
|
| exog_names
|
| ----------------------------------------------------------------------
| Methods inherited from statsmodels.base.model.LikelihoodModel:
|
| information(self, params)
| Fisher information matrix of model
|
| Returns -Hessian of loglike evaluated at params.
|
| initialize(self)
| Initialize (possibly re-initialize) a Model instance. For
| instance, the design matrix of a linear model may change
| and some things must be recomputed.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from statsmodels.base.model.Model:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| endog_names
| Names of endogenous variables