garch#

swordfish.function.garch()#

Use the generalized autoregressive conditional heteroskedasticity (GARCH) model to model the conditional volatility of univariate time series.

Parameters:
  • ds (Constant) – An in-memory table or a vector consisting of DataSource objects, containing the multivariate time series to be analyzed. ds cannot be empty.

  • endogColName (Constant) – A string indicating the column names of the endogenous variables in ds.

  • order (Constant) – A positive integral vector of length 2 indicating the orders. For example, order=[1,2] means p=1, q=2 for a GARCH model, where p is the order of the GARCH terms and q is the order of the ARCH terms.

  • maxIter (Constant, optional) – A positive integer indicating the maximum iterations. The default value is 50.

Returns:

A dictionary with the following keys:

  • volConstant: A floating-point scalar, representing the Vol Constant obtained through optimization.

  • returnsConstant: A floating-point scalar, representing the Returns Constant obtained through optimization.

  • archTerm: A floating-point vector, representing the ARCH Term obtained through optimization.

  • garchTerm: A floating-point vector, representing the GARCH Term obtained through optimization.

  • iterations: An integer representing the number of iterations.

  • aic: A floating-point scalar, representing the value of the AIC criterion.

  • bic: A floating-point scalar, representing the value of the BIC criterion.

  • nobs: An integer representing the number of observations in the time series, i.e., the amount of data used for fitting.

  • model: A dictionary containing the basic information of the fitted model, with the following members:

    • order: A vector with 2 positive integers, representing the order of the model.

    • endog: A floating-point matrix, representing the observed data converted from ds.

    • coefficients: A floating-point vector, representing the values of the exogenous variables after fitting.

  • predict: The prediction function of the model. It can be called using model.predict(x), where:

    • model: A dictionary indicating the output of garch.

    • x: A positive integer representing the prediction step.

Return type:

Constant