Autoregressive Integrated Moving Average (ARIMA) Model. More...
Functions | |
int __stdcall | NDK_ARIMA_VALIDATE (double mean, double sigma, WORD, double *phis, size_t p, double *thetas, size_t q) |
Examines the model's parameters for stability constraints (e.g. stationarity, invertibility, causality, etc.). | |
int __stdcall | NDK_ARIMA_GOF (double *pData, size_t nSize, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, GOODNESS_OF_FIT_FUNC retType, double *retVal) |
Computes the goodness of fit measure (e.g., log-likelihood function (LLF), AIC, etc.) of the estimated ARIMA model. | |
int __stdcall | NDK_ARIMA_PARAM (double *pData, size_t nSize, double *mean, double *sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, MODEL_RETVAL_FUNC retType, size_t maxIter) |
Returns values for the quick guess, optimal (calibrated), or standard errors of the values of the model's parameters. | |
int __stdcall | NDK_ARIMA_SIM (double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, double *pData, size_t nSize, UINT nSeed, double *retVal, size_t nSteps) |
Calculates the out-of-sample simulated values. | |
int __stdcall | NDK_ARIMA_FORE (double *pData, size_t nSize, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, size_t nStep, FORECAST_RETVAL_FUNC retType, double alpha, double *retVal) |
Calculates the out-of-sample conditional forecast (i.e. mean, error, and confidence interval). | |
int __stdcall | NDK_ARIMA_FITTED (double *pData, size_t nSize, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, FIT_RETVAL_FUNC retType) |
Returns the in-sample model fitted values of the conditional mean, volatility or residuals. | |
The ARIMA model is an extension of the ARMA model that applies to non-stationary time series (the kind of time series with one or more integrated unit roots). By definition, the auto-regressive integrated moving average (ARIMA) process is an ARMA process for the differenced time series:
\[(1-\phi_1 L - \phi_2 L^2 -\cdots - \phi_p L^p)(1-L)^d x_t - \phi_o= (1+\theta_1 L+\theta_2 L^2 + \cdots + \theta_q L^q)a_t \]
\[y_t = (1-L)^d x_t \]
Where:
\[\phi_o = (1-\phi_1-\phi_2-\cdots -\phi_p)\mu\]
\[\eqalign{ & (1 - {\phi _1}L - {\phi _2}{L^2} - \cdots - {\phi _p}{L^p})({y_t} - \mu ) \cr & = (1 + {\theta _1}L + {\theta _2}{L^2} + \cdots + {\theta _q}{L^q}){a_t}{z_t} \cr & = {y_t} - \mu (1 - {\phi _1}L - {\phi _2}{L^2} - \cdots - {\phi _p}{L^p}){z_t} \cr & = (1 + {\theta _1}L + {\theta _2}{L^2} + \cdots + {\theta _q}{L^q}){a_t} \cr}\]
\[(1-\phi_1 L -\phi_{12} L^{12} ) (y_t-\mu) = (1+\theta_2 L^2 ) a_t\]
int __stdcall NDK_ARIMA_FITTED | ( | double * | pData, |
size_t | nSize, | ||
double | mean, | ||
double | sigma, | ||
WORD | nIntegral, | ||
double * | phis, | ||
size_t | p, | ||
double * | thetas, | ||
size_t | q, | ||
FIT_RETVAL_FUNC | retType ) |
Returns the in-sample model fitted values of the conditional mean, volatility or residuals.
[in,out] | pData | (Required) is the univariate time series data (a one dimensional array). | ||||||||||
[in] | nSize | (Required) iis the number of observations in pData . | ||||||||||
[in] | mean | (Optional) is the ARMA model mean (i.e. mu). | ||||||||||
[in] | sigma | (Optional) iis the standard deviation of the model's residuals/innovations. | ||||||||||
[in] | nIntegral | (Optional) is the integration order. | ||||||||||
[in] | phis | (Optional) are the parameters of the AR(p) component model (starting with the lowest lag). | ||||||||||
[in] | p | (Optional) is the number of elements in phis (order of AR component). | ||||||||||
[in] | thetas | (Optional) are the parameters of the MA(q) component model (starting with the lowest lag). | ||||||||||
[in] | q | (Optional) is the number of elements in thetas (order of MA component). | ||||||||||
[in] | retType | (Required) s a switch to select a output type ( see FIT_RETVAL_FUNC).
|
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.retVal
argument is NULL, the function will fails and return NDK_INVALID_ARG.phis
):thetas
):Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_ARIMA_FORE | ( | double * | pData, |
size_t | nSize, | ||
double | mean, | ||
double | sigma, | ||
WORD | nIntegral, | ||
double * | phis, | ||
size_t | p, | ||
double * | thetas, | ||
size_t | q, | ||
size_t | nStep, | ||
FORECAST_RETVAL_FUNC | retType, | ||
double | alpha, | ||
double * | retVal ) |
Calculates the out-of-sample conditional forecast (i.e. mean, error, and confidence interval).
[in] | pData | (Required) is the univariate time series data. | ||||||||||||
[in] | nSize | (Required) iis the number of observations in pData . | ||||||||||||
[in] | mean | (Optional) is the ARMA model mean (i.e. mu). | ||||||||||||
[in] | sigma | (Optional) iis the standard deviation of the model's residuals/innovations. | ||||||||||||
[in] | nIntegral | (Optional) is the integration order. | ||||||||||||
[in] | phis | (Optional) are the parameters of the AR(p) component model (starting with the lowest lag). | ||||||||||||
[in] | p | (Optional) is the number of elements in phis (order of AR component). | ||||||||||||
[in] | thetas | (Optional) are the parameters of the MA(q) component model (starting with the lowest lag). | ||||||||||||
[in] | q | (Optional) is the number of elements in thetas (order of MA component). | ||||||||||||
[in] | nStep | (Optional) is the forecast time/horizon (expressed in terms of steps beyond end of the time series). | ||||||||||||
[in] | retType | (Required) is a switch to select the type of value returned (FORECAST_MEAN, FORECAST_STDEV , ..). (see FORECAST_RETVAL_FUNC).
| ||||||||||||
[in] | alpha | (Required) is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed. | ||||||||||||
[out] | retVal | (Required) is a pointer to a variable to hold the calculated forecast statistics. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.retVal
argument is NULL, the function will fails and return NDK_INVALID_ARG.phis
):thetas
):Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_ARIMA_GOF | ( | double * | pData, |
size_t | nSize, | ||
double | mean, | ||
double | sigma, | ||
WORD | nIntegral, | ||
double * | phis, | ||
size_t | p, | ||
double * | thetas, | ||
size_t | q, | ||
GOODNESS_OF_FIT_FUNC | retType, | ||
double * | retVal ) |
Computes the log-likelihood (LLF), Akaike Information Criterion (AIC) or other goodness of fit functions of the ARMA model.
[in] | pData | (Required) is the univariate time series data. | ||||||||||
[in] | nSize | (Required) iis the number of observations in pData . | ||||||||||
[in] | mean | (Optional) is the ARMA model mean (i.e. mu). | ||||||||||
[in] | sigma | (Optional) iis the standard deviation of the model's residuals/innovations. | ||||||||||
[in] | nIntegral | (Optional) is the integration order. | ||||||||||
[in] | phis | (Optional) are the parameters of the AR(p) component model (starting with the lowest lag). | ||||||||||
[in] | p | (Optional) is the number of elements in phis (order of AR component). | ||||||||||
[in] | thetas | (Optional) are the parameters of the MA(q) component model (starting with the lowest lag). | ||||||||||
[in] | q | (Optional) is the number of elements in thetas (order of MA component). | ||||||||||
[in] | retType | (Required) is a switch to select the return output (1 = Mean Value (default), 2 = Std Error, 3 = Test Score, 4 = P-Value, 5 = Upper Value, 6 = Lower Value). ( see GOODNESS_OF_FIT_FUNC)
| ||||||||||
[out] | retVal | (Required) is a pointer to a variable to hold the calculated test statistics. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.retVal
argument is NULL, the function will fails and return NDK_INVALID_ARG.phis
):thetas
):Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_ARIMA_PARAM | ( | double * | pData, |
size_t | nSize, | ||
double * | mean, | ||
double * | sigma, | ||
WORD | nIntegral, | ||
double * | phis, | ||
size_t | p, | ||
double * | thetas, | ||
size_t | q, | ||
MODEL_RETVAL_FUNC | retType, | ||
size_t | maxIter ) |
Returns values for the quick guess, optimal (calibrated), or standard errors of the values of the model's parameters.
[in] | pData | (Required) is the univariate time series data. | ||||||||
[in] | nSize | (Required) iis the number of observations in pData . | ||||||||
[in,out] | mean | (Optional) is the ARMA model mean (i.e. mu). | ||||||||
[in,out] | sigma | (Optional) iis the standard deviation of the model's residuals/innovations. | ||||||||
[in] | nIntegral | (Optional) is the integration order. | ||||||||
[in,out] | phis | (Optional) are the parameters of the AR(p) component model (starting with the lowest lag). | ||||||||
[in] | p | (Optional) is the number of elements in phis (order of AR component). | ||||||||
[in,out] | thetas | (Optional) are the parameters of the MA(q) component model (starting with the lowest lag). | ||||||||
[in] | q | (Optional) is the number of elements in thetas (order of MA component). | ||||||||
[in] | retType | (Required) is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC).
| ||||||||
[in] | maxIter | (Required) is the maximum number of iterations used to calibrate the model. If none (i.e., 0), the default maximum of 100 is assumed. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.retVal
argument is NULL, the function will fails and return NDK_INVALID_ARG.phis
):thetas
):Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_ARIMA_SIM | ( | double | mean, |
double | sigma, | ||
WORD | nIntegral, | ||
double * | phis, | ||
size_t | p, | ||
double * | thetas, | ||
size_t | q, | ||
double * | pData, | ||
size_t | nSize, | ||
UINT | nSeed, | ||
double * | retVal, | ||
size_t | nSteps ) |
Calculates the out-of-sample simulated values.
[in] | mean | (Optional) is the ARMA model mean (i.e. mu). |
[in] | sigma | (Optional) is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | (Optional) is the integration order. |
[in] | phis | (Optional) are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | (Optional) is the number of elements in phis (order of AR component). |
[in] | thetas | (Optional) are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | (Optional) is the number of elements in thetas (order of MA component). |
[in] | pData | (Required) The values of the latest (most recent) observations. |
[in] | nSize | (Required) is the number of observations in pData . |
[in] | nSeed | (Required) is an unsigned integer to initialize the psuedorandom number generator. |
[out] | retVal | (Required) is the output array to hold nSteps future simulations. |
[in] | nSteps | (Required) is the number of future steps to simulate for. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.retVal
argument is NULL, the function will fails and return NDK_INVALID_ARG.phis
):thetas
):Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_ARIMA_VALIDATE | ( | double | mean, |
double | sigma, | ||
WORD | nIntegral, | ||
double * | phis, | ||
size_t | p, | ||
double * | thetas, | ||
size_t | q ) |
Examines the model's parameters for stability constraints (e.g. stationarity, invertibility, causality, etc.).
[in] | mean | (Optional) is the ARMA model mean (i.e. mu). |
[in] | sigma | (Optional) is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | (Optional) is the integration order. |
[in] | phis | (Optional) are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | (Optional) is the number of elements in phis (order of AR component). |
[in] | thetas | (Optional) are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | (Optional) is the number of elements in thetas (order of MA component). |
NDK_TRUE | model is stable |
NDK_FALSE | model is instable |
NDK_INVALID_ARG | failed (see remarks) |
NDK_FAILED | failed |
phis
):thetas
):Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |