Class ARMAGARCHFit
- java.lang.Object
-
- dev.nm.stat.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 isgarchFit
infGarch
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAXIMUM_ITERATIONS
static double
DEFAULT_TOLERANCE
-
Constructor Summary
Constructors Constructor 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 Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Field Detail
-
DEFAULT_TOLERANCE
public static final double DEFAULT_TOLERANCE
- See Also:
- Constant Field Values
-
DEFAULT_MAXIMUM_ITERATIONS
public static final int DEFAULT_MAXIMUM_ITERATIONS
- See Also:
- 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 seriesAR
- the order for AR in ARMA modelMA
- the order for MA in ARMA modelp
- the order for GARCH in GARCH modelq
- the order for ARCH in GARCH modelepsilon
- the tolerancemaxIterations
- 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 seriesAR
- the order for AR in ARMA modelMA
- the order for MA in ARMA modelp
- the order for ARCH in GARCH modelq
- 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()
-
-