Statistics and time-series analytics API

EGARCH model functions. More...

Functions

int __stdcall NDK_EGARCH_GOF (double *pData, size_t nSize, double mu, const double *Alphas, size_t p, const double *Gammas, size_t g, const double *Betas, size_t q, WORD nInnovationType, double nu, WORD retType, double *retVal)
 
int __stdcall NDK_EGARCH_RESID (double *pData, size_t nSize, double mu, const double *Alphas, size_t p, const double *Gammas, size_t g, const double *Betas, size_t q, WORD nInnovationType, double nu, WORD retType)
 
int __stdcall NDK_EGARCH_PARAM (double *pData, size_t nSize, double *mu, double *Alphas, size_t p, double *Gammas, size_t g, double *Betas, size_t q, WORD nInnovationType, double *nu, WORD retType, size_t maxIter)
 
int __stdcall NDK_EGARCH_SIM (double mu, const double *Alphas, size_t p, const double *Gammas, size_t g, const double *Betas, size_t q, WORD nInnovationType, double nu, double *pData, size_t nSize, double *sigmas, size_t nSigmaSize, UINT nSeed, double *retArray, size_t nSteps)
 
int __stdcall NDK_EGARCH_FORE (double *pData, size_t nSize, double *sigmas, size_t nSigmaSize, double mu, const double *Alphas, size_t p, const double *Gammas, size_t g, const double *Betas, size_t q, WORD nInnovationType, double nu, size_t nStep, WORD retType, double alpha, double *retVal)
 
int __stdcall NDK_EGARCH_FITTED (double *pData, size_t nSize, double mu, const double *Alphas, size_t p, const double *Gammas, size_t g, const double *Betas, size_t q, WORD nInnovationType, double nu, WORD retType)
 
int __stdcall NDK_EGARCH_LRVAR (double mu, const double *Alphas, size_t p, const double *Gammas, size_t g, const double *Betas, size_t q, WORD nInnovationType, double nu, double *retVal)
 
int __stdcall NDK_EGARCH_VALIDATE (double mu, const double *Alphas, size_t p, const double *Gammas, size_t g, const double *Betas, size_t q, WORD nInnovationType, double nu)
 

Detailed Description

The exponential general autoregressive conditional heteroskedastic (EGARCH) is another form of the GARCH model. The EGARCH model was proposed by Nelson (1991) to overcome the weakness in GARCH’s handling of financial time series. In particular, to allow for asymmetric effects between positive and negative asset returns.

Function Documentation

◆ NDK_EGARCH_FITTED()

int __stdcall NDK_EGARCH_FITTED ( double * pData,
size_t nSize,
double mu,
const double * Alphas,
size_t p,
const double * Gammas,
size_t g,
const double * Betas,
size_t q,
WORD nInnovationType,
double nu,
WORD retType )

Returns an array of cells for the fitted values (i.e. mean, volatility and residuals)

Note
1. The time series is homogeneous or equally spaced
2. The time series may include missing values (e.g. NaN) at either end.
3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.
4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.
5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful ( )
See also
NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]muis the GARCH model conditional mean (i.e. mu).
[in]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
[in]Gammasare the leverage parameters (starting with the lowest lag).
[in]gis the number of elements in Gammas. Must be equal to (p-1).
[in]Betasare the parameters of the GARCH(q) component model (starting with the lowest lag).
[in]qis the number of elements in Betas array
[in]nInnovationTypeis the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
  • INNOVATION_GAUSSIAN Gaussian Distribution (default)
  • INNOVATION_TDIST Student's T-Distribution,
  • INNOVATION_GED Generalized Error Distribution (GED)
[in]nuis the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function.
[in]retTypeis a switch to select a output type ( see FIT_RETVAL_FUNC)

◆ NDK_EGARCH_FORE()

int __stdcall NDK_EGARCH_FORE ( double * pData,
size_t nSize,
double * sigmas,
size_t nSigmaSize,
double mu,
const double * Alphas,
size_t p,
const double * Gammas,
size_t g,
const double * Betas,
size_t q,
WORD nInnovationType,
double nu,
size_t nStep,
WORD retType,
double alpha,
double * retVal )

Calculates the out-of-sample forecast statistics.

Note
1. The time series is homogeneous or equally spaced
2. The time series may include missing values (e.g. NaN) at either end.
3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.
4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.
5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful ( )
See also
NDK_EGARCH_GOF(), NDK_EGARCH_RESID(), NDK_EGARCH_PARAM(), NDK_EGARCH_FITTED(), NDK_EGARCH_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]sigmasis the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities.
[in]nSigmaSizeis the number of elements in sigmas. Only the latest q observations are used.
[in]muis the GARCH model conditional mean (i.e. mu).
[in]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
Gammas[inout] are the leverage parameters (starting with the lowest lag).
[in]gis the number of elements in Gammas. Must be equal to (p-1).
[in]Betasare the parameters of the GARCH(q) component model (starting with the lowest lag).
[in]qis the number of elements in Betas array
[in]nInnovationTypeis the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
  • INNOVATION_GAUSSIAN Gaussian Distribution (default)
  • INNOVATION_TDIST Student's T-Distribution,
  • INNOVATION_GED Generalized Error Distribution (GED)
[in]nuis the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function.
[in]nStepis the forecast time/horizon (expressed in terms of steps beyond end of the time series).
[in]retTypeis a switch to select the type of value returned
  1. Mean forecast
  2. Forecast Error
  3. Volatility term structure
  4. Confidence interval lower limit
  5. Confidence interval upper limit (see FORECAST_RETVAL_FUNC)
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]retValis the simulated value for the GARCH process.

◆ NDK_EGARCH_GOF()

int __stdcall NDK_EGARCH_GOF ( double * pData,
size_t nSize,
double mu,
const double * Alphas,
size_t p,
const double * Gammas,
size_t g,
const double * Betas,
size_t q,
WORD nInnovationType,
double nu,
WORD retType,
double * retVal )

Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the GARCH model.

Note
1. The time series is homogeneous or equally spaced
2. The time series may include missing values (e.g. NaN) at either end.
3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.
4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.
5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful ( )
See also
NDK_EGARCH_RESID(), NDK_EGARCH_PARAM(), NDK_EGARCH_FORE(), NDK_EGARCH_FITTED(), NDK_EGARCH_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]muis the EGARCH model conditional mean (i.e. mu).
[in]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
[in]Gammasare the leverage parameters (starting with the lowest lag).
[in]gis the number of elements in Gammas. Must be equal to (p-1).
[in]Betasare the parameters of the GARCH(q) component model (starting with the lowest lag).
[in]qis the number of elements in Betas array
[in]nInnovationTypeis the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
  • INNOVATION_GAUSSIAN Gaussian Distribution (default)
  • INNOVATION_TDIST Student's T-Distribution,
  • INNOVATION_GED Generalized Error Distribution (GED)
[in]nuis the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function.
[in]retTypeis a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC)
[out]retValis the calculated goodness of fit value.

◆ NDK_EGARCH_LRVAR()

int __stdcall NDK_EGARCH_LRVAR ( double mu,
const double * Alphas,
size_t p,
const double * Gammas,
size_t g,
const double * Betas,
size_t q,
WORD nInnovationType,
double nu,
double * retVal )

Calculates the long-run average volatility for a given E-GARCH model.

Note
1. The time series is homogeneous or equally spaced
2. The time series may include missing values (e.g. NaN) at either end.
3. The long-run variance is not affected by our choice of shock/innovation distribution
4. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.
5. The number of gamma-coefficients must match the number of alpha-coefficients minus one.
6. The number of parameters in the input argument - beta - determines the order of the GARCH component model.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful ( )
See also
NDK_EGARCH_GOF(), NDK_EGARCH_RESID(), NDK_EGARCH_PARAM(), NDK_EGARCH_FORE(), NDK_EGARCH_VALIDATE()
Parameters
[in]muis the GARCH model conditional mean (i.e. mu).
[in]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
Gammas[inout] are the leverage parameters (starting with the lowest lag).
[in]gis the number of elements in Gammas. Must be equal to (p-1).
[in]Betasare the parameters of the GARCH(q) component model (starting with the lowest lag).
[in]qis the number of elements in Betas array
[in]nInnovationTypeis the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
  • INNOVATION_GAUSSIAN Gaussian Distribution (default)
  • INNOVATION_TDIST Student's T-Distribution,
  • INNOVATION_GED Generalized Error Distribution (GED)
[in]nuis the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function.
[out]retValis the calculated Long run volatility.

◆ NDK_EGARCH_PARAM()

int __stdcall NDK_EGARCH_PARAM ( double * pData,
size_t nSize,
double * mu,
double * Alphas,
size_t p,
double * Gammas,
size_t g,
double * Betas,
size_t q,
WORD nInnovationType,
double * nu,
WORD retType,
size_t maxIter )

Returns an array of cells for the initial (non-optimal), optimal or standard errors of the model's parameters.

Note
1. The time series is homogeneous or equally spaced
2. The time series may include missing values (e.g. NaN) at either end.
3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.
4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.
5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful ( )
See also
NDK_EGARCH_GOF(), NDK_EGARCH_RESID(), NDK_EGARCH_FORE(), NDK_EGARCH_FITTED(), NDK_EGARCH_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
mu[inout] is the EGARCH model conditional mean (i.e. mu).
Alphas[inout] are the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
Gammas[inout] are the leverage parameters (starting with the lowest lag).
[in]gis the number of elements in Gammas. Must be equal to (p-1).
Betas[inout] are the parameters of the GARCH(q) component model (starting with the lowest lag).
[in]qis the number of elements in Betas array
[in]nInnovationTypeis the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
  • INNOVATION_GAUSSIAN Gaussian Distribution (default)
  • INNOVATION_TDIST Student's T-Distribution,
  • INNOVATION_GED Generalized Error Distribution (GED)
nu[inout] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function.
[in]retTypeis a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC)
[in]maxIteris the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed.

◆ NDK_EGARCH_RESID()

int __stdcall NDK_EGARCH_RESID ( double * pData,
size_t nSize,
double mu,
const double * Alphas,
size_t p,
const double * Gammas,
size_t g,
const double * Betas,
size_t q,
WORD nInnovationType,
double nu,
WORD retType )

Returns an array of cells for the standardized residuals of a given GARCH model

Note
1. The time series is homogeneous or equally spaced
2. The time series may include missing values (e.g. NaN) at either end.
3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.
4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.
5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful ( )
Deprecated
this function is being replaced by NDK_EGARCH_FITTED()
See also
NDK_GARCH_GOF(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]muis the EGARCH model conditional mean (i.e. mu).
[in]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
[in]Gammasare the leverage parameters (starting with the lowest lag).
[in]gis the number of elements in Gammas. Must be equal to (p-1).
[in]Betasare the parameters of the GARCH(q) component model (starting with the lowest lag).
[in]qis the number of elements in Betas array
[in]nInnovationTypeis the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
  • INNOVATION_GAUSSIAN Gaussian Distribution (default)
  • INNOVATION_TDIST Student's T-Distribution,
  • INNOVATION_GED Generalized Error Distribution (GED)
[in]nuis the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function.
[in]retTypeis a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC

◆ NDK_EGARCH_SIM()

int __stdcall NDK_EGARCH_SIM ( double mu,
const double * Alphas,
size_t p,
const double * Gammas,
size_t g,
const double * Betas,
size_t q,
WORD nInnovationType,
double nu,
double * pData,
size_t nSize,
double * sigmas,
size_t nSigmaSize,
UINT nSeed,
double * retArray,
size_t nSteps )

Returns a simulated data series the underlying EGARCH process.

Note
1. The time series is homogeneous or equally spaced
2. The time series may include missing values (e.g. NaN) at either end.
3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.
4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.
5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful ( )
See also
NDK_EGARCH_RESID(), NDK_EGARCH_PARAM(), NDK_EGARCH_FORE(), NDK_EGARCH_FITTED(), NDK_EGARCH_VALIDATE()
Parameters
[in]muis the GARCH model conditional mean (i.e. mu).
[in]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
[in]Gammasare the leverage parameters (starting with the lowest lag).
[in]gis the number of elements in Gammas. Must be equal to (p-1).
[in]Betasare the parameters of the GARCH(q) component model (starting with the lowest lag).
[in]qis the number of elements in Betas array
[in]nInnovationTypeis the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
[in]nuis the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function.
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]sigmasis the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities.
[in]nSigmaSizeis the number of elements in sigmas. Only the latest q observations are used.
[in]nSeedis an unsigned integer for setting up the random number generators
[out]retArrayis the calculated simulation value
[in]nStepsis the number of future steps to simulate for.

◆ NDK_EGARCH_VALIDATE()

int __stdcall NDK_EGARCH_VALIDATE ( double mu,
const double * Alphas,
size_t p,
const double * Gammas,
size_t g,
const double * Betas,
size_t q,
WORD nInnovationType,
double nu )

Examines the model's parameters for stability constraints (e.g. stationary, positive variance, etc.).

Note
1. The time series is homogeneous or equally spaced
2. The time series may include missing values (e.g. NaN) at either end.
3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.
4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.
5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.
Returns
status code of the operation
Return values
NDK_TRUEModel is stable (i.e. variance process is stationary and yield positive values)
NDK_FALSEModel is unstable.
NDK_FAILEDoperation is unsuccessful ( )
See also
NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED()
Parameters
[in]muis the GARCH model conditional mean (i.e. mu).
[in]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
Gammas[inout] are the leverage parameters (starting with the lowest lag).
[in]gis the number of elements in Gammas. Must be equal to (p-1).
[in]Betasare the parameters of the GARCH(q) component model (starting with the lowest lag).
[in]qis the number of elements in Betas array
[in]nInnovationTypeis the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
  • INNOVATION_GAUSSIAN Gaussian Distribution (default)
  • INNOVATION_TDIST Student's T-Distribution,
  • INNOVATION_GED Generalized Error Distribution (GED)
[in]nuis the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function.