GARCH model functions. More...
Functions | |
int __stdcall | NDK_GARCH_GOF (double *pData, size_t nSize, double mu, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu, WORD retType, double *retVal) |
int __stdcall | NDK_GARCH_RESID (double *pData, size_t nSize, double mu, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu, WORD retType) |
int __stdcall | NDK_GARCH_PARAM (double *pData, size_t nSize, double *mu, double *Alphas, size_t p, double *Betas, size_t q, WORD nInnovationType, double *nu, WORD retType, size_t maxIter) |
int __stdcall | NDK_GARCH_SIM (double mu, const double *Alphas, size_t p, 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_GARCH_FORE (double *pData, size_t nSize, double *sigmas, size_t nSigmaSize, double mu, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu, size_t nStep, WORD retType, double alpha, double *retVal) |
int __stdcall | NDK_GARCH_FITTED (double *pData, size_t nSize, double mu, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu, WORD retType) |
int __stdcall | NDK_GARCH_LRVAR (double mu, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu, double *retVal) |
int __stdcall | NDK_GARCH_VALIDATE (double mu, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu) |
If an autoregressive moving average model (ARMA model) is assumed for the error variance, the model is a generalized autoregressive conditional heteroskedasticity (GARCH, Bollerslev(1986)) model.
int __stdcall NDK_GARCH_FITTED | ( | double * | pData, |
size_t | nSize, | ||
double | mu, | ||
const double * | Alphas, | ||
size_t | p, | ||
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)
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC) |
int __stdcall NDK_GARCH_FORE | ( | double * | pData, |
size_t | nSize, | ||
double * | sigmas, | ||
size_t | nSigmaSize, | ||
double | mu, | ||
const double * | Alphas, | ||
size_t | p, | ||
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | sigmas | is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. |
[in] | nSigmaSize | is the number of elements in sigmas. Only the latest q observations are used. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | nStep | is the forecast time/horizon (expressed in terms of steps beyond end of the time series). |
[in] | retType | is a switch to select the type of value returned
|
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retVal | is the calculated forecast value |
int __stdcall NDK_GARCH_GOF | ( | double * | pData, |
size_t | nSize, | ||
double | mu, | ||
const double * | Alphas, | ||
size_t | p, | ||
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC) |
[out] | retVal | is the calculated goodness of fit value. |
int __stdcall NDK_GARCH_LRVAR | ( | double | mu, |
const double * | Alphas, | ||
size_t | p, | ||
const double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double | nu, | ||
double * | retVal ) |
Calculates the long-run average volatility for the given GARCH model
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[out] | retVal | is the calculated long run value |
int __stdcall NDK_GARCH_PARAM | ( | double * | pData, |
size_t | nSize, | ||
double * | mu, | ||
double * | Alphas, | ||
size_t | p, | ||
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
mu | [inout] is the GARCH model conditional mean (i.e. mu). | |
Alphas | [inout] are the parameters of the ARCH(p) component model (starting with the lowest lag). | |
[in] | p | is the number of elements in Alphas array |
Betas | [inout] are the parameters of the GARCH(q) component model (starting with the lowest lag). | |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
nu | [inout] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. | |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC) |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. |
int __stdcall NDK_GARCH_RESID | ( | double * | pData, |
size_t | nSize, | ||
double | mu, | ||
const double * | Alphas, | ||
size_t | p, | ||
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
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC |
int __stdcall NDK_GARCH_SIM | ( | double | mu, |
const double * | Alphas, | ||
size_t | p, | ||
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 GARCH process.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE) |
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | pData | is the univariate time series of the latest observations (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | sigmas | is the univariate time series of the latest observations (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. |
[in] | nSigmaSize | is the number of elements in sigmas. Only the latest q observations are used. |
[in] | nSeed | is an unsigned integer for setting up the random number generators |
[out] | retArray | is the calculated simulation value |
[in] | nSteps | is the number of future steps to simulate for. |
int __stdcall NDK_GARCH_VALIDATE | ( | double | mu, |
const double * | Alphas, | ||
size_t | p, | ||
const double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double | nu ) |
Examines the model's parameters for stability constraints (e.g. variance stationary, positive variance, etc.).
NDK_TRUE | Model is stable (i.e. variance process is stationary and yield positive values) |
NDK_FALSE | Model is unstable. |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |