# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.timeseries.linear.univariate.stationaryprocess.armagarch

## Class ARMAGARCHFit

• java.lang.Object
• com.numericalmethod.suanshu.stats.timeseries.linear.univariate.stationaryprocess.armagarch.ARMAGARCHFit

• public class ARMAGARCHFit
extends Object
This implementation fits, for a data set, an ARMA-GARCH model by Quasi-Maximum Likelihood Estimation. "QMLE" stands for Quasi-Maximum Likelihood Estimation, which assumes Normal distribution and uses robust standard errors for inference. Hence, we currently support only Normal innovations. The parameters of both ARMA and GARCH models are jointly estimated by maximizing a likelihood function.

Please refer to the reference for the standard assumptions.

To reduce the number of parameters, hence more accuracy, we assume that the constant parameters $$\mu$$ and $$\omega$$ are expressed as: $\mu=(1-\sum_{i=1}^p \phi_i) * MEAN(X), \\ \omega=(1-\sum_{i=1}^r \alpha_i - \sum_{i=1}^r \beta_i) * MEAN(X).$

The R equivalent function is garchFit in fGarch.

"Francq C. and Zakoian, J. M., "Maximum likelihood estimation of pure GARCH and ARMA-GARCH processes", Bernoulli 10(4), 2004, 605-637."
• ### Field Summary

Fields
Modifier and Type Field and Description
static int DEFAULT_MAXIMUM_ITERATIONS
static double DEFAULT_TOLERANCE
• ### Constructor Summary

Constructors
Constructor and Description
ARMAGARCHFit(double[] x, int AR, int MA, int p, int q)
Constructs a model with the default tolerance and maximum number of iterations.
ARMAGARCHFit(double[] x, int AR, int MA, int p, int q, double epsilon, int maxIterations)
Constructs a model.
• ### Method Summary

All Methods
Modifier and Type Method and Description
ARMAGARCHModel getARMAGARCHModel()
double[] getMeanForecast(int k)
Calculates the k-step ahead forecast of X in ARMA model.
double[] getMeanResidual()
double[] getVarForecast(int k)
Calculates the k-step ahead of conditional variance h in GARCH model.
double[] getVarResidual()
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Field Detail

• #### DEFAULT_TOLERANCE

public static final double DEFAULT_TOLERANCE
Constant Field Values
• #### DEFAULT_MAXIMUM_ITERATIONS

public static final int DEFAULT_MAXIMUM_ITERATIONS
Constant Field Values
• ### Constructor Detail

• #### ARMAGARCHFit

public ARMAGARCHFit(double[] x,
int AR,
int MA,
int p,
int q,
double epsilon,
int maxIterations)
Constructs a model.
Parameters:
x - the input series
AR - the order for AR in ARMA model
MA - the order for MA in ARMA model
p - the order for GARCH in GARCH model
q - the order for ARCH in GARCH model
epsilon - the tolerance
maxIterations - the maximum number of optimization steps
• #### ARMAGARCHFit

public ARMAGARCHFit(double[] x,
int AR,
int MA,
int p,
int q)
Constructs a model with the default tolerance and maximum number of iterations.
Parameters:
x - the input series
AR - the order for AR in ARMA model
MA - the order for MA in ARMA model
p - the order for ARCH in GARCH model
q - the order for GARCH in GARCH model
• ### Method Detail

• #### getARMAGARCHModel

public ARMAGARCHModel getARMAGARCHModel()
• #### getMeanForecast

public double[] getMeanForecast(int k)
Calculates the k-step ahead forecast of X in ARMA model. When k < max(p, q), getMeanForecastPQ() is called. When k > max(p, q), the first max(p, q) days forecasts are the same as those of getMeanForecastPQ(). And the (k - max(p, q)) days of forecasts are calculated by iteration.
Parameters:
k - the number of forecasts
Returns:
the ARMA forecast
• #### getVarForecast

public double[] getVarForecast(int k)
Calculates the k-step ahead of conditional variance h in GARCH model. When k < max(p, q), getVarForecastPQ() is called. When k > max(p, q), the first max(p, q) days forecasts are the same as those of getVarForecastPQ(). The (k - max(p, q)) days of forecasts are calculated by iteration.
Parameters:
k - the number of forecasts
Returns:
the GARCH forecast
• #### getMeanResidual

public double[] getMeanResidual()
• #### getVarResidual

public double[] getVarResidual()