Fractional Autoregressive Integrated Moving Average (FARIMA) Model. More...
Functions | |
| int __stdcall | NDK_FARIMA_GOF (double *pData, size_t nSize, double mean, double sigma, double 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_FARIMA_RESID (double *pData, size_t nSize, double mean, double sigma, double nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD retType) |
| CReturns the standardized residuals of a given FARIMA model. | |
| int __stdcall | NDK_FARIMA_PARAM (double *pData, size_t nSize, double *mean, double *sigma, double nIntegral, double *phis, size_t p, double *thetas, size_t q, MODEL_RETVAL_FUNC retType, size_t maxIter) |
| Returns the initial (non-optimal), optimal or standard errors of the model's parameters. | |
| int __stdcall | NDK_FARIMA_SIM (double *pData, size_t nSize, double mean, double sigma, double nIntegral, double *phis, size_t p, double *thetas, size_t q, size_t nStep, size_t nSeed, double *retVal) |
| Returns a simulated data series the underlying FARIMA process. | |
| int __stdcall | NDK_FARIMA_FORE (double *pData, size_t nSize, double mean, double sigma, double 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 forecast statistics. | |
| int __stdcall | NDK_FARIMA_FITTED (double *pData, size_t nSize, double mean, double sigma, double nIntegral, double *phis, size_t p, double *thetas, size_t q, FIT_RETVAL_FUNC retType) |
| Returns an array of cells for the fitted values (i.e. mean, volatility and 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_FARIMA_FITTED | ( | double * | pData, |
| size_t | nSize, | ||
| double | mean, | ||
| double | sigma, | ||
| double | nIntegral, | ||
| double * | phis, | ||
| size_t | p, | ||
| double * | thetas, | ||
| size_t | q, | ||
| FIT_RETVAL_FUNC | retType ) |
Returns an array of cells for the fitted values (i.e. mean, volatility and residuals)
| [in,out] | pData | (Required) is the univariate time series data (a one dimensional array). | ||||||||||
| [in] | nSize | (Required) is the number of observations in pData. | ||||||||||
| [in] | mean | (Required) is the ARMA model mean (i.e. mu). | ||||||||||
| [in] | sigma | (Required) is the standard deviation of the model's residuals/innovations.. | ||||||||||
| [in] | nIntegral | (Required) is the model's integration (fractional) order. | ||||||||||
| [in] | phis | (Required) are the parameters of the AR(p) component model (starting with the lowest lag). | ||||||||||
| [in] | p | (Required) is the number of elements in phis (order of AR component). | ||||||||||
| [in] | thetas | (Required) are the parameters of the MA(q) component model (starting with the lowest lag). | ||||||||||
| [in] | q | (Required) 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 SFLUC.dll SFLOG.dll |
| int __stdcall NDK_FARIMA_FORE | ( | double * | pData, |
| size_t | nSize, | ||
| double | mean, | ||
| double | sigma, | ||
| double | 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 forecast statistics.
| [in] | pData | (Required) is the univariate time series data (a one dimensional array). | ||||||||||||
| [in] | nSize | (Required) is the number of observations in pData. | ||||||||||||
| [in] | mean | (Required) is the ARMA model mean (i.e. mu). | ||||||||||||
| [in] | sigma | (Required) is the standard deviation of the model's residuals/innovations.. | ||||||||||||
| [in] | nIntegral | (Required) is the model's integration (fractional) order. | ||||||||||||
| [in] | phis | (Required) are the parameters of the AR(p) component model (starting with the lowest lag). | ||||||||||||
| [in] | p | (Required) is the number of elements in phis (order of AR component). | ||||||||||||
| [in] | thetas | (Required) are the parameters of the MA(q) component model (starting with the lowest lag). | ||||||||||||
| [in] | q | (Required) is the number of elements in thetas (order of MA component). | ||||||||||||
| [in] | nStep | (Required) 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. (see FORECAST_RETVAL_FUNC).
| ||||||||||||
| [in] | alpha | (Required) is the statistical significance level. If missing, a default of 5% is assumed. | ||||||||||||
| [out] | retVal | (Required) is the calculated forecast value. |
| 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):| int __stdcall NDK_FARIMA_GOF | ( | double * | pData, |
| size_t | nSize, | ||
| double | mean, | ||
| double | sigma, | ||
| double | 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 function of the FARIMA model.
| [in] | pData | (Required) is the univariate time series data (a one dimensional array). | ||||||||||||||
| [in] | nSize | (Required) is the number of observations in pData. | ||||||||||||||
| [in] | mean | (Required) is the ARMA model mean (i.e. mu). | ||||||||||||||
| [in] | sigma | (Required) is the standard deviation of the model's residuals/innovations.. | ||||||||||||||
| [in] | nIntegral | (Required) is the model's integration (fractional) order. | ||||||||||||||
| [in] | phis | (Required) are the parameters of the AR(p) component model (starting with the lowest lag). | ||||||||||||||
| [in] | p | (Required) is the number of elements in phis (order of AR component). | ||||||||||||||
| [in] | thetas | (Required) are the parameters of the MA(q) component model (starting with the lowest lag). | ||||||||||||||
| [in] | q | (Required) is the number of elements in thetas (order of MA component). | ||||||||||||||
| [in] | retType | (Required) a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC).
| ||||||||||||||
| [out] | retVal | (Required) is a pointer to a variable to hold the calculated GOF 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 SFLUC.dll SFLOG.dll |
| int __stdcall NDK_FARIMA_PARAM | ( | double * | pData, |
| size_t | nSize, | ||
| double * | mean, | ||
| double * | sigma, | ||
| double | nIntegral, | ||
| double * | phis, | ||
| size_t | p, | ||
| double * | thetas, | ||
| size_t | q, | ||
| MODEL_RETVAL_FUNC | retType, | ||
| size_t | maxIter ) |
Returns the initial (non-optimal), optimal or standard errors of the model's parameters.
| [in,out] | pData | (Required) is the univariate time series data (a one dimensional array). | ||||||||
| [in] | nSize | (Required) is the number of observations in pData. | ||||||||
| [in,out] | mean | (Required) is the ARMA model mean (i.e. mu). | ||||||||
| [in,out] | sigma | (Required) is the standard deviation of the model's residuals/innovations.. | ||||||||
| [in] | nIntegral | (Required) is the model's integration (fractional) order. | ||||||||
| [in,out] | phis | (Required) are the parameters of the AR(p) component model (starting with the lowest lag). | ||||||||
| [in] | p | (Required) is the number of elements in phis (order of AR component). | ||||||||
| [in,out] | thetas | (Required) are the parameters of the MA(q) component model (starting with the lowest lag). | ||||||||
| [in] | q | (Required) 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 missing or less than 100, 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 SFLUC.dll SFLOG.dll |
| int __stdcall NDK_FARIMA_RESID | ( | double * | pData, |
| size_t | nSize, | ||
| double | mean, | ||
| double | sigma, | ||
| double | nIntegral, | ||
| double * | phis, | ||
| size_t | p, | ||
| double * | thetas, | ||
| size_t | q, | ||
| WORD | retType ) |
Returns the standardized residuals of a given FARIMA model
| [in,out] | pData | (Required) is the univariate time series data (a one dimensional array). | ||||||
| [in] | nSize | (Required) is the number of observations in pData. | ||||||
| [in] | mean | (Required) is the ARMA model mean (i.e. mu). | ||||||
| [in] | sigma | (Required) is the standard deviation of the model's residuals/innovations.. | ||||||
| [in] | nIntegral | (Required) is the model's integration (fractional) order. | ||||||
| [in] | phis | (Required) are the parameters of the AR(p) component model (starting with the lowest lag). | ||||||
| [in] | p | (Required) is the number of elements in phis (order of AR component). | ||||||
| [in] | thetas | (Required) are the parameters of the MA(q) component model (starting with the lowest lag). | ||||||
| [in] | q | (Required) is the number of elements in thetas (order of MA component). | ||||||
| [in] | retType | (Required) is a switch to select a residuals-type:raw or standardized. see RESID_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 SFLUC.dll SFLOG.dll |
| int __stdcall NDK_FARIMA_SIM | ( | double * | pData, |
| size_t | nSize, | ||
| double | mean, | ||
| double | sigma, | ||
| double | nIntegral, | ||
| double * | phis, | ||
| size_t | p, | ||
| double * | thetas, | ||
| size_t | q, | ||
| size_t | nStep, | ||
| size_t | nSeed, | ||
| double * | retVal ) |
Returns a simulated data series the underlying FARIMA process.
| [in] | pData | (Required) is the univariate time series data (a one dimensional array). |
| [in] | nSize | (Required) is the number of observations in pData. |
| [in] | mean | (Required) is the ARMA model mean (i.e. mu). |
| [in] | sigma | (Required) is the standard deviation of the model's residuals/innovations.. |
| [in] | nIntegral | (Required) is the model's integration (fractional) order. |
| [in] | phis | (Required) are the parameters of the AR(p) component model (starting with the lowest lag). |
| [in] | p | (Required) is the number of elements in phis (order of AR component). |
| [in] | thetas | (Required) are the parameters of the MA(q) component model (starting with the lowest lag). |
| [in] | q | (Required) is the number of elements in thetas (order of MA component). |
| [in] | nStep | (Required) is the number of future steps to simulate for. |
| [in] | nSeed | (Required) is an unsigned integer for setting up the random number generators. |
| [out] | retVal | (Required) is the calculated simulation value. |
| 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 SFLUC.dll SFLOG.dll |