SDK 1.69.1
Brief about SDK
Loading...
Searching...
No Matches
SFSDK

Data Structures

struct  __X12ARIMA_OPTIONS__
 

Typedefs

typedef struct __X12ARIMA_OPTIONS__ X12ARIMA_OPTIONS
 

Enumerations

enum  ADFTEST_OPTION { ADFTEST_DRIFT_ONLY =1 , ADFTEST_DRIFT_N_CONST =2 , ADFTEST_DRIFT_N_TREND =3 , ADFTEST_DRIFT_N_CONST_N_TREND =4 , ADFTEST_DRIFT_N_CONST_TREND_TREND2 =5 }
 
enum  COLNRTY_TEST_TYPE { COLNRTY_CN =1 , COLNRTY_VIF =2 , COLNRTY_DET =3 , COLNRTY_EIGEN =4 }
 
enum  CORRELATION_METHOD { XCF_PEARSON =1 , XCF_SPEARMAN =2 , XCF_KENDALL =3 }
 
enum  FIT_RETVAL_FUNC { FIT_MEAN =1 , FIT_STDEV =2 , FIT_RESID =3 , FIT_STD_RESID =4 }
 
enum  FORECAST_RETVAL_FUNC { FORECAST_MEAN =1 , FORECAST_STDEV =2 , FORECAST_TS_STDEV =3 , FORECAST_LL =4 , FORECAST_UL =5 }
 
enum  GLM_LINK_FUNC { GLM_LVK_IDENTITY =1 , GLM_LVK_LOG =2 , GLM_LVK_LOGIT =3 , GLM_LVK_PROBIT =4 , GLM_LVK_CLOGLOG =5 }
 
enum  GOODNESS_OF_FIT_FUNC { GOF_LLF =1 , GOF_AIC =2 , GOF_BIC =3 , GOF_HQC =4 , GOF_RSQ =5 , GOF_ARSQ =6 }
 
enum  IMPUTATION_METHOD { IMPUTATION_NONE = 0 , IMPUTATION_INTERPOLATE_FWD = 1 , IMPUTATION_INTERPOLATE_BKWD = 2 , IMPUTATION_INTERPOLATE_LINEAR = 3 , IMPUTATION_INTERPOLATE_CSPLINE = 4 , IMPUTATION_FFT = 5 }
 
enum  INNOVATION_TYPE { INNOVATION_GAUSSIAN =1 , INNOVATION_TDIST =2 , INNOVATION_GED =3 }
 
enum  MODEL_RETVAL_FUNC { PARAM_GUESS =1 , PARAM_CALIBRATE =2 , PARAM_ERROR =3 }
 
enum  NORMALTEST_METHOD { NORMALTEST_JB =1 , NORMALTEST_WS =2 , NORMALTEST_CHISQ =3 }
 
enum  PERIODOGRAM_OPTION_TYPE { PERIODOGRAM_NONE =1 , PERIODOGRAM_DETREND =2 , PERIODOGRAM_DIFFERENCE =3 , PERIODOGRAM_AUTOPROC =4 }
 
enum  RESID_RETVAL_FUNC { RESIDS_STD =1 , RESIDS_RAW =2 }
 
enum  TEST_RETURN { TEST_PVALUE =1 , TEST_SCORE =2 , TEST_CRITICALVALUE =3 }
 
enum  TREND_TYPE { TREND_LINEAR =1 , TREND_POLYNOMIAL =2 , TREND_EXPONENTIAL =3 , TREND_LOGARITHMIC =4 , TREND_POWER =5 }
 
enum  X11_MODE_TYPE { X11_MODE_MULT = 0 , X11_MODE_ADD = 1 , X11_MODE_PSEUDOADD = 2 , X11_MODE_LOGADD = 3 }
 
enum  X11_SEASONALMA_TYPE {
  X11_SEASONALMA_3x1 = 0 , X11_SEASONALMA_3x3 = 1 , X11_SEASONALMA_3x5 = 2 , X11_SEASONALMA_3x9 = 3 , X11_SEASONALMA_3x15 = 4 , X11_SEASONALMA_STABLE = 5 , X11_SEASONALMA_DEFAULT = 6 ,
  X11_SEASONALMA_MSR =7
}
 
enum  X13PRIORADJUST_TYPE { X13PRIORADJUST_RATIO = 0 , X13PRIORADJUST_PERCENT = 1 , X13PRIORADJUST_DIFF = 2 }
 
enum  X13TRANSFORM_METHOD { X13TRANSFOR_NONE = 0 , X13TRANSFOR_AUTO = 1 , X13TRANSFOR_LOG = 2 , X13TRANSFOR_SQRT = 3 , X13TRANSFOR_INV = 4 , X13TRANSFOR_LOGIST = 5 , X13TRANSFOR_BOXCOX = 6 }
 

Initialization APIs

int __stdcall NDK_Init (LPCWSTR szAppName, LPCWSTR szTmpPath, long lTimeout, unsigned int *uClientToken)
 
int __stdcall NDK_Shutdown (BOOL cleanup, unsigned int uClientToken)
 

Descriptive Statistics

int __stdcall NDK_XKURT (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_SKEW (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_AVERAGE (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_GMEAN (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_VARIANCE (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_MIN (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_MAX (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_QUANTILE (double *X, size_t N, double p, double *retVal)
 
int __stdcall NDK_IQR (double *X, size_t N, double *retVal)
 
int __stdcall NDK_SORT_ASC (double *X, size_t N)
 
int __stdcall NDK_HURST_EXPONENT (double *X, size_t N, double alpha, WORD retType, double *retVal)
 
int __stdcall NDK_GINI (double *x, size_t N, double *retVal)
 
int __stdcall NDK_XCF (double *X, double *Y, size_t N, size_t K, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_RMS (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_MD (double *pData, size_t nSize, WORD reserved, double *retVal)
 
int __stdcall NDK_RMD (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_MAD (double *X, size_t N, WORD reserved, double *retVal)
 
int __stdcall NDK_LRVAR (double *X, size_t N, size_t w, double *retVal)
 
int __stdcall NDK_SAD (double *X, double *Y, size_t N, double *retVal)
 
int __stdcall NDK_MAE (double *X, double *Y, size_t N, double *retVal)
 
int __stdcall NDK_MASE (double *X, double *Y, size_t N, size_t M, double *retVal)
 
int __stdcall NDK_MAPE (double *X, double *Y, size_t N, BOOL SMAPE, double *retVal)
 
int __stdcall NDK_MdAPE (double *X, double *Y, size_t N, BOOL SMAPE, double *retVal)
 
int __stdcall NDK_MAAPE (double *X, double *Y, size_t N, double *retVal)
 
int __stdcall NDK_RMSE (double *X, double *Y, size_t N, WORD retType, double *retVal)
 
int __stdcall NDK_GRMSE (double *X, double *Y, size_t N, double *retVal)
 
int __stdcall NDK_SSE (double *X, double *Y, size_t N, double *retVal)
 
int __stdcall NDK_MSE (double *X, double *Y, size_t N, double *retVal)
 
int __stdcall NDK_GMSE (double *X, double *Y, size_t N, double *retVal)
 
int __stdcall NDK_MRAE (double *X, double *Y, size_t N, size_t period, double *retVal)
 
int __stdcall NDK_MdRAE (double *X, double *Y, size_t N, size_t period, double *retVal)
 
int __stdcall NDK_GMRAE (double *X, double *Y, size_t N, size_t period, double *retVal)
 
int __stdcall NDK_PB (double *X, double *Y, size_t N, size_t period, WORD basis, double *retVal)
 
int __stdcall NDK_MDA (double *X, double *Y, size_t N, double *retVal)
 
int __stdcall NDK_ACF (double *X, size_t N, size_t K, WORD method, double *retVal)
 
int __stdcall NDK_ACF_ERROR (double *X, size_t N, size_t K, WORD method, double *retVal)
 
int __stdcall NDK_ACFCI (double *X, size_t N, size_t K, WORD method, double alpha, double *ULCI, double *LLCI)
 
int __stdcall NDK_PACF (double *X, size_t N, size_t K, WORD method, double *retVal)
 
int __stdcall NDK_PACF_ERROR (double *X, size_t N, size_t K, double *retVal)
 
int __stdcall NDK_PACFCI (double *X, size_t N, size_t K, double alpha, double *ULCI, double *LLCI)
 
int __stdcall NDK_PERIODOGRAM (double *pData, size_t nSize, PERIODOGRAM_OPTION_TYPE option, double alpha, double *retVal, size_t nOutSize)
 
int __stdcall NDK_EWMA (double *X, size_t N, double lambda, size_t step, double *retVal)
 
int __stdcall NDK_EWXCF (double *X, double *Y, size_t N, double lambda, size_t step, double *retVal)
 

Statistical Distribution

Statistical distribution

int __stdcall NDK_GED_XKURT (double df, double *retVal)
 
int __stdcall NDK_TDIST_XKURT (double df, double *retVal)
 
int __stdcall NDK_EDF (double *pData, size_t nSize, double targetVal, WORD retType, double *retVal)
 
int __stdcall NDK_HIST_BINS (double *pData, size_t nSize, WORD argMethod, size_t *retVal)
 
int __stdcall NDK_HIST_BIN_LIMIT (double *pData, size_t nSize, size_t nBins, size_t index, WORD argRetTYpe, double *retVal)
 
int __stdcall NDK_HISTOGRAM (double *pData, size_t nSize, size_t nBins, size_t index, WORD argRetTYpe, double *retVal)
 
int __stdcall NDK_KERNEL_DENSITY_ESTIMATE (double *pData, size_t nSize, double targetVal, double bandwidth, WORD argKernelFunc, double *retVal)
 
int __stdcall NDK_KDE (double *pData, size_t nSize, double lo, double hi, WORD transform, double lambda, WORD argKernelFunc, double *bandwidth, BOOL bOptimize, WORD argOptMethod, BOOL argAdaptive, WORD argRetType, double *argTargets, size_t argCount, double *argOutBuffer)
 
int __stdcall NDK_GAUSS_RNG (double mean, double sigma, UINT seed, double *retArray, UINT nArraySize)
 
int __stdcall NDK_GAUSS_FORECI (double mean, double sigma, double alpha, BOOL upper, double *retVal)
 
int __stdcall NDK_TSTUDENT_FORECI (double mean, double sigma, double df, double alpha, BOOL upper, double *retVal)
 
int __stdcall NDK_GED_FORECI (double mean, double sigma, double df, double alpha, BOOL upper, double *retVal)
 

Statistical Testing

Statistical/hypothesis testing is a common method of drawing inferences about a population based on statistical evidence from a sample.

int __stdcall NDK_ACFTEST (double *X, size_t N, int K, WORD method, double target, double alpha, WORD retType, double *retVal)
 
int __stdcall NDK_NORMALTEST (double *X, size_t N, double alpha, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_WNTEST (double *X, size_t N, size_t K, double alpha, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_ARCHTEST (double *X, size_t N, size_t K, double alpha, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_MEANTEST (double *X, size_t N, double target, double alpha, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_STDEVTEST (double *X, size_t N, double target, double alpha, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_SKEWTEST (double *X, size_t N, double alpha, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_XKURTTEST (double *X, size_t N, double alpha, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_XCFTEST (double *X, double *Y, size_t N, int K, double target, double alpha, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_ADFTEST (double *X, size_t N, WORD K, ADFTEST_OPTION options, BOOL testDown, double alpha, WORD method, WORD retType, double *retVal)
 
int __stdcall NDK_KPSSTEST (double *pData, size_t nSize, WORD maxOrder, WORD option, BOOL testDown, WORD argMethod, WORD retType, double alpha, double *retVal)
 
int __stdcall NDK_JOHANSENTEST (double **XX, size_t N, size_t M, size_t K, short nPolyOrder, BOOL tracetest, WORD R, double alpha, double *retStat, double *retCV)
 
int __stdcall NDK_COLNRTY_TEST (double **XX, size_t N, size_t M, LPBYTE mask, size_t nMaskLen, COLNRTY_TEST_TYPE nMethod, WORD nColIndex, double *retVal)
 
int __stdcall NDK_CHOWTEST (double **XX1, size_t M, double *Y1, size_t N1, double **XX2, double *Y2, size_t N2, LPBYTE mask, size_t nMaskLen, double intercept, TEST_RETURN retType, double *retVal)
 

Transfom

int __stdcall NDK_LAG (double *X, size_t N, size_t K)
 
int __stdcall NDK_DIFF (double *X, size_t N, size_t S, size_t D)
 
int __stdcall NDK_INTEG (double *X, size_t N, size_t S, size_t D, double *X0, size_t N0)
 
int __stdcall NDK_RMNA (double *X, size_t *N)
 
int __stdcall NDK_REVERSE (double *X, size_t N)
 
int __stdcall NDK_SHUFFLE (double *pData, size_t nSize, ULONG ulSeed)
 
int __stdcall NDK_CHOOSE (double *pData, size_t nSize, size_t nItems, bool replacement, ULONG ulSeed, double *pRetVal)
 
int __stdcall NDK_SCALE (double *X, size_t N, double K)
 
int __stdcall NDK_SUB (double *X, size_t N1, const double *Y, size_t N2)
 
int __stdcall NDK_ADD (double *X, size_t N1, const double *Y, size_t N2)
 
int __stdcall NDK_CLOGLOG (double *X, size_t N, double lo, double hi, WORD retTYpe)
 
int __stdcall NDK_PROBIT (double *X, size_t N, double lo, double hi, WORD retTYpe)
 
int __stdcall NDK_LOGIT (double *X, size_t N, double lo, double hi, WORD retTYpe)
 
int __stdcall NDK_BOXCOX (double *X, size_t N, double lo, double hi, double lambda, int retTYpe, double *retVal)
 
int __stdcall NDK_DETREND (double *X, size_t N, WORD polyOrder)
 
int __stdcall NDK_RMSEASONAL (double *X, size_t N, size_t period)
 
int __stdcall NDK_INTERP_NAN (double *X, size_t N, WORD nMethod, double plug, double h)
 
int __stdcall NDK_INTRNL_NAN_SUB (double *X, size_t N, WORD nMethod, WORD WGH, WORD KRNL, WORD P)
 
int __stdcall NDK_HASNA (const double *X, size_t nSize, BOOL intermediate)
 

Resampling

resampling API functions calls

int __stdcall NDK_RESAMPLE (double *pData, size_t nSize, BOOL isStock, double relSampling, IMPUTATION_METHOD method, double *pOutData, size_t *newSize)
 
int __stdcall NDK_INTERP_BROWN (double *pData, size_t nSize)
 

Smoothing

Smoothing API functions calls

int __stdcall NDK_WMA (double *pData, size_t nSize, BOOL bAscending, double *weights, size_t nwSize, int nHorizon, double *retVal)
 
int __stdcall NDK_MA (double *pData, size_t nSize, BOOL bAscending, int nWindowSize, int nVariant, double *internals, size_t nInternalsSize, double *retVal)
 
int __stdcall NDK_EMA (double *pData, size_t nSize, BOOL bAscending, int nWindowSize, int nVariant, double *internals, size_t nInternalsSize, double *retVal)
 
int __stdcall NDK_SESMTH (double *pData, size_t nSize, BOOL bAscending, double *alpha, int nHorizon, BOOL bOptimize, double *internals, size_t nInternalsSize, double *retVal)
 
int __stdcall NDK_DESMTH (double *pData, size_t nSize, BOOL bAscending, double *alpha, double *beta, int xlHorizon, BOOL bOptimize, double *internals, size_t nInternalsSize, WORD wInternalSeries, double *retVal)
 
int __stdcall NDK_LESMTH (double *pData, size_t nSize, BOOL bAscending, double *alpha, int xlHorizon, BOOL bOptimize, double *internals, size_t nInternalsSize, WORD wInternalSeries, double *retVal)
 
int __stdcall NDK_TESMTH (double *pData, size_t nSize, BOOL bAscending, double *alpha, double *beta, double *gamma, int L, int nHorizon, BOOL bOptimize, double *internals, size_t nInternalsSize, WORD wInternalSeries, double *retVal)
 
int __stdcall NDK_GESMTH (double *pData, size_t nSize, BOOL bAscending, double *alpha, double *beta, double *gamma, double *phi, double *lambda, WORD TrendType, WORD SeasonalityType, int seasonLength, int nHorizon, BOOL bOptimize, BOOL bAutoCorrelationAdj, BOOL bLogTransform, double *internals, size_t nInternalsSize, WORD wInternalSeries, double *retVal)
 
int __stdcall NDK_TREND (double *pData, size_t nSize, BOOL bAscending, WORD nTrendType, WORD argPolyOrder, BOOL AllowIntercep, double InterceptVal, int nHorizon, WORD retType, double argAlpha, double *retVal)
 

Multiple Linear Regression (MLR)

int __stdcall NDK_SLR_PARAM (double *pXData, size_t nXSize, double *pYData, size_t nYSize, double intercept, double alpha, WORD nRetType, WORD ParamIndex, double *retVal)
 
int __stdcall NDK_SLR_FORE (double *pXData, size_t nXSize, double *pYData, size_t nYSize, double intercept, double target, double alpha, WORD nRetType, double *retVal)
 
int __stdcall NDK_SLR_FITTED (double *pXData, size_t nXSize, double *pYData, size_t nYSize, double intercept, WORD nRetType)
 
int __stdcall NDK_SLR_ANOVA (double *pXData, size_t nXSize, double *pYData, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 
int __stdcall NDK_SLR_GOF (double *pXData, size_t nXSize, double *pYData, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 
int __stdcall NDK_MLR_PARAM (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, double alpha, WORD nRetType, WORD nParamIndex, double *retVal)
 
int __stdcall NDK_MLR_FORE (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, double *target, double alpha, WORD nRetType, double *retVal)
 
int __stdcall NDK_MLR_FITTED (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, WORD nRetType)
 
int __stdcall NDK_MLR_ANOVA (double **pXData, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 
int __stdcall NDK_MLR_GOF (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 
int __stdcall NDK_MLR_PRFTest (double **X, size_t nXSize, size_t nXVars, double *Y, size_t nYSize, double intercept, LPBYTE mask1, size_t nMaskLen1, LPBYTE mask2, size_t nMaskLen2, double alpha, WORD nRetType, double *retVal)
 
int __stdcall NDK_MLR_STEPWISE (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, double alpha, WORD nMode)
 

Principal Component Analysis (PCA) <br>

int __stdcall NDK_PCA_COMP (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, WORD standardize, WORD nCompIndex, WORD retType, double *retVal, size_t nOutSize)
 
int __stdcall NDK_PCA_VAR (double **X, size_t nXSize, size_t nXVars, LPBYTE varMask, size_t nMaskLen, WORD standardize, WORD nVarIndex, WORD wMacPC, WORD retType, double *retVal, size_t nOutSize)
 
int __stdcall NDK_PCR_PARAM (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, double alpha, WORD nRetType, WORD nParamIndex, double *retVal)
 
int __stdcall NDK_PCR_FORE (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, double *target, double alpha, WORD nRetType, double *retVal)
 
int __stdcall NDK_PCR_FITTED (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, WORD nRetType)
 
int __stdcall NDK_PCR_ANOVA (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 
int __stdcall NDK_PCR_GOF (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 
int __stdcall NDK_PCR_PRFTest (double **X, size_t nXSize, size_t nXVars, double *Y, size_t nYSize, double intercept, LPBYTE mask1, size_t nMaskLen1, LPBYTE mask2, size_t nMaskLen2, double alpha, WORD nRetType, double *retVal)
 
int __stdcall NDK_PCR_STEPWISE (double **X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *Y, size_t nYSize, double intercept, double alpha, WORD nMode)
 

GLM

Gneralized Linear Model Functions

int __stdcall NDK_GLM_VALIDATE (double *betas, size_t nBetas, double phi, WORD Lvk)
 
int __stdcall NDK_GLM_GOF (double *Y, size_t nSize, double **X, size_t nVars, double *betas, size_t nBetas, double phi, WORD Lvk, WORD retType, double *retVal)
 
int __stdcall NDK_GLM_RESID (double *Y, size_t nSize, double **X, size_t nVars, double *betas, size_t nBetas, double phi, WORD Lvk, WORD retType)
 
int __stdcall NDK_GLM_PARAM (double *Y, size_t nSize, double **X, size_t nVars, double *betas, size_t nBetas, double *phi, WORD Lvk, WORD retType, size_t maxIter)
 
int __stdcall NDK_GLM_FORE (double *X, size_t nVars, double *betas, size_t nBetas, double phi, WORD Lvk, WORD retType, double alpha, double *retval)
 
int __stdcall NDK_GLM_FITTED (double *Y, size_t nSize, double **X, size_t nVars, double *betas, size_t nBetas, double phi, WORD Lvk, WORD retType)
 

ARMA

The ARMA model is a tool for understanding and forecasting future values in a given time series. The model consists of two parts: an autoregressive component, i.e. AR(p), and a moving average component, i.e. MA(q), and it is referred to as ARMA(p,q).

int __stdcall NDK_ARMA_GOF (double *pData, size_t nSize, double mean, double sigma, double *phis, size_t p, double *thetas, size_t q, WORD retType, double *retVal)
 
int __stdcall NDK_ARMA_RESID (double *pData, size_t nSize, double mean, double sigma, double *phis, size_t p, double *thetas, size_t q, WORD retType)
 
int __stdcall NDK_ARMA_PARAM (double *pData, size_t nSize, double *mean, double *sigma, double *phis, size_t p, double *thetas, size_t q, MODEL_RETVAL_FUNC retType, size_t maxIter)
 
int __stdcall NDK_ARMA_FORE (double *pData, size_t nSize, double mean, double sigma, double *phis, size_t p, double *thetas, size_t q, size_t nStep, FORECAST_RETVAL_FUNC retType, double alpha, double *retVal)
 
int __stdcall NDK_ARMA_FITTED (double *pData, size_t nSize, double mean, double sigma, double *phis, size_t p, double *thetas, size_t q, FIT_RETVAL_FUNC retType)
 
int __stdcall NDK_ARMA_VALIDATE (double mean, double sigma, double *phis, size_t p, double *thetas, size_t q)
 
int __stdcall NDK_ARMA_SIM (double mean, double sigma, double *phis, size_t p, double *thetas, size_t q, double *pData, size_t nSize, UINT nSeed, double *retArray, size_t nSteps)
 

ARIMA

ARIMA model functions

int __stdcall NDK_ARIMA_VALIDATE (double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q)
 
int __stdcall NDK_ARIMA_GOF (double *X, 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)
 
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)
 
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)
 
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)
 
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)
 

FARIMA

Fractional ARIMA model 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, WORD retType, double *retVal)
 
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)
 
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, WORD retType, size_t maxIter)
 
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)
 
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, WORD retType, double *retVal)
 
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, WORD retType)
 

SARIMA

Seasonal ARIMA model functions

int __stdcall NDK_SARIMA_GOF (double *pData, size_t nSize, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, GOODNESS_OF_FIT_FUNC retType, double *retVal)
 
int __stdcall NDK_SARIMA_PARAM (double *pData, size_t nSize, double *mean, double *sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, MODEL_RETVAL_FUNC retType, size_t maxIter)
 
int __stdcall NDK_SARIMA_SIM (double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, double *pData, size_t nSize, size_t nSeed, double *retVal, size_t nStep)
 
int __stdcall NDK_SARIMA_FORE (double *pData, size_t nSize, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, size_t nStep, FORECAST_RETVAL_FUNC retType, double alpha, double *retVal)
 
int __stdcall NDK_SARIMA_FITTED (double *pData, size_t nSize, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, FIT_RETVAL_FUNC retType)
 
int __stdcall NDK_SARIMA_VALIDATE (double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ)
 

AirLine

AirLine model functions

int __stdcall NDK_AIRLINE_GOF (double *pData, size_t nSize, double mean, double sigma, WORD S, double theta, double theta2, GOODNESS_OF_FIT_FUNC retType, double *retVal)
 
int __stdcall NDK_AIRLINE_RESID (double *pData, size_t nSize, double mean, double sigma, WORD S, double theta, double theta2, RESID_RETVAL_FUNC retType)
 
int __stdcall NDK_AIRLINE_PARAM (double *pData, size_t nSize, double *mean, double *sigma, WORD S, double *theta, double *theta2, MODEL_RETVAL_FUNC retType, size_t maxIter)
 
int __stdcall NDK_AIRLINE_FORE (double *pData, size_t nSize, double mean, double sigma, WORD S, double theta, double theta2, size_t nStep, FORECAST_RETVAL_FUNC retType, double alpha, double *retVal)
 
int __stdcall NDK_AIRLINE_SIM (double *pData, size_t nSize, double mean, double sigma, WORD S, double theta, double theta2, UINT nSeed, double *retArray, size_t nSteps)
 
int __stdcall NDK_AIRLINE_FITTED (double *pData, size_t nSize, double mean, double sigma, WORD S, double theta, double theta2, FIT_RETVAL_FUNC retType)
 
int __stdcall NDK_AIRLINE_VALIDATE (double mean, double sigma, WORD S, double theta, double theta2)
 

X12-ARIMA

Seasonal ajustments using X12-ARIMA API functions calls

int __stdcall NDK_X12_ENV_INIT (BOOL override)
 
int __stdcall NDK_X12_ENV_CLEANUP (void)
 
int __stdcall NDK_X12_SCEN_INIT (LPCTSTR szScenarioName, LPVOID X12Options, size_t *ulModelHash)
 
int __stdcall NDK_X12_SCEN_READ (LPCTSTR szScenarioName, LPVOID X12Options, size_t *ulModelHash)
 
int __stdcall NDK_X12_SCEN_CLEAUP (LPCTSTR szScenarioName)
 
int __stdcall NDK_X12_DATA_FILE (LPCTSTR szScenarioName, double *X, size_t nLen, BOOL monthly, LONG startDate, WORD reserved, size_t *ulDataHash)
 
int __stdcall NDK_X12_READ_DATA_FILE (LPCTSTR szScenarioName, double *pData, size_t nLen, WORD fileType, size_t *ulDataHash)
 
int __stdcall NDK_X12_SPC_FILE (LPCTSTR szScenarioName, LPVOID X12Options, size_t *ulModelHash)
 
int __stdcall NDK_X12_RUN_BATCH (LPCTSTR szScenarioName, LPCTSTR szBatchFile, LPWORD status)
 
int __stdcall NDK_X12_RUN_SCENARIO (LPCTSTR szScenarioName, LPWORD status)
 
int __stdcall NDK_X12_RUN_STAT (LPCTSTR szScenarioName, LPWORD status, LPTSTR szMsg, size_t *nLen)
 
int __stdcall NDK_X12_OUT_FILE (LPCTSTR szScenarioName, WORD retType, LPTSTR szOutFile, size_t *nLen, BOOL OpenFileFlag)
 
int __stdcall NDK_X12_OUT_SERIES (LPCTSTR szScenarioName, WORD nComponent, double *pData, size_t *nLen)
 
int __stdcall NDK_X12_FORE_SERIES (LPCTSTR szScenarioName, size_t nStep, WORD retType, double *pData)
 

X13ARIMA-SEATS

X13ARIMA-SEATS model functions

int __stdcall NDK_X13AS_ENV_CLEANUP (void)
 
int __stdcall NDK_X13AS_SCEN_INIT (LPCTSTR szScenarioName, LPCTSTR X13Options, size_t *ulModelHash)
 
int __stdcall NDK_X13AS_SCEN_SPEC (LPCTSTR szScenarioName, LPTSTR szOutBuffer, size_t *pLen)
 
int __stdcall NDK_X13AS_SCEN_PATH (LPCTSTR szScenarioName, LPTSTR szOutBuffer, size_t *pLen)
 
int __stdcall NDK_X13AS_SCEN_REFRESH (LPCTSTR szScenarioName)
 
int __stdcall NDK_X13AS_SCEN_CLEAUP (LPCTSTR szScenarioName)
 
int __stdcall NDK_X13AS_DATA_STARTOFFSET (double *pData, size_t nLen, size_t nForecastPeriods, size_t *startIndex)
 
int __stdcall NDK_X13AS_WRITE_DATA_FILE (LPCTSTR szScenarioName, LPCTSTR szOutputFile, double *X, size_t nLen, WORD freq, LONG startDate, WORD reserved, size_t *ulDataHash)
 
int __stdcall NDK_X13AS_WRITE_FACTORS_FILE (LPCTSTR szScenarioName, LPCTSTR szOutputFile, double **pXData, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, WORD freq, LONG startDate, WORD reserved, size_t *ulDataHash)
 
int __stdcall NDK_X13AS_READ_DATA_FILE (LPCTSTR szScenarioName, LPCTSTR szDataFileName, WORD freq, double *pData, size_t *pLen, LONG *startDate, WORD fileType, size_t *ulDataHash)
 
int __stdcall NDK_X13AS_READ_FACTORS_FILE (LPCTSTR szScenarioName, LPCTSTR szOutputFile, double **pXData, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, LPLONG startDate, WORD freq, WORD reserved, size_t *ulDataHash)
 
int __stdcall NDK_X13AS_WRITE_SPC_FILE (LPCTSTR szSPCFilename, LPCTSTR szOptions, size_t *ulModelHash)
 
int __stdcall NDK_X13AS_READ_SPC_FILE (LPCTSTR szSPCFilename, LPTSTR szOptions, size_t *nLen, size_t *ulModelHash)
 
int __stdcall NDK_X13AS_RUN_SPC_FILE (LPCTSTR szScenarioName, BOOL bValidateOnly)
 
int __stdcall NDK_X13AS_SCEN_ERROR_STATUS (LPCTSTR szScenarioName, LPTSTR szStatus, size_t *nLen)
 
int __stdcall NDK_X13AS_OUT_FILE (LPCTSTR szScenarioName, WORD retType, LPTSTR szOutFile, size_t *nLen, BOOL OpenFileFlag)
 
int __stdcall NDK_X13AS_OUT_SERIES (LPCTSTR szScenarioName, LPCTSTR szComponent, WORD freq, double *pData, size_t *nLen, LONG *startDate)
 
int __stdcall NDK_X13AS_FORE_SERIES (LPCTSTR szScenarioName, WORD freq, LONG dateSerial, WORD retType, double *pData)
 
int __stdcall NDK_X13AS_ADD_OUTPUT_SERIES (LPCTSTR szScenarioName, LPCTSTR szComponent)
 
int __stdcall NDK_X13AS_GET_PROP (LPCTSTR szScenarioName, LPCTSTR szPropert, LPTSTR szOutBuffer, size_t *pLen)
 
int __stdcall NDK_X13AS_SET_PROP (LPCTSTR szScenarioName, LPCTSTR szPropert, LPCTSTR szOutBuffer)
 
int __stdcall NDK_X13AS_GET_METADATA (LPCTSTR szScenarioName, LPCTSTR szkey, LPTSTR szOutBuffer, size_t *pLen)
 
int __stdcall NDK_X13AS_SET_METADATA (LPCTSTR szScenarioName, LPCTSTR szkey, LPCTSTR szValue)
 
int __stdcall NDK_X13AS_DATE_TO_DATEVALUE (LONG serialDate, WORD freq, LPTSTR szDateTxt, size_t *nLen)
 
int __stdcall NDK_X13AS_DATEVALE_TO_DATE (LPCTSTR szDateTxt, WORD freq, LONG *serialDate)
 

SARIMAX

Seasonal ARIMA-X model functions

int __stdcall NDK_SARIMAX_GOF (double *pData, double **pFactors, size_t nSize, size_t nFactors, double *fBetas, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, GOODNESS_OF_FIT_FUNC retType, double *retVal)
 
int __stdcall NDK_SARIMAX_VALIDATE (double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ)
 
int __stdcall NDK_SARIMAX_FITTED (double *pData, double **pFactors, size_t nSize, size_t nFactors, double *fBetas, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, FIT_RETVAL_FUNC retType)
 
int __stdcall NDK_SARIMAX_PARAM (double *pData, double **pFactors, size_t nSize, size_t nFactors, double *fBetas, double *mean, double *sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, MODEL_RETVAL_FUNC retType, size_t maxIter)
 
int __stdcall NDK_SARIMAX_FORE (double *pData, double **pFactors, size_t nSize, size_t nFactors, double *fBetas, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, size_t nStep, FORECAST_RETVAL_FUNC retType, double alpha, double *retVal)
 
int __stdcall NDK_SARIMAX_SIM (double *fBetas, size_t nFactors, double mean, double sigma, WORD nIntegral, double *phis, size_t p, double *thetas, size_t q, WORD nSIntegral, WORD nSPeriod, double *sPhis, size_t sP, double *sThetas, size_t sQ, double *pData, double **pFactors, size_t nSize, UINT nSeed, size_t nStep, double *retVal)
 

GARCH

GARCH 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)
 

EGARCH

EGARCH 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)
 

GARCH-M

GARCH-M Functions

int __stdcall NDK_GARCHM_GOF (double *pData, size_t nSize, double mu, double flambda, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu, WORD retType, double *retVal)
 
int __stdcall NDK_GARCHM_RESID (double *pData, size_t nSize, double mu, double flambda, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu, WORD retType)
 
int __stdcall NDK_GARCHM_PARAM (double *pData, size_t nSize, double *mu, double *flambda, double *Alphas, size_t p, double *Betas, size_t q, WORD nInnovationType, double *nu, WORD retType, size_t maxIter)
 
int __stdcall NDK_GARCHM_SIM (double mu, double flambda, 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_GARCHM_FORE (double *pData, size_t nSize, double *sigmas, size_t nSigmaSize, double mu, double flambda, 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_GARCHM_FITTED (double *pData, size_t nSize, double mu, double flambda, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu, WORD retType)
 
int __stdcall NDK_GARCHM_LRVAR (double mu, double flambda, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu, double *retVal)
 
int __stdcall NDK_GARCHM_VALIDATE (double mu, double flambda, const double *Alphas, size_t p, const double *Betas, size_t q, WORD nInnovationType, double nu)
 

Speactral Analysis

int __stdcall NDK_CONVOLUTION (double *X, size_t N1, double *Y, size_t N2, double *Z, size_t *W)
 
int __stdcall NDK_IDFT (double *amp, double *phase, size_t nSize, double *X, size_t N)
 
int __stdcall NDK_DFT (double *X, size_t N, double *retAmp, double *retPhase, size_t M)
 
int __stdcall NDK_HodrickPrescotFilter (double *X, size_t N, BOOL bAscending, double lambda)
 
int __stdcall NDK_BaxterKingFilter (double *X, size_t N, BOOL bAscending, size_t freq_min, size_t freq_max, size_t K, BOOL drift, BOOL unitroot, WORD retTYpe)
 
int __stdcall NDK_DMA_WGHTS (const double *pOuterWeights, size_t M, const double *pInnerWeights, size_t K, double *pterms, size_t *pSize)
 
int __stdcall NDK_CMA_WGHTS (size_t M, double *pterms, size_t *pSize)
 
int __stdcall NDK_BMA_WGHTS (size_t M, double *pterms, size_t *pSize)
 
int __stdcall NDK_HMA_WGHTS (size_t M, double *pterms, size_t *pSize)
 
int __stdcall NDK_SMA_WGHTS (size_t M, double *pterms, size_t *pSize)
 
int __stdcall NDK_CMA (double *X, size_t N, BOOL bAscending, const double *pWeights, size_t K, BOOL bEndPoints)
 

Portfolio Analysis

int __stdcall NDK_PORTFOLIO_RET (double *weights, size_t nAssets, double *returns, double *ret)
 
int __stdcall NDK_PORTFOLIO_VARIANCE (double *weights, size_t nAssets, double **covar, double *variance)
 
int __stdcall NDK_PORTFOLIO_COVARIANCE (double *weights1, double *weights2, size_t nAssets, double **covar, double *retVal)
 
int __stdcall NDK_CAGR (double endValue, double startValue, double time, double *retVal)
 
int __stdcall NDK_PORTFOLIO_CAGR (double *returns, size_t nLen, WORD frequency, double *retVal)
 
int __stdcall NDK_PORTFOLIO_MDD (double *returns, size_t nLen, double *retVal)
 
int __stdcall NDK_PORTFOLIO_MCR (double *returns, double *index, size_t nLen, BOOL downside, WORD frequency, double *retVal)
 
int __stdcall NDK_PORTFOLIO_DWSDEV (double *returns, size_t nLen, double MAR, double *retVal)
 
int __stdcall NDK_PORTFOLIO_VaR (double *returns, size_t nLen, double confidence, WORD argOptMethod, WORD argKDEMethod, WORD argTheoDist, double *retVal)
 
int __stdcall NDK_PORTFOLIO_CVaR (double *returns, size_t nLen, double confidence, WORD argOptMethod, WORD argKDEMethod, WORD argTheoDist, double *argVaR, double *retVal)
 
int __stdcall NDK_PORTFOLIO_CAPM (double *returns, double *benchmark, double *Rf, size_t nLen, WORD frequency, double *retBeta, double *retAlpha)
 
int __stdcall NDK_PORTFOLIO_RISK_RATIO (double *returns, double *riskfree, size_t nLen, WORD frequency, double beta, WORD ratioType, double *retVal)
 

Data Fitting

int __stdcall NDK_INTERPOLATE (double *pXData, size_t nXSize, double *pYData, size_t nYSize, double *pXTargets, size_t nXTargetSize, WORD nMethod, BOOL allowExtrp, double *pYTargets, size_t nYTargetSize)
 
int __stdcall NDK_KNN_REGRESSION (double *pXData, size_t nXSize, double *pYData, size_t nYSize, size_t *pK, WORD nMethod, WORD KernelFn, BOOL optimize, double *pCVRMSE, double *pXTargets, size_t nXTargetSize, double *pYForecastValues, size_t nYTargetValuesSize, double *pYForecastErrors, size_t nYTargetErrorsSize)
 
int __stdcall NDK_KRNL_REGRESSION (double *pXData, size_t nXSize, double *pYData, size_t nYSize, WORD POrder, WORD nKernelFunc, double *pAlpha, BOOL optimize, double *pCVRMSE, double *pXTargets, size_t nXTargetSize, double *pYForecastValues, size_t nYTargetValuesSize, double *pYForecastErrors, size_t nYTargetErrorsSize)
 
int __stdcall NDK_LOCAL_REGRESSION (double *pXData, size_t nXSize, double *pYData, size_t nYSize, WORD POrder, WORD nKernelFunc, double *pSpan, BOOL optimize, double *pCVRMSE, double *pXTargets, size_t nXTargetSize, double *pYForecastValues, size_t nYTargetValuesSize, double *pYForecastErrors, size_t nYTargetErrorsSize)
 
int __stdcall NDK_KRNL_INTERPOLATE (double *X, size_t Nx, double *Y, size_t Ny, double *XT, size_t Nxt, WORD KernelFn, double *kernelParam, BOOL bOptimize, BOOL extrapolate, double *YVals, size_t Nyvals, double *pCV)
 
int __stdcall NDK_INTRPLT2D (const double **pXData, size_t nXSize, size_t nXVars, const LPBYTE mask, size_t nMaskLen, WORD nMethod, BOOL extrapolate, double **target, size_t ntargetSize)
 
int __stdcall NDK_INFO (int nRetType, LPTSTR szMsg, int nSize)
 
int __stdcall NDK_MSG (int nRetCode, LPTSTR pMsg, size_t nSize)
 
int __stdcall NDK_DEFAULT_EDITOR (LPTSTR szFullPath, size_t *nSize)
 
int __stdcall NDK_TOKENIZE (LPCTSTR szTxt, LPCTSTR szDelim, short nOrder, LPTSTR pRetVal, size_t *pSize)
 
int __stdcall NDK_REGEX_MATCH (LPCTSTR szLine, LPCTSTR szPattern, BOOL ignoreCase, BOOL partialOK, BOOL *bMatch)
 
int __stdcall NDK_REGEX_REPLACE (LPCTSTR szLine, LPCTSTR szKey, LPCTSTR szValue, BOOL ignoreCase, BOOL global, LPTSTR pRetVal, size_t *nSize)
 
int __stdcall NDK_REGRESSION (double *X, size_t nX, double *Y, size_t nY, WORD nRegressType, WORD POrder, double intercept, double target, WORD nRetType, double alpha, double *retVal)
 

NumXL Logging APIs

3

◆ X12ARIMA_OPTIONS

Data structure to capture X-12-ARIMA options.

6

◆ ADFTEST_OPTION

See also
NDK_ADFTEST()
Enumerator
ADFTEST_DRIFT_ONLY 

Model 1: A stochastic drift.

ADFTEST_DRIFT_N_CONST 

Model II: A deterministic constant and stochastic drift.

ADFTEST_DRIFT_N_TREND 

Model III: A deterministic trend and stochastic drift.

ADFTEST_DRIFT_N_CONST_N_TREND 

Model IV: A deterministic constant, trend and stochastic drift.

ADFTEST_DRIFT_N_CONST_TREND_TREND2 

Model V: A deterministic constant, trend, trend^2 and stochastic drift.

◆ COLNRTY_TEST_TYPE

multi-colinearity test method

See also
NDK_COLNRTY_TEST()
Enumerator
COLNRTY_CN 

Condition Number.

COLNRTY_VIF 

Variation Inflation Factor (VIF)

COLNRTY_DET 

Determinant.

COLNRTY_EIGEN 

Eigenvalues.

◆ CORRELATION_METHOD

Support correlation methods.

See also
NDK_XCFTEST(), NDK_XCF()
Enumerator
XCF_PEARSON 

Pearson.

XCF_SPEARMAN 

Spearman.

XCF_KENDALL 

Kendall.

◆ FIT_RETVAL_FUNC

See also
NDK_ARMA_FIT()
Enumerator
FIT_MEAN 

Fitted conditional mean.

FIT_STDEV 

Fitted conditional volatility or standard deviation.

FIT_RESID 

Raw residuals (actual - fitted mean)

FIT_STD_RESID 

Standardized residuals - (actual - fitted mean)/fitted volatility.

◆ FORECAST_RETVAL_FUNC

See also
NDK_ARMA_FORE()
Enumerator
FORECAST_MEAN 

Mean forecast value.

FORECAST_STDEV 

Forecast standard error (aka local volatility)

FORECAST_TS_STDEV 

Volatility term structure.

FORECAST_LL 

Lower limit of the forecast confidence interval.

FORECAST_UL 

Upper limit of the forecast confidence interval.

◆ GLM_LINK_FUNC

Supported Link function.

See also
NDK_GLM_GOF()
Enumerator
GLM_LVK_IDENTITY 

Identity (default)

GLM_LVK_LOG 

Log.

GLM_LVK_LOGIT 

Logit.

GLM_LVK_PROBIT 

Probit.

GLM_LVK_CLOGLOG 

Complementary log-log.

◆ GOODNESS_OF_FIT_FUNC

See also
NDK_GLM_GOF()
Enumerator
GOF_LLF 

Log-likelihood goodness of fit measure.

GOF_AIC 

Akaike information criterion goodness of fit measure.

GOF_BIC 

Bayesian or Schwartz information criterion goodness of fit measure.

GOF_HQC 

Hannan�Quinn information criterion goodness of fit measure.

GOF_RSQ 

R-squared goodness of fit measure.

GOF_ARSQ 

Adjusted R-squared goodness of fit measure.

◆ IMPUTATION_METHOD

Imputation methods for resampling.

See also
NDK_RESAMPLE()
Enumerator
IMPUTATION_NONE 

don't process the input data

IMPUTATION_INTERPOLATE_FWD 

flat forward

IMPUTATION_INTERPOLATE_BKWD 

flat backward

IMPUTATION_INTERPOLATE_LINEAR 

Linear interpolation.

IMPUTATION_INTERPOLATE_CSPLINE 

cubic spline

IMPUTATION_FFT 

Fast Fourier transform.

◆ INNOVATION_TYPE

Supported innovation types.

See also
NDK_GARCH_PARAM(),
Enumerator
INNOVATION_GAUSSIAN 

Gaussian or normal distribution.

INNOVATION_TDIST 

Standardized student's T-distribution.

INNOVATION_GED 

Standardized generalized error distribution (GED)

◆ MODEL_RETVAL_FUNC

See also
NDK_ARMA_PARAM()
Enumerator
PARAM_GUESS 

Quick guess (non-optimal) of parameters values.

PARAM_CALIBRATE 

Run a calibration process to find optimal values for the model's parameters.

PARAM_ERROR 

Compute the standard error of the parameters' values.

◆ NORMALTEST_METHOD

See also
NDK_NORMALTEST()
Enumerator
NORMALTEST_JB 

Jacque-Berra.

NORMALTEST_WS 

Shapiro-Wilson.

NORMALTEST_CHISQ 

Chi-Square test - Doornik and Hansen, "An Omnibus Test for Normality", 1994.

◆ PERIODOGRAM_OPTION_TYPE

Periodogram method options.

See also
NDK_PERIODOGRAM()
Enumerator
PERIODOGRAM_NONE 

don't process the input data

PERIODOGRAM_DETREND 

detrend the input data

PERIODOGRAM_DIFFERENCE 

difference the time series (1,1)

PERIODOGRAM_AUTOPROC 

Auto-process (e.g. detrend, difference, etc.) the input data.

◆ RESID_RETVAL_FUNC

See also
NDK_ARMA_RESID()
Enumerator
RESIDS_STD 

Standardized residuals.

RESIDS_RAW 

Raw residuals.

◆ TEST_RETURN

Supported statistical test outputs.

See also
NDK_MEANTEST()
Enumerator
TEST_PVALUE 

P-value.

TEST_SCORE 

Test statistics (aka score)

TEST_CRITICALVALUE 

Critical value.

◆ TREND_TYPE

enum TREND_TYPE

Supported innovation types.

See also
NDK_TREND()
Enumerator
TREND_LINEAR 

Linear time trend.

TREND_POLYNOMIAL 

Polynomial time trend.

TREND_EXPONENTIAL 

Exponential time trend.

TREND_LOGARITHMIC 

Logarithmic time trend.

TREND_POWER 

Power time trend.

◆ X11_SEASONALMA_TYPE

Enumerator
X11_SEASONALMA_DEFAULT 

3x3 MA and 3x5

X11_SEASONALMA_MSR 

X-11-ARIMA88.

◆ X13TRANSFORM_METHOD

Enumerator
X13TRANSFOR_NONE 

don't process the input data

X13TRANSFOR_AUTO 

don't process the input data

X13TRANSFOR_LOG 

don't process the input data

X13TRANSFOR_SQRT 

don't process the input data

X13TRANSFOR_INV 

don't process the input data

X13TRANSFOR_LOGIST 

don't process the input data

X13TRANSFOR_BOXCOX 

don't process the input data

Functions

◆ NDK_ACF()

int __stdcall NDK_ACF ( double * X,
size_t N,
size_t K,
WORD method,
double * retVal )

Calculates the sample autocorrelation function (ACF) of a stationary time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series is homogeneous or equally spaced.
2. The time series may include missing values (NaN) at either end.
3. The lag order (k) must be less than the time series size or else an error value (NDK_FAILED) is returned.
4. The ACF values are bound between -1 and 1, inclusive.
5. The sample autocorrelation is computed as:
  • $\hat{\rho}(h)=\frac{\sum_{k=h}^T{(y_{k}-\bar y)(y_{k-h}-\bar y)}}{\sum_{k=h}^T(y_{k}-\bar y)^2}$, where:
    • $y_{t}$ is the value of the time series at time t.
    • $h$ is the lag order.
    • $T$ is the number of non-missing values in the time series data.
    • $\bar y$ is the sample average/mean of the time series.
6. Special cases: -By definition, $\hat{\rho}(0)  \equiv 1.0$
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]methodis the method selecor (0 = sample autocorrelation, 1= periodogram-based estimate, 2= cross-correlation based estimate).
[out]retValis the calculated sample autocorrelation value.

◆ NDK_ACF_ERROR()

int __stdcall NDK_ACF_ERROR ( double * X,
size_t N,
size_t K,
WORD method,
double * retVal )

Calculates the standard error in the sample autocorrelation function.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ACF(), NDK_ACFCI()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]methodis the method selecor (0 = sample autocorrelation, 1= periodogram-based estimate, 2= cross-correlation based estimate).
[out]retValis the standard error in the sample autocorrelation value.

◆ NDK_ACFCI()

int __stdcall NDK_ACFCI ( double * X,
size_t N,
size_t K,
WORD method,
double alpha,
double * ULCI,
double * LLCI )

Calculates the confidence interval limits (upper/lower) for the autocorrelation function.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series is homogeneous or equally spaced.
2. The time series may include missing values (NaN) at either end.
3. The lag order (k) must be less than the time series size, or else an error value (NDK_FAILED) is returned.
4. The ACFCI function calculates the confidence limits as:
  • $\hat\rho_k - Z_{\alpha/2}\times \sigma_{\rho_k} \leq \rho_k \leq \hat\rho_k+ Z_{\alpha/2}\times \sigma_{\rho_k}$, where:
    • $\rho_k$ is the population autocorrelation function.
    • $\sigma_{\rho_k}$ is the standard error of the sample autocorrelation.
    • $\hat{\rho_{k}}$ is the sample autocorrelation function for lag k.
    • $Z\sim N(0,1)$
    • $P(\left|Z\right|\geq Z_{\alpha/2}) = \alpha$
5. For the case in which the underlying population distribution is normal, the sample autocorrelation also has a normal distribution:
  • $\hat \rho_k \sim N(\rho_k,\sigma_{\rho_k}^2)$, where:
    • $\hat \rho_k$ is the sample autocorrelation for lag k.
    • $\rho_k$ is the population autocorrelation for lag k.
    • $\sigma_{\rho_k}$ is the standard error of the sample autocorrelation for lag k.
6. Bartlett proved that the variance of the sample autocorrelation of a stationary normal stochastic process (i.e. independent, identically normal distributed errors) can be formulated as:
  • $\sigma_{\rho_k}^2 = \frac{\sum_{j=-\infty}^{\infty}\rho_j^2+\rho_{j+k}\rho_{j-k}-4\rho_j\rho_k\rho_{i-k}+2\rho_j^2\rho_k^2}{T}$
7. Furthermore, the variance of the sample autocorrelation is reformulated:
  • $\sigma_{\rho_k}^2 = \frac{1+\sum_{j=1}^{k-1}\hat\rho_j^2}{T}$, where:
    • $\sigma_{\rho_k}$ is the standard error of the sample autocorrelation for lag k.
    • $T$ is the sample data size.
    • $\hat\rho_j$ is the sample autocorrelation function for lag j.
    • $k$ is the lag order.
See also
NDK_ACF(), NDK_ACF_ERROR()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]methodis the method selecor (0 = sample autocorrelation, 1= periodogram-based estimate, 2= cross-correlation based estimate).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]ULCIis the upper limit value of the confidence interval
[out]LLCIis the lower limit value of the confidence interval.

◆ NDK_ACFTEST()

int __stdcall NDK_ACFTEST ( double * X,
size_t N,
int K,
WORD method,
double target,
double alpha,
WORD retType,
double * retVal )

Calculates the p-value of the statistical test for the population autocorrelation function.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
SFMacros.h, NDK_WMA(), NDK_EWMA()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]methodis the type of test: parametric or non-parametric.
[in]targetis the assumed autocorrelation function value. If missing, the default of zero is assumed.
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[out]retValis the calculated test statistics.

◆ NDK_ADD()

int __stdcall NDK_ADD ( double * X,
size_t N1,
const double * Y,
size_t N2 )

Returns an array of cells for the sum of two time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_SUB(), NDK_SCALE()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]N1is the number of observations in X.
[in]Yis the second univariate time series data (a one dimensional array).
[in]N2is the number of observations in Y.

◆ NDK_ADFTEST()

int __stdcall NDK_ADFTEST ( double * X,
size_t N,
WORD K,
ADFTEST_OPTION options,
BOOL testDown,
double alpha,
WORD method,
WORD retType,
double * retVal )

Returns the p-value of the Augmented Dickey-Fuller (ADF) test, which tests for a unit root in the time series sample.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_NORMALTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_SKEWTEST()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag length of the autoregressive process. If missing, an initial value equal to the cubic root of the input data size is used.
[in]optionsis the model description flag for the Dickey-Fuller test variant (1=no constant, 2=contant-only, 3=trend only, 4=constant and trend, 5=const, trend and trend squared).
[in]testDownis the mode of testing. If set to TRUE (default), ADFTest performs a series of tests. The test starts with the input length lag, but the actual length lag order used is obtained by testing down.
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]methodis the statistical test to perform (1=ADF).
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[in,out]retValis the calculated test statistics.

◆ NDK_AIRLINE_FITTED()

int __stdcall NDK_AIRLINE_FITTED ( double * pData,
size_t nSize,
double mean,
double sigma,
WORD S,
double theta,
double theta2,
FIT_RETVAL_FUNC retType )

Returns the fitted values of the conditional mean.

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 mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.
4. The season length must be greater than one.
5. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
6. The input argument for the non-seasonal MA parameter - theta - is optional and can be omitted, in which case no non-seasonal MA component is included.
7. The input argument for the seasonal MA parameter - theta2 - is optional and can be omitted, in which case no seasonal MA component is included.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]Sis the length of seasonality (expressed in terms of lags, where s > 1).
[in]thetais the coefficient of first-lagged innovation (see model description).
[in]theta2is the coefficient of s-lagged innovation (see model description).
[in]retTypeis a switch to select a output type ( see FIT_RETVAL_FUNC).

◆ NDK_AIRLINE_FORE()

int __stdcall NDK_AIRLINE_FORE ( double * pData,
size_t nSize,
double mean,
double sigma,
WORD S,
double theta,
double theta2,
size_t nStep,
FORECAST_RETVAL_FUNC 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 long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
5. The season length must be greater than one.
6. The input argument for the non-seasonal MA parameter - theta - is optional and can be omitted, in which case no non-seasonal MA component is included.
7. The input argument for the seasonal MA parameter - theta2 - is optional and can be omitted, in which case no seasonal MA component is included.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]Sis the length of seasonality (expressed in terms of lags, where s > 1).
[in]thetais the coefficient of first-lagged innovation (see model description).
[in]theta2is the coefficient of s-lagged innovation (see model description).
[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 (see FORECAST_RETVAL_FUNC).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]retValis the calculated forecast value.

◆ NDK_AIRLINE_GOF()

int __stdcall NDK_AIRLINE_GOF ( double * pData,
size_t nSize,
double mean,
double sigma,
WORD S,
double theta,
double theta2,
GOODNESS_OF_FIT_FUNC retType,
double * retVal )

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

Note
1. The Airline model is a special case of multiplicative seasonal ARIMA model, and it assumes independent and normally distributed residuals with constant variance.
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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the model mean (i.e. $\mu$).
[in]sigmais the standard deviation ( $\sigma$) of the model's residuals/innovations.
[in]Sis the length of seasonality (expressed in terms of lags, where s > 1).
[in]thetais the coefficient of first-lagged innovation ( $\theta$)(see model description).
[in]theta2is the coefficient of s-lagged innovation ( $\Theta$) (see model description).
[in]retTypeis a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC).
[out]retValis the calculated value of the goodness of fit.

◆ NDK_AIRLINE_PARAM()

int __stdcall NDK_AIRLINE_PARAM ( double * pData,
size_t nSize,
double * mean,
double * sigma,
WORD S,
double * theta,
double * theta2,
MODEL_RETVAL_FUNC retType,
size_t maxIter )

Returns the initial/quick guess 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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in,out]meanis the model mean (i.e. mu).
[in,out]sigmais the standard deviation of the model's residuals/innovations.
[in]Sis the length of seasonality (expressed in terms of lags, where s > 1).
[in,out]thetais the coefficient of first-lagged innovation (see model description).
[in,out]theta2is the coefficient of s-lagged innovation (see model description.
[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_AIRLINE_RESID()

int __stdcall NDK_AIRLINE_RESID ( double * pData,
size_t nSize,
double mean,
double sigma,
WORD S,
double theta,
double theta2,
RESID_RETVAL_FUNC retType )

Returns an array of cells for the standardized residuals of a given AirLine 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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
Deprecated
this function is being replaced by NDK_AIRLINE_FITTED()
See also
NDK_AIRLINE_GOF(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]Sis the length of seasonality (expressed in terms of lags, where s > 1).
[in]thetais the coefficient of first-lagged innovation (see model description).
[in]theta2is the coefficient of s-lagged innovation (see model description).
[in]retTypeis a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC.

◆ NDK_AIRLINE_SIM()

int __stdcall NDK_AIRLINE_SIM ( double * pData,
size_t nSize,
double mean,
double sigma,
WORD S,
double theta,
double theta2,
UINT nSeed,
double * retArray,
size_t nSteps )

Calculates the out-of-sample conditional mean forecast.

Note
1. The time series is homogeneous or equally spaced.
2. The input data argument (i.e. latest observations) is optional. If omitted, a value of zero is assumed.
3. The time series may include missing values (e.g. NaN) at either end.
4. The $\epsilon$ are normally distributed with mean zero and unit standard deviation.
5. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.
6. The value of the residuals/innovations standard deviation (sigma) must be positive.
7. The season length must be greater than one.
8. The input argument for the non-seasonal MA parameter - theta - is optional and can be omitted, in which case no non-seasonal MA component is included.
9. The input argument for the seasonal MA parameter - theta2 - is optional and can be omitted, in which case no seasonal MA component is included.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_AIRLINE_VALIDATE(), NDK_AIRLINE_GOF(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_PARAM()
Parameters
[in]pDatais a univariate time series of the initial values (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]Sis the length of seasonality (expressed in terms of lags, where s > 1).
[in]thetais the coefficient of first-lagged innovation (see model description).
[in]theta2is the coefficient of s-lagged innovation (see model description).
[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_AIRLINE_VALIDATE()

int __stdcall NDK_AIRLINE_VALIDATE ( double mean,
double sigma,
WORD S,
double theta,
double theta2 )

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

Note
1. The Airline model is a special case of multiplicative seasonal ARIMA model, and it assumes independent and normally distributed residuals with constant variance.
2. The time series is homogeneous or equally spaced.
3. The time series may include missing values (e.g. NaN) at either end.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED()
Parameters
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]Sis the length of seasonality (expressed in terms of lags, where s > 1).
[in]thetais the coefficient of first-lagged innovation (see model description).
[in]theta2is the coefficient of s-lagged innovation (see model description).

◆ NDK_ARCHTEST()

int __stdcall NDK_ARCHTEST ( double * X,
size_t N,
size_t K,
double alpha,
WORD method,
WORD retType,
double * retVal )

Calculates the p-value of the ARCH effect test (i.e. the white-noise test for the squared time series).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_NORMALTEST(), NDK_ARCHTEST(),
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]methodis the statistical test to perform (1=Ljung-Box).
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[out]retValis the calculated test statistics.

◆ NDK_ARIMA_FITTED()

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.

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 integration order argument (d) must be a positive integer.
4. The long-run mean can take any value or may be omitted, in which case a zero value is assumed.
5. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARIMA_VALIDATE(), NDK_ARIMA_GOF(), NDK_ARIMA_SIM(), NDK_ARIMA_FORE(), NDK_ARIMA_PARAM()
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the model's integration order.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[in]retTypeis a switch to select a output type ( see FIT_RETVAL_FUNC).

◆ NDK_ARIMA_FORE()

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).

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 integration order argument (d) must be a positive integer.
4. The long-run mean can take any value or may be omitted, in which case a zero value is assumed.
5. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARIMA_VALIDATE(), NDK_ARIMA_GOF(), NDK_ARIMA_SIM(), NDK_ARIMA_FITTED(), NDK_ARIMA_PARAM()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the model's integration order.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[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 (see FORECAST_RETVAL_FUNC).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]retValis the calculated forecast value.

◆ NDK_ARIMA_GOF()

int __stdcall NDK_ARIMA_GOF ( double * X,
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 ARIMA 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 mean can take any value or be omitted, in which case a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARIMA_VALIDATE(), NDK_ARIMA_PARAM(), NDK_ARIMA_FORE(), NDK_ARIMA_FITTED(), NDK_ARIMA_SIM()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the model's integration order.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[in]retTypeis a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC).
[out]retValis the calculated GOF return value.

◆ NDK_ARIMA_PARAM()

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 the quick guess, optimal (calibrated) or std. errors of the values 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 integration order argument (d) must be a positive integer.
4. The long-run mean can take any value or may be omitted, in which case a zero value is assumed.
5. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARIMA_VALIDATE(), NDK_ARIMA_GOF(), NDK_ARIMA_FORE(), NDK_ARIMA_FITTED(), NDK_ARIMA_SIM()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in,out]meanis the ARMA model mean (i.e. mu).
[in,out]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the model's integration order.
[in,out]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in,out]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[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_ARIMA_SIM()

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.

Note
1. The input data argument (i.e. latest observations) is optional. If omitted, an array of zeroes is assumed.
2. The time series is homogeneous or equally spaced.
3. The time series may include missing values (e.g. NaN) at either end.
4. The input data argument (i.e. latest observations) is optional. If omitted, an array of zeroes is assumed.
5. The residuals/innovations standard deviation (sigma) must be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARIMA_VALIDATE(), NDK_ARIMA_GOF(), NDK_ARIMA_FORE(), NDK_ARIMA_FITTED(), NDK_ARIMA_PARAM()
Parameters
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the model's integration order.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]nSeedis an unsigned integer for setting up the random number generators.
[out]retValis the calculated simulation value.
[in]nStepsis the number of future steps to simulate for.

◆ NDK_ARIMA_VALIDATE()

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.).

Note
1. The time series is homogeneous or equally spaced.
2. The integration order argument (d) must be a positive integer.
3. The time series may include missing values (e.g. NaN) at either end.
4. The long-run mean can take any value or may be omitted, in which case a zero value is assumed.
5. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARIMA_GOF(), NDK_ARIMA_PARAM(), NDK_ARIMA_FORE(), NDK_ARIMA_FITTED(), NDK_ARIMA_SIM()
Parameters
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the integration order.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).

◆ NDK_ARMA_FITTED()

int __stdcall NDK_ARMA_FITTED ( double * pData,
size_t nSize,
double mean,
double sigma,
double * phis,
size_t p,
double * thetas,
size_t q,
FIT_RETVAL_FUNC retType )

Returns 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 long-run mean can take any value or be omitted, in which case a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_GOF(), NDK_ARMA_RESID(), NDK_ARMA_GOF()
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[in]retTypeis a switch to select a output type ( see FIT_RETVAL_FUNC).

◆ NDK_ARMA_FORE()

int __stdcall NDK_ARMA_FORE ( double * pData,
size_t nSize,
double mean,
double sigma,
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.

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 mean can take any value or be omitted, in which case a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_GOF(), NDK_ARMA_RESID()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[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 (FORECAST_MEAN, FORECAST_STDEV , ..) (see FORECAST_RETVAL_FUNC).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]retValis the calculated forecast value.

◆ NDK_ARMA_GOF()

int __stdcall NDK_ARMA_GOF ( double * pData,
size_t nSize,
double mean,
double sigma,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD retType,
double * retVal )

Computes the log-likelihood (LLF), Akaike Information Criterion (AIC) or other goodness of fit functions of the ARMA 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 mean can take any value or be omitted, in which case a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_FORE(), NDK_ARMA_RESID()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[in]retTypeis a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC).
[out]retValis the calculated goodness of fit value.

◆ NDK_ARMA_PARAM()

int __stdcall NDK_ARMA_PARAM ( double * pData,
size_t nSize,
double * mean,
double * sigma,
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.

Note
1. The time series is homogeneous or equally spaced.
2. The time series may include missing values (e.g. NaN) at either end.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARMA_GOF(), NDK_ARMA_VALIDATE(), NDK_ARMA_FORE(), NDK_ARMA_RESID()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in,out]meanis the ARMA model mean (i.e. mu).
[in,out]sigmais the standard deviation of the model's residuals/innovations.
[in,out]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in,out]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[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_ARMA_RESID()

int __stdcall NDK_ARMA_RESID ( double * pData,
size_t nSize,
double mean,
double sigma,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD retType )

Returns the standardized residuals of a given ARMA 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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
Deprecated
this function is being replaced by NDK_ARMA_FITTED()
See also
NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_FORE(), NDK_ARMA_GOF()
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component)
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component)
[in]retTypeis a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC

◆ NDK_ARMA_SIM()

int __stdcall NDK_ARMA_SIM ( double mean,
double sigma,
double * phis,
size_t p,
double * thetas,
size_t q,
double * pData,
size_t nSize,
UINT nSeed,
double * retArray,
size_t nSteps )

Returns the simulated values.

Note
1. ARMA_SIM returns an array of one simulation path starting from the end of the input data.
2. The input data argument (i.e. latest observations) is optional. If omitted, an array of zeroes is assumed.
3. The time series is homogeneous or equally spaced.
4. The time series may include missing values (e.g. NaN) at either end.
5. The long-run mean can take any value or be omitted, in which case a zero value is assumed.
6. The residuals/innovations standard deviation (sigma) must be greater than zero.
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_GOF(), NDK_ARMA_RESID(), NDK_ARMA_GOF()
Parameters
[in]meanis the ARMA model long-run mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).
[in]pDataare the values of the latest (most recent) observations.
[in]nSizeis the number elements in pData.
[in]nSeedis an unsigned integer to initialize the psuedorandom number generator.
[out]retArrayis the output array to hold nSteps future simulations.
[in]nStepsis the number of future steps to simulate for.

◆ NDK_ARMA_VALIDATE()

int __stdcall NDK_ARMA_VALIDATE ( double mean,
double sigma,
double * phis,
size_t p,
double * thetas,
size_t q )

Examines the model's parameters for stability constraints (e.g. stationarity, invertibility, causality, 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 long-run mean can take any value or be omitted, in which case a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero
Returns
status code of the operation
Return values
NDK_TRUEmodel is stable
NDK_FALSEmodel is instable
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_GOF(), NDK_ARMA_RESID(), NDK_ARMA_GOF()
Parameters
[in]meanis the ARMA model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]phisare the parameters of the AR(p) component model (starting with the lowest lag).
[in]pis the number of elements in phis (order of AR component).
[in]thetasare the parameters of the MA(q) component model (starting with the lowest lag).
[in]qis the number of elements in thetas (order of MA component).

◆ NDK_AVERAGE()

int __stdcall NDK_AVERAGE ( double * X,
size_t N,
WORD reserved,
double * retVal )

Calculates the sample average.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ACF_MEANTEST()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated average value.

◆ NDK_BaxterKingFilter()

int __stdcall NDK_BaxterKingFilter ( double * X,
size_t N,
BOOL bAscending,
size_t freq_min,
size_t freq_max,
size_t K,
BOOL drift,
BOOL unitroot,
WORD retTYpe )

Computes trend and cyclical component of a macroeconomic time series using Baxter-King Fixed Length Symmetric Filter.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_HodrickPrescotFilter(), NDK_DFT(), NDK_IDFT()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]freq_minis the number of periods for the high pass filter (e.g. 6 for quarterly data, 18 for monthly data).
[in]freq_maxis the number of periods for the low passfilter (e.g. 32 for quarterly data, 96 for montly data).
[in]Kis the number of points(aka terms) to use in the approximate optimal filter. If missing, a default value of 12 is assumed
[in]driftis a logical value: FALSE if no drift in time series (default), TRUE if drift in time series.
[in]unitrootis a logical value: FALSE if no unit-root is in time series (default), TRUE if unit-root is in time series.
[in]retTYpeis the integer enumeration for the filter output: (1= trend component (default), 2=cyclical component, 3=noise component)

◆ NDK_BMA_WGHTS()

int __stdcall NDK_BMA_WGHTS ( size_t M,
double * pterms,
size_t * pSize )

Computes Binomial weighted moving average series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_CMA_WGHTS(), NDK_HMA_WGHTS(), NDK_SMA_WGHTS()
Parameters
[in]Mis the number of terms in the filter
[out]ptermsis the filter's terms or weights array.
[in,out]pSizeis the output buffer size.

◆ NDK_BOXCOX()

int __stdcall NDK_BOXCOX ( double * X,
size_t N,
double lo,
double hi,
double lambda,
int retTYpe,
double * retVal )

Computes the complementary log-log transformation, including its inverse.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_LOGIT(), NDK_PROBIT(), NDK_CLOGLOG()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]lois the domain lower bound
[in]hiis the domain upper bound
[in]lambdais the input power parameter of the transformation, on a scale from 1 to 0. If omitted, a default value of 0 is assumed.
[in]retTYpeis a number that determines the type of return value: 1 (or missing)=Box-Cox, 2=inverse Box-Cox, 3= LLF of Box-Cox.
[out]retValis the calculated log-likelihood value of the transform (retType=3).

◆ NDK_CAGR()

int __stdcall NDK_CAGR ( double endValue,
double startValue,
double time,
double * retVal )

Calculates the overall CAGR of a series of returns.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE()

◆ NDK_CHOOSE()

int __stdcall NDK_CHOOSE ( double * pData,
size_t nSize,
size_t nItems,
bool replacement,
ULONG ulSeed,
double * pRetVal )

Returns k-items draw from the input array.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_LAG(), NDK_DIFF [out] is output buffer to hold sampled items.
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]nItemsis the number of draws or objects.
[in]replacementis the type of draw: with replacement or without replacement.
[in]ulSeedis random number generator seed.

◆ NDK_CHOWTEST()

int __stdcall NDK_CHOWTEST ( double ** XX1,
size_t M,
double * Y1,
size_t N1,
double ** XX2,
double * Y2,
size_t N2,
LPBYTE mask,
size_t nMaskLen,
double intercept,
TEST_RETURN retType,
double * retVal )

Returns the p-value of the regression stability test (i.e. whether the coefficients in two linear regressions on different data sets are equal).

Note
1. Each column in the input matrix corresponds to a separate time series variable.
2. The input matrix can have no more than twelve (12) columns (or variables).
3. Each row in the input matrix corresponds to an observation.
4. The input data may include missing values (e.g. NaN).
5. Observations (i.e. row) with missing values in X or Y are removed.
6. The number of observations of each data set must be larger than the number of explanatory variables.
8. The CollinearityTest function is available starting with version 1.60 APACHE.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_COLNRTY_TEST()
Parameters
[in]XX1is the independent variables data matrix of the first data set (two dimensional).
[in]Mis the number of variables (columns) in XX1 and XX2.
[in]Y1is the response or the dependent variable data array for the first data set (one dimensional array).
[in]N1is the number of observations (rows) in the first data set.
[in]XX2is the independent variables data matrix of the second data set, such that each column represents one variable.
[in]Y2is the response or the dependent variable data array of the second data set (one dimensional array).
[in]N2is the number of observations (rows) in the second data set.
[in]maskis the boolean array to select a subset of the input variables in X. If NULL, all variables in X are included.
[in]nMaskLenis the number of elements in the mask, which must be zero or equal to M.
[in]interceptis the regression constant or the intercept value (e.g. zero). If missing, an intercept is not fixed and will be computed from the data set.
[in]retTypeis a switch to select the return output (see TEST_RETURN for more details).
[in]retValis the calculated Chow test statistics.

◆ NDK_CLOGLOG()

int __stdcall NDK_CLOGLOG ( double * X,
size_t N,
double lo,
double hi,
WORD retTYpe )

Computes the complementary log-log transformation, including its inverse.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_HodrickPrescotFilter(), NDK_DFT(), NDK_IDFT()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]lois the domain lower bound, if missing, lo=0
[in]hiis the domain upper bound, if missing, hi=1
[in]retTYpeis a number that determines the type of return value: 1 (or missing)=C-log-log , 2=inverse C-log-log.

◆ NDK_CMA()

int __stdcall NDK_CMA ( double * X,
size_t N,
BOOL bAscending,
const double * pWeights,
size_t K,
BOOL bEndPoints )

Computes central moving average series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_HodrickPrescotFilter(), NDK_DFT(), NDK_IDFT()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]pWeightsis the filter's terms or weights array.
[in]Kis the number of terms in the filter
[in]bEndPointsis a flag to apply asymmetric filter to the end-points.

◆ NDK_CMA_WGHTS()

int __stdcall NDK_CMA_WGHTS ( size_t M,
double * pterms,
size_t * pSize )

Computes centered weighted moving average series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_CMA_WGHTS(), NDK_HMA_WGHTS(), NDK_SMA_WGHTS()
Parameters
[in]Mis the number of terms in the filter
[out]ptermsis the filter's terms or weights array.
[in,out]pSizeis the output buffer size.

◆ NDK_COLNRTY_TEST()

int __stdcall NDK_COLNRTY_TEST ( double ** XX,
size_t N,
size_t M,
LPBYTE mask,
size_t nMaskLen,
COLNRTY_TEST_TYPE nMethod,
WORD nColIndex,
double * retVal )

Returns the collinearity test statistics for a set of input variables.

Note
1. Each column in the input matrix corresponds to a separate time series variable.
2. The input matrix can have no more than twelve (12) columns (or variables).
3. Each row in the input matrix corresponds to an observation.
4. The input data may include missing values (e.g. NaN).
5. In the variance inflation factor (VIF) method, a series of regressions models are constructed, where one variable is the dependent variable against the remaining predictors.
6. A tolerance of less than 0.20 or 0.10 and/or a VIF of 5 or 10 and above indicates a multicollinearity problem.
7. As a rule of thumb, a condition number ( $\kappa$) greater or equal to 30 indicates a severe multi-collinearity problem.
8. The CollinearityTest function is available starting with version 1.60 APACHE.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_CHOWTEST()
Parameters
[in]XXis the input variables matrix data (two dimensional).
[in]Nis the number of rows (observations) in XX.
[in]Mis the number of columns (variables) in XX.
[in]maskis the boolean array to select a subset of the input variables in X. If NULL, all variables in X are included.
[in]nMaskLenis the number of elements in the mask. Must be zero or equal to M.
[in]nMethodis the multi-colinearity measure to compute (see COLNRTY_TEST_TYPE).
[in]nColIndexis a switch to designate the explanatory variable to examine (not required for condition number).
[out]retValis the calculated statistics of collinearity.

◆ NDK_CONVOLUTION()

int __stdcall NDK_CONVOLUTION ( double * X,
size_t N1,
double * Y,
size_t N2,
double * Z,
size_t * W )

Returns an array of cells for the convolution operator of two time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
SFMacros.h, NDK_LAG(), NDK_DIFF
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]N1is the number of observations in X.
[in]Yis the second univariate time series data (a one dimensional array)
[in]N2is the number of observations in Y.
[out]Zis the convolution time series output
[in,out]Wis the maximum number of elements in Z.

◆ NDK_DEFAULT_EDITOR()

int __stdcall NDK_DEFAULT_EDITOR ( LPTSTR szFullPath,
size_t * nSize )

Locate and return the full path of the default editor (e.g. notepad) in the system.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
SFMacros.h, NDK_Init()
Parameters
[out]szFullPathis the buffer that will receive the return value
[in,out]nSizeis the maximum number of characters to copy to the buffer.

◆ NDK_DESMTH()

int __stdcall NDK_DESMTH ( double * pData,
size_t nSize,
BOOL bAscending,
double * alpha,
double * beta,
int xlHorizon,
BOOL bOptimize,
double * internals,
size_t nInternalsSize,
WORD wInternalSeries,
double * retVal )

Returns the (Holt-Winter's) double exponential smoothing estimate of the value of X at time T+m.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_TESMTH, NDK_LESMTH()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of elements in pData.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]alphais the data smoothing factor (alpha should be between zero and one (exclusive)).
[in]betais the trend smoothing factor (beta should be between zero and one (exclusive)).
[in]xlHorizonis the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.
[in]bOptimizeis a flag (True/False) for searching and using the optimal value of the smoothing factor. If missing or omitted, optimize is assumed false.
internals[out,opt] is an array of the intermediate forecast calculation.
nInternalsSize[in,opt] size of the output buffer, and number or values to return.
wInternalSeries[in, opt] a switch to select the series to return in internals ( 0 = Smoothing forecast, 1=level, 2=trend)
[out]retValis the calculated value of this function.

◆ NDK_DETREND()

int __stdcall NDK_DETREND ( double * X,
size_t N,
WORD polyOrder )

Detrends a time series using a regression of y against a polynomial time trend of order p.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_BOXCOX(), NDK_RMSEASONAL(), NDK_DIFF()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]polyOrderis the order of the polynomial time trend: 0. subtracts mean (default)
  1. constant plus trend model
  2. constant plus trend and squared trend model

◆ NDK_DFT()

int __stdcall NDK_DFT ( double * X,
size_t N,
double * retAmp,
double * retPhase,
size_t M )

Calculates the discrete fast Fourier transformation for amplitude and phase.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
SFMacros.h, NDK_LAG(), NDK_DIFF
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[out]retAmpis an array of the amplitudes of the fourier transformation components
[out]retPhaseis an array of the phase angle (radian) of the Fourier transformation components .
[in]Mis the number of spectrum components (i.e. size of amp and phase)

◆ NDK_DIFF()

int __stdcall NDK_DIFF ( double * X,
size_t N,
size_t S,
size_t D )

Returns an array of cells for the differenced time series (i.e. (1-L^S)^D).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_LAG(), NDK_INTEG
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Sis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]Dis the number of repeated differencing (e.g. d=0 (none), d=1 (difference once), 2=(difference twice), etc.).

◆ NDK_DMA_WGHTS()

int __stdcall NDK_DMA_WGHTS ( const double * pOuterWeights,
size_t M,
const double * pInnerWeights,
size_t K,
double * pterms,
size_t * pSize )

Computes (double) central moving average series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_BMA_WGHTS(), NDK_HMA_WGHTS(), NDK_SMA_WGHTS()
Parameters
[in]pOuterWeightsis the second MA weights.
[in]Mis the number of terms in the second MA.
[in]pInnerWeightsis the first MA weights.
[in]Kis the number of terms in the first MA.
[out]ptermsis the filter weights (a one dimensional array).
[in,out]pSizeis the filter weights terms size.

◆ NDK_EDF()

int __stdcall NDK_EDF ( double * pData,
size_t nSize,
double targetVal,
WORD retType,
double * retVal )

Calculates the empirical distribution function (or empirical cdf) of the sample data.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_KERNEL_DENSITY_ESTIMATE(), NDK_HISTOGRAM()
Parameters
[in]pDatais the input data series (one/two dimensional array).
[in]nSizeis the number of elements in pData.
[in]targetValis the target value to compute the underlying cdf for.
[in]retTypeis a switch to select the return output (1=CDF (default), 2=Inverse CDF).
[out]retValis the computed value.

◆ 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 SFMacros.h)
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 SFMacros.h)
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
[in,out]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]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 SFMacros.h)
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 SFMacros.h)
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
[in,out]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.
[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 SFMacros.h)
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.
[in,out]muis the EGARCH model conditional mean (i.e. mu).
[in,out]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
[in,out]Gammasare the leverage parameters (starting with the lowest lag).
[in]gis the number of elements in Gammas. Must be equal to (p-1).
[in,out]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,out]nuis 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 (see SFMacros.h)
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 SFMacros.h)
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 SFMacros.h)
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
[in,out]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.

◆ NDK_EMA()

int __stdcall NDK_EMA ( double * pData,
size_t nSize,
BOOL bAscending,
int nWindowSize,
int nVariant,
double * internals,
size_t nInternalsSize,
double * retVal )

Returns the exponential moving (EMA) estimate of the value of X at time t+m (based on the raw data up to time t).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA(), NDK_DESMTH(), NDK_TESMTH, NDK_LESMTH()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of elements in pData.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]nWindowSizeis the number of observation in the rolling window.
[in]nVariantis the type of exponential moving average (i.e. 0= Simple (default), 1= Double, 2=Triple, 3=Zero-lagged)
internals[out,opt] is an array of the intermediate forecast calculation.
nInternalsSize[inout,opt] size of the output buffer, and number or values to return.
[out]retValis the calculated value of this function.

◆ NDK_EWMA()

int __stdcall NDK_EWMA ( double * X,
size_t N,
double lambda,
size_t step,
double * retVal )

Calculates the estimated value of the exponential-weighted volatility (EWV).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series is homogeneous or equally spaced.
2. The time series may include missing values (NaN) at either end.
3. The EWMA function assumes that the time series has an average equal to zero.
4. The exponential-weighted moving average is calculated as:
  • $\sigma_t^2=\lambda \sigma_{t-1}^2+(1-\lambda)x_{t-1}^2$, where:
    • $x_t$ is the value of the time series value at time t.
    • $\lambda$ is the smoothing parameter (i.e. a non-negative constant between 0 and 1).
5. The size of the EWMA time series is equal to the input time series, but with the first observation (or last, if the original series is reversed) set to missing (NaN).
See also
NDK_WMA(), NDK_EWXCF()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]lambdais the smoothing parameter used for the exponential-weighting scheme. If missing, a default value of 0.94 is assumed
[in]stepis the forecast time/horizon (expressed in terms of steps beyond the end of the time series X). If missing, a default value of 0 is assumed.
[out]retValis the estimated value of the exponential-weighted volatility.

◆ NDK_EWXCF()

int __stdcall NDK_EWXCF ( double * X,
double * Y,
size_t N,
double lambda,
size_t step,
double * retVal )

Computes the correlation factor using the exponential-weighted correlation function.

NDK_EWXCF computes the correlation estimate using the exponential-weighted covariance (EWCOV) and volatility (EWMA/EWV) method for each time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series is homogeneous or equally spaced.
2. The two time series must have identical size and time order.
3. The correlation is defined as:
  • $\rho^{(xy)}_t=\frac{\sigma_t^{(xy)}}{{_x\sigma_t}\times{_y\sigma_t}}$
  • $\sigma_t^{(xy)} = \lambda\sigma_{t-1}^{(xy)}+(1-\lambda)x_{t-1}y_{t-1}$
  • $_x\sigma_t^2=\lambda\times{_x\sigma_{t-1}^2}+(1-\lambda)x_{t-1}^2$
  • $_y\sigma_t^2=\lambda\times{_y\sigma_{t-1}^2}+(1-\lambda)y_{t-1}^2$, where:
    • $\rho^{(xy)}_t$ is the sample correlation between X and Y at time t.
    • $\sigma_t^{(xy)}$ is the sample exponential-weighted covariance between X and Y at time t.
    • $_x\sigma_t$ is the sample exponential-weighted volatility for the time series X at time t.
    • $_y\sigma_t$ is the sample exponential-weighted volatility for the time series Y at time t.
    • $\lambda$ is the smoothing factor used in the exponential-weighted volatility and covariance calculations.
See also
SFMacros.h, NDK_WMA(), NDK_EWMA()
Parameters
[in]Xis the first univariate time series data (a one dimensional array).
[in]Yis the second univariate time series data (a one dimensional array).
[in]Nis the number of observations in X (or Y).
[in]lambdais the smoothing parameter used for the exponential-weighting scheme. If missing, a default value of 0.94 is assumed.
[in]stepis the forecast time/horizon (expressed in terms of steps beyond the end of the time series X). If missing, a default value of 0 is assumed.
[out]retValis the estimated value of the correlation factor.

◆ NDK_FARIMA_FITTED()

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,
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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_FARIMA_GOF(), NDK_FARIMA_RESID(), NDK_FARIMA_PARAM(), NDK_FARIMA_FORE(), NDK_FARIMA_VALIDATE()

◆ NDK_FARIMA_FORE()

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,
WORD retType,
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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_FARIMA_GOF(), NDK_FARIMA_RESID(), NDK_FARIMA_PARAM(), NDK_FARIMA_FITTED(), NDK_FARIMA_VALIDATE()

◆ NDK_FARIMA_GOF()

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,
WORD retType,
double * retVal )

Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the FARIMA 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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()

◆ NDK_FARIMA_PARAM()

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,
WORD retType,
size_t maxIter )

Returns 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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()

◆ NDK_FARIMA_RESID()

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

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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_AIRLINE_GOF(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()

◆ NDK_FARIMA_SIM()

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.

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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_FARIMA_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()

◆ NDK_GARCH_FITTED()

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)

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 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 SFMacros.h)
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]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_GARCH_FORE()

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.

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 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 SFMacros.h)
See also
NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), 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]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
[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 or Normal Distribution
  • 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 calculated forecast value

◆ NDK_GARCH_GOF()

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.

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 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 SFMacros.h)
See also
NDK_GARCH_RESID(), 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 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]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_GARCH_LRVAR()

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.

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 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 SFMacros.h)
See also
NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_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]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 value

◆ NDK_GARCH_PARAM()

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.

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 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 SFMacros.h)
See also
NDK_GARCH_GOF(), NDK_GARCH_RESID(), 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,out]muis the GARCH model conditional mean (i.e. mu).
[in,out]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
[in,out]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,out]nuis 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_GARCH_RESID()

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

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 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 SFMacros.h)
Deprecated
this function is being replaced by NDK_GARCH_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 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]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_GARCH_SIM()

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.

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 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 SFMacros.h)
See also
NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_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]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 of the latest observations (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]sigmasis 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]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_GARCH_VALIDATE()

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.).

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 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 SFMacros.h)
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
[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.

◆ NDK_GARCHM_FITTED()

int __stdcall NDK_GARCHM_FITTED ( double * pData,
size_t nSize,
double mu,
double flambda,
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)

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 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 SFMacros.h)
See also
NDK_GARCHM_GOF(), NDK_GARCHM_RESID(), NDK_GARCHM_PARAM(), NDK_GARCHM_FORE(), NDK_GARCHM_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]flambdais the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.
[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]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_GARCHM_FORE()

int __stdcall NDK_GARCHM_FORE ( double * pData,
size_t nSize,
double * sigmas,
size_t nSigmaSize,
double mu,
double flambda,
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.

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 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 SFMacros.h)
See also
NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), 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]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]flambdais the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.
[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]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 or Normal Distribution
  • 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 calculated forecast value

◆ NDK_GARCHM_GOF()

int __stdcall NDK_GARCHM_GOF ( double * pData,
size_t nSize,
double mu,
double flambda,
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.

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 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 SFMacros.h)
See also
NDK_GARCHM_RESID(), NDK_GARCHM_PARAM(), NDK_GARCHM_FORE(), NDK_GARCHM_FITTED(), NDK_GARCHM_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]flambdais the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.
[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]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_GARCHM_LRVAR()

int __stdcall NDK_GARCHM_LRVAR ( double mu,
double flambda,
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-M 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 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 SFMacros.h)
See also
NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_VALIDATE()
Parameters
[in]muis the GARCH model conditional mean (i.e. mu).
[in]flambdais the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.
[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]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 value

◆ NDK_GARCHM_PARAM()

int __stdcall NDK_GARCHM_PARAM ( double * pData,
size_t nSize,
double * mu,
double * flambda,
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.

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 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 SFMacros.h)
See also
NDK_GARCH_GOF(), NDK_GARCH_RESID(), 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,out]muis the GARCH model conditional mean (i.e. mu).
[in,out]flambdais the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.
[in,out]Alphasare the parameters of the ARCH(p) component model (starting with the lowest lag).
[in]pis the number of elements in Alphas array
[in,out]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,out]nuis 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_GARCHM_RESID()

int __stdcall NDK_GARCHM_RESID ( double * pData,
size_t nSize,
double mu,
double flambda,
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

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 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 SFMacros.h)
Deprecated
this function is being replaced by NDK_GARCHM_FITTED()
See also
NDK_GARCHM_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 GARCH model conditional mean (i.e. mu).
[in]flambdais the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.
[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]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_GARCHM_SIM()

int __stdcall NDK_GARCHM_SIM ( double mu,
double flambda,
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.

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 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 SFMacros.h)
See also
NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()
Parameters
[in]muis the GARCH model conditional mean (i.e. mu).
[in]flambdais the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.
[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]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_GARCHM_VALIDATE()

int __stdcall NDK_GARCHM_VALIDATE ( double mu,
double flambda,
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. stationary, 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 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 SFMacros.h)
See also
NDK_GARCHM_GOF(), NDK_ARCHM_RESID(), NDK_ARCHM_PARAM(), NDK_ARCHM_FORE(), NDK_ARCHM_FITTED()
Parameters
[in]muis the GARCH model conditional mean (i.e. mu).
[in]flambdais the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.
[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]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.

◆ NDK_GAUSS_FORECI()

int __stdcall NDK_GAUSS_FORECI ( double mean,
double sigma,
double alpha,
BOOL upper,
double * retVal )

Returns the upper & lower limit of the confidence interval for the Gaussian distribution.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_TSTUDENT_FORECI(), NDK_GED_FORECI()
Parameters
[in]meanis the mean of the Gaussian distribution.
[in]sigmais the standard deviation of the Gaussian distribution.
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]upperis a switch to select the limit (upper/lower).
[out]retValis the computed value.

◆ NDK_GAUSS_RNG()

int __stdcall NDK_GAUSS_RNG ( double mean,
double sigma,
UINT seed,
double * retArray,
UINT nArraySize )

Returns a sequence of random numbers drawn from Normal distribution.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_GAUSS_FORECI()
Parameters
[in]meanis the mean of the Gaussian distribution.
[in]sigmais the standard deviation of the Gaussian distribution.
[in]seedis a number to initialize the psuedorandom number generator.
[out]retArrayare the generated random values.
[in]nArraySizeis the number of elements in retArray

◆ NDK_GED_FORECI()

int __stdcall NDK_GED_FORECI ( double mean,
double sigma,
double df,
double alpha,
BOOL upper,
double * retVal )

Returns the upper & lower limit of the confidence interval for the Generalized Error Distribution (GED) distribution.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_TSTUDENT_FORECI(), NDK_GAUSS_FORECI()
Parameters
[in]meanis the mean of the GED distribution.
[in]sigmais the standard deviation of the GED distribution.
[in]dfis the degrees of freedom (nu) of the GED distribution.
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]upperis a switch to select the limit (upper/lower).
[out]retValis the computed value.

◆ NDK_GED_XKURT()

int __stdcall NDK_GED_XKURT ( double df,
double * retVal )

Calculates the excess kurtosis of the generalized error distribution (GED).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_TDIST_XKURT(), NDK_XKURTTEST()
Parameters
[in]dfis the shape parameter (or degrees of freedom) of the distribution (V > 1).
[out]retValis the computed value

◆ NDK_GESMTH()

int __stdcall NDK_GESMTH ( double * pData,
size_t nSize,
BOOL bAscending,
double * alpha,
double * beta,
double * gamma,
double * phi,
double * lambda,
WORD TrendType,
WORD SeasonalityType,
int seasonLength,
int nHorizon,
BOOL bOptimize,
BOOL bAutoCorrelationAdj,
BOOL bLogTransform,
double * internals,
size_t nInternalsSize,
WORD wInternalSeries,
double * retVal )

Returns the (Winters's) triple exponential smoothing estimate of the value of X at time T+m.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_LESMTH, NDK_DESMTH()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of elements in pData.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]alphais the data smoothing factor (alpha should be between zero and one (exclusive)).
[in]betais the trend smoothing factor (beta should be between zero and one (exclusive)).
[in]gammais the seasonal change smoothing factor (Gamma should be between zero and one (exclusive)).
[in]phiis the damping coefficient for the trend.
[in]lambdais the coefficient value for the autocorrelation adjustment
[in]TrendTypeis the type of trend in the model (0=none, 1=additive, 2- damped additive, 3=multiplicative, 4=damped multiplicative)
[in]SeasonalityTypeis the type of seasonality in the modem (0=none, 1=additive, 2=multiplicative)
[in]seasonLengthis the season length.
[in]nHorizonis the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.
[in]bOptimizeis a flag (True/False) for searching and using optimal value of the smoothing factor. If missing or omitted, optimize is assumed false.
[in]bAutoCorrelationAdjis a flag (True/False) for adding a correction term for the 1st ourder autocorrelation in the
[in]bLogTransformis a flag (True/False) for applying natural log transform to the input data prior to smoothing.
internals[out,opt] is an array of the intermediate forecast calculation.
nInternalsSize[in,opt] size of the output buffer, and number or values to return.
wInternalSeries[in, opt] a switch to select the series to return in internals ( 0 = one-step forecasting, 1=level, 2=trend, 3=seasonality)
[out]retValis the calculated value of this function.

◆ NDK_GINI()

int __stdcall NDK_GINI ( double * x,
size_t N,
double * retVal )

Returns the sample Gini coefficient, a measure of statistical dispersion.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. A low Gini coefficient indicates a more equal distribution, with 0 corresponding to complete equality. Higher Gini coefficients indicate more unequal distributions, with 1 corresponding to complete inequality.
2. The input data series may include missing values (NaN), but they will not be included in the calculations.
3. The values in the input data series must be non-negative.
4. The Gini coefficient is computed as follows: $G(S)=1-\frac{2}{n-1}\left ( n-\frac{\sum_{i=1}^{n}iy_i}{\sum_{i=1}^{n}y_i} \right )$
5. Where:
  • $h$ is the input data series ( $h$) arranged in descending order, so that $y_i\leq y_{i+1}$.
  • $n$ is the number of non-missing values in the input time series data sample.
6. The Gini coefficient value can range from 0 to 1 and is half the NDK_RMD().
7. $G(S)$ is a consistent estimator of the population Gini coefficient, but is generally unbiased (except when the population mean is known).
8. Developed by the Italian statistician Corrado Gini in 1912, the Gini coefficient is commonly used as a measure of comparative income or wealth. Where zero (0) corresponds to complete equality and one (1) to complete inequality.
See also
NDK_HURST_EXPONENT()
Parameters
[in]xis the input data sample (must be non-negative) (a one dimensional array of values).
[in]Nis the number of observations in X.
[out]retValis the calculated value of this function.

◆ NDK_GLM_FITTED()

int __stdcall NDK_GLM_FITTED ( double * Y,
size_t nSize,
double ** X,
size_t nVars,
double * betas,
size_t nBetas,
double phi,
WORD Lvk,
WORD retType )
Parameters
[in,out]Yis the response or the dependent variable data array (one dimensional array)
[in]nSizeis the number of observations
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nVarsis the number of independent variables (or columns in X)
[in]betasare the coefficients of the GLM model (a one dimensional array)
[in]nBetasis the number of the coefficients in betas. Note that nBetas must be equal to nVars+1
[in]phiis the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
  • Binomial : phi = Reciprocal of the batch/trial size.
  • Gaussion : phi = variance.
  • Poisson : phi = 1.0
[in]Lvkis the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
  1. Identity (default)
  2. Log
  3. Logit
  4. Probit
  5. Complementary log-log
[in]retTypeis a switch to select a output type ( see FIT_RETVAL_FUNC)

◆ NDK_GLM_FORE()

int __stdcall NDK_GLM_FORE ( double * X,
size_t nVars,
double * betas,
size_t nBetas,
double phi,
WORD Lvk,
WORD retType,
double alpha,
double * retval )

calculates the expected response (i.e. mean) value; given the GLM model and the values of the explanatory variables.

Notes

  1. Missng values (i.e. #N/A!) are not allowed in the either response(Y) or the explanatory input arrays.
  2. The number of rows in response variable (Y) must be equal to number of rows of the explanatory variables (X).
  3. The number of betas must equal to the number of explanatory variables (i.e. X) plus one (intercept).
  4. For GLM with Poisson distribution,
    • The values of response variable must be non-negative integers.
    • The value of the dispersion factor (Phi) value must be either missing or equal to one.
  5. For GLM with Binomial distribution,
    • The values of the response variable must be non-negative fractions between zero and one, inclusive.
    • The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).
  6. For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_GOF(), NDK_GLM_FORE
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nVarsis the number of independent variables (or columns in X)
[in,out]betasare the coefficients of the GLM model (a one dimensional array)
[in]nBetasis the number of the coefficients in betas. Note that nBetas must be equal to nVars+1
[in,out]phiis the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
Lvk- Binomial : phi = Reciprocal of the batch/trial size.
  • Gaussion : phi = variance.
  • Poisson : phi = 1.0 [in] is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
    1. Identity (default)
    2. Log
    3. Logit
    4. Probit
    5. Complementary log-log
[in]retTypeis a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see # FORECAST_RETVAL_FUNC)
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]retvalis the calculated forecast value

◆ NDK_GLM_GOF()

int __stdcall NDK_GLM_GOF ( double * Y,
size_t nSize,
double ** X,
size_t nVars,
double * betas,
size_t nBetas,
double phi,
WORD Lvk,
WORD retType,
double * retVal )

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

Notes

  1. Missng values (i.e. #N/A!) are not allowed in the either response(Y) or the explanatory input arrays.
  2. The number of rows in response variable (Y) must be equal to number of rows of the explanatory variables (X).
  3. The number of betas must equal to the number of explanatory variables (i.e. X) plus one (intercept).
  4. For GLM with Poisson distribution,
    • The values of response variable must be non-negative integers.
    • The value of the dispersion factor (Phi) value must be either missing or equal to one.
  5. For GLM with Binomial distribution,
    • The values of the response variable must be non-negative fractions between zero and one, inclusive.
    • The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).
  6. For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_PARAM(), NDK_GLM_FORE
Parameters
[in]Yis the response or the dependent variable data array (one dimensional array)
[in]nSizeis the number of observations
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nVarsis the number of independent variables (or columns in X)
[in]betasare the coefficients of the GLM model (a one dimensional array)
[in]nBetasis the number of the coefficients in betas. Note that nBetas must be equal to nVars+1
[in]phiis the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
  • Binomial : phi = Reciprocal of the batch/trial size.
  • Gaussion : phi = variance.
  • Poisson : phi = 1.0
[in]Lvkis the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
  1. Identity (default)
  2. Log
  3. Logit
  4. Probit
  5. Complementary log-log
[in]retTypeis a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC)
[out]retValis the calculated goodness of fit measure.

◆ NDK_GLM_PARAM()

int __stdcall NDK_GLM_PARAM ( double * Y,
size_t nSize,
double ** X,
size_t nVars,
double * betas,
size_t nBetas,
double * phi,
WORD Lvk,
WORD retType,
size_t maxIter )

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

Notes

  1. Missng values (i.e. #N/A!) are not allowed in the either response(Y) or the explanatory input arrays.
  2. The number of rows in response variable (Y) must be equal to number of rows of the explanatory variables (X).
  3. The number of betas must equal to the number of explanatory variables (i.e. X) plus one (intercept).
  4. For GLM with Poisson distribution,
    • The values of response variable must be non-negative integers.
    • The value of the dispersion factor (Phi) value must be either missing or equal to one.
  5. For GLM with Binomial distribution,
    • The values of the response variable must be non-negative fractions between zero and one, inclusive.
    • The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).
  6. For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_GOF(), NDK_GLM_FORE
Parameters
[in]Yis the response or the dependent variable data array (one dimensional array)
[in]nSizeis the number of observations
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nVarsis the number of independent variables (or columns in X)
[in,out]betasare the coefficients of the GLM model (a one dimensional array)
[in]nBetasis the number of the coefficients in betas. Note that nBetas must be equal to nVars+1
[in,out]phiis the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
  • Binomial : phi = Reciprocal of the batch/trial size.
  • Gaussion : phi = variance.
  • Poisson : phi = 1.0
[in]Lvkis the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
  1. Identity (default)
  2. Log
  3. Logit
  4. Probit
  5. Complementary log-log
[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, the default maximum of 100 is assumed.

◆ NDK_GLM_RESID()

int __stdcall NDK_GLM_RESID ( double * Y,
size_t nSize,
double ** X,
size_t nVars,
double * betas,
size_t nBetas,
double phi,
WORD Lvk,
WORD retType )

Returns the standardized residuals/errors of a given GLM.

Notes

  1. Missng values (i.e. #N/A!) are not allowed in the either response(Y) or the explanatory input arrays.
  2. The number of rows in response variable (Y) must be equal to number of rows of the explanatory variables (X).
  3. The number of betas must equal to the number of explanatory variables (i.e. X) plus one (intercept).
  4. For GLM with Poisson distribution,
    • The values of response variable must be non-negative integers.
    • The value of the dispersion factor (Phi) value must be either missing or equal to one.
  5. For GLM with Binomial distribution,
    • The values of the response variable must be non-negative fractions between zero and one, inclusive.
    • The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).
  6. For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_PARAM(), NDK_GLM_FORE
Parameters
[in]Yis the response or the dependent variable data array (one dimensional array)
[in]nSizeis the number of observations
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nVarsis the number of independent variables (or columns in X)
[in]betasare the coefficients of the GLM model (a one dimensional array)
[in]nBetasis the number of the coefficients in betas. Note that nBetas must be equal to nVars+1
[in]phiis the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
  • Binomial : phi = Reciprocal of the batch/trial size.
  • Gaussion : phi = variance.
  • Poisson : phi = 1.0
[in]Lvkis the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
  1. Identity (default)
  2. Log
  3. Logit
  4. Probit
  5. Complementary log-log
[in]retTypeis a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC

◆ NDK_GLM_VALIDATE()

int __stdcall NDK_GLM_VALIDATE ( double * betas,
size_t nBetas,
double phi,
WORD Lvk )

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

Notes

  1. The number of betas must be equal to the number of explanatory variables (i.e. X) plus one (intercept).
  2. For GLM with Poisson distribution:
    • The values of the response variables must be non-negative integers.
    • The value of the dispersion factor (Phi) value must be either missing or equal to one.
  3. For GLM with Binomial distribution,
    • The values of the response variable must be non-negative fractions between zero and one, inclusive.
    • The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).
  4. For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.

Returns
status code of the operation
Return values
NDK_TRUEGLM model is valid
NDK_FALSEGLM model in invalid. For other return values, see SFMacros.h
See also
NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_PARAM(), NDK_GLM_FORE
Parameters
[in]betasare the coefficients of the GLM model (a one dimensional array)
[in]nBetasis the number of the coefficients in betas. Note that nBetas must be equal to nVars+1
[in]phiis the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
  • Binomial : phi = Reciprocal of the batch/trial size.
  • Gaussion : phi = variance.
  • Poisson : phi = 1.0
[in]Lvkis the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
  1. Identity (default)
  2. Log
  3. Logit
  4. Probit
  5. Complementary log-log

◆ NDK_GMEAN()

int __stdcall NDK_GMEAN ( double * X,
size_t N,
WORD reserved,
double * retVal )

Calculates the geometric mean of the sample.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_AVERAGE()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated geometric average value.

◆ NDK_GMRAE()

int __stdcall NDK_GMRAE ( double * X,
double * Y,
size_t N,
size_t period,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecasted time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]periodis the seasonal period (for non-seasonal time series, set M=1).
[out]retValis the calculated geometric mean of relative absolute error

◆ NDK_GMSE()

int __stdcall NDK_GMSE ( double * X,
double * Y,
size_t N,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecasted time series data (a one dimensional array).
[in]Nis the number of observations in X.
[out]retValis the calculated mean of squared errors.

◆ NDK_GRMSE()

int __stdcall NDK_GRMSE ( double * X,
double * Y,
size_t N,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecast time series data (a one dimensional array).
N[In] is the number of observations in X.
[out]retValis the calculated value of this function.

◆ NDK_HASNA()

int __stdcall NDK_HASNA ( const double * X,
size_t nSize,
BOOL intermediate )

Examine whether the given array has one or more missing values.

Returns
status code of the operation
Return values
NDK_TRUEOne or more missing value are detected.
NDK_FALSENo missing value is found.
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_RMNA(), NDK_INTERP_NAN()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]intermediateis a switch to tune the search for missng values:
  • TRUE = Only search for intermediate missing values.
  • FALSE = Search for all missing values in X.

◆ NDK_HIST_BIN_LIMIT()

int __stdcall NDK_HIST_BIN_LIMIT ( double * pData,
size_t nSize,
size_t nBins,
size_t index,
WORD argRetTYpe,
double * retVal )

Returns the upper/lower limit or center value of the k-th histogram bin.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_HIST_BINS(), NDK_HISTOGRAM()
Parameters
[in]pDatais the input data series (one/two dimensional array).
[in]nSizeis the number of elements in pData.
[in]nBinsis the input number of bins for the histogram.
[in]indexis the bin index or order; e.g. 0=1st bin (default),1=2nd bin,..., N-1.
[in]argRetTYpeis a switch to select the return output (0=lower limit (default), 1=upper limit of the bin, 2=center of the bin).
[out]retValis the computed value.

◆ NDK_HIST_BINS()

int __stdcall NDK_HIST_BINS ( double * pData,
size_t nSize,
WORD argMethod,
size_t * retVal )

Returns the number of histogram bins using a given method.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_HIST_BIN_LIMIT(), NDK_HISTOGRAM()
Parameters
[in]pDatais the input data series (one/two dimensional array).
[in]nSizeis the number of elements in pData.
[in]argMethodis a switch to select the calculation method (1=Sturges's formula, 2=Square-root, 3=Scott's Choice, 4=Freedman-Diaconis choice, 5=Optimal (default)).
[out]retValis the computed value.

◆ NDK_HISTOGRAM()

int __stdcall NDK_HISTOGRAM ( double * pData,
size_t nSize,
size_t nBins,
size_t index,
WORD argRetTYpe,
double * retVal )

Calculates the histogram or cumulative histogram function for a given bin.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_HIST_BINS(), NDK_HISTOGRAM()
Parameters
[in]pDatais the input data series (one/two dimensional array).
[in]nSizeis the number of elements in pData.
[in]nBinsis the input number of bins for the histogram.
[in]indexis the bin index or order; e.g. 0=1st bin (default),1=2nd bin,..., N.
[in]argRetTYpeis a switch to select the return output: 0. histogram
  1. cumulative histogram (default)).
[out]retValis the computed value.

◆ NDK_HMA_WGHTS()

int __stdcall NDK_HMA_WGHTS ( size_t M,
double * pterms,
size_t * pSize )

Computes Henderson weighted moving average series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_CMA_WGHTS(), NDK_BMA_WGHTS(), NDK_SMA_WGHTS()
Parameters
[in]Mis the number of terms in the filter
[out]ptermsis the filter's terms or weights array.
[in,out]pSizeis the output buffer size.

◆ NDK_HodrickPrescotFilter()

int __stdcall NDK_HodrickPrescotFilter ( double * X,
size_t N,
BOOL bAscending,
double lambda )

computes cyclical component of given time series using the Hodrick�Prescott filter.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_BaxterKingFilter(), NDK_DFT(), NDK_IDFT()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]lambdais the multiplier used to penalize the variation in the trend component. If missing, a default is used based on data frequency.

◆ NDK_HURST_EXPONENT()

int __stdcall NDK_HURST_EXPONENT ( double * X,
size_t N,
double alpha,
WORD retType,
double * retVal )

Calculates the Hurst exponent (a measure of persistence or long memory) for time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.

References

  • [1] A.A.Anis, E.H.Lloyd (1976) The expected value of the adjusted rescaled Hurst range of independent normal summands, Biometrica 63, 283-298.
  • [2] H.E.Hurst (1951) Long-term storage capacity of reservoirs, Transactions of the American Society of Civil Engineers 116, 770-808.
  • [3] E.E.Peters (1994) Fractal Market Analysis, Wiley.
  • [4] R.Weron (2002) Estimating long range dependence: finite sample properties and confidence intervals, Physica A 312, 285-299.

Note
1. The input data series must have at least 9 non-missing values. Otherwise, Hurst function returns NDK_FAILED.
2. The input data series may include missing values (NaN), but they will not be included in the calculations.
3. The Hurst exponent, $h$, is defined in terms of the rescaled range as follows: $E \left [ \frac{R(n)}{S(n)} \right ]=Cn^H  \textup{ as } n \to \infty $
4. Where:
  • $\left [ \frac{R(n)}{S(n)} \right ]$ is the Rescaled Range.
  • $E \left [x \right ]$ is the expected value.
  • $n$ is the time of the last observation (e.g. it corresponds to $X_n$ in the input time series data.)
  • $h$ is a constant. of
5. The Hurst exponent is a measure autocorrelation (persistence and long memory): -A value of $0<H<0.5$ indicates a time series with negative autocorrelation (e.g. a decrease between values will probably be followed by another decrease). -A value of $0.5<H<1$ indicates a time series with positive autocorrelation (e.g. an increase between values will probably be followed by another increase). -A value of $H=0.5$ indicates a "true random walk," where it is equally likely that a decrease or an increase will follow from any particular value (e.g. the time series has no memory of previous values).
6. The Hurst exponent's namesake, Harold Edwin Hurst (1880-1978), was a British hydrologist who researched reservoir capacity along the Nile river.
7. The rescaled range is calculated for a time series, $X=X_1,X_2,\dots, X_n$, as follows:
  1. Calculate the mean:
    $m=\dfrac{1}{n} \sum_{i=1}^{n} X_i$
  2. Create a mean adjusted series:
    $Y_t=X_{t}-m \textup{  for } t=1,2, \dots ,n$
  3. Calculate the cumulative deviate series Z:
    $Z_t= \sum_{i=1}^{t} Y_{i}  \textup{  for }  t=1,2, \dots ,n$
  4. Create a range series R:
    $R_t = max\left (Z_1, Z_2, \dots, Z_t  \right )- min\left (Z_1, Z_2, \dots, Z_t  \right ) \textup{  for } t=1,2, \dots, n$
  5. Create a standard deviation series R:
    $S_{t}= \sqrt{\dfrac{1}{t} \sum_{i=1}^{t}\left ( X_{i} - u \right )^{2}}  \textup{  for } t=1,2, \dots ,n$ Where:
    $h$ is the mean for the time series values $X_1,X_2, \dots, X_t$
8. Calculate the rescaled range series (R/S):
$\left ( R/S \right )_{t} = \frac{R_{t}}{S_{t}} \textup{  for } t=1,2, \dots, n$
See also
NDK_GINI()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[in]alphais the statistical significance level (1%, 5%, 10%). If missing, a default of 5% is assumed.
[in]retTypeis a number that determines the type of return value: 1 = Empirical Hurst exponent (R/S method) 2 = Anis-Lloyd/Peters corrected Hurst exponent 3 = Theoretical Hurst exponent 4 = Upper limit of the confidence interval 5 = Lower limit of the confidence interval
[out]retValis the calculated value of this function.

◆ NDK_IDFT()

int __stdcall NDK_IDFT ( double * amp,
double * phase,
size_t nSize,
double * X,
size_t N )

Calculates the inverse discrete fast Fourier transformation, recovering the time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
SFMacros.h, NDK_LAG(), NDK_DIFF
Parameters
[in]ampis an array of the amplitudes of the fourier transformation components.
[in]phaseis an array of the phase angle (radian) of the Fourier transformation components .
[in]nSizeis the number of spectrum components (i.e. size of amp and phase).
[out]Xis the filtered (recovered) time series output
[in]Nis the original number of observations used to calculate the fourier transform.

◆ NDK_INFO()

int __stdcall NDK_INFO ( int nRetType,
LPTSTR szMsg,
int nSize )

Query & retrieve NumXL SDK environment information.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
SFMacros.h, NDK_Init()
Parameters
[in]nRetTypeis a key/identifier to select the desired output
  1. Version Number (default
  2. Release
  3. License Key
  4. License Level
  5. License Expiry Date
  6. Installation Path
  7. Data (e.g. Log-file) Path
  8. Computer ID(unique identifier)
[out]szMsgThe buffer that will receive the return value
[in,out]nSizemaximum number of characters to copy to the buffer.

◆ NDK_Init()

int __stdcall NDK_Init ( LPCWSTR szAppName,
LPCWSTR szTmpPath,
long lTimeout,
unsigned int * uClientToken )

Initializes the SFSDK Library.

This function should be the first API called in the SDK; It initializes the SDK library dependencies:

  1. Logging system
  2. License system
  3. Database system
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
SFMacros.h, NDK_Shutdown()
Note
1. This is the first SDK API
int nRet = NDK_FAILED;
char szAppName[]="MyApp";
nRet = NDK_Init( szAppName, // we have a MyApp.conf file
NULL, // use the license key in the license file (NumXL.lic)
NULL, // use the activation code in the license file (NumXL.lic)
NULL); // use the temp directory in current user's profile
// (Windows 7) (c:\users\‍(username)\AppData\Local\MyApp)
// (Windows XP) (c:\Local Settings\‍(username)\AppData\Local\MyApp)
if( nRet >= NDK_SUCCES){
...
....
}
#define NDK_FAILED
FAILED: Internal error occured.
Definition SFLOG.h:28
int __stdcall NDK_Init(LPCWSTR szAppName, LPCWSTR szTmpPath, long lTimeout, unsigned int *uClientToken)
Initializes the SFSDK Library.
Parameters
[in]szAppNameis the application name (user-defined), but must match the configuration base filename.
szTmpPath[in, optional] is the full path of the data directory, where X12 and X13 files are created. If NULL, NDK uses to the temporary directory in the current user's profile.
lTimeout[in, optional] is the timeout setting for running console applications (e.g., x12a or x13). If value set to zero, sdk uses
[out]uClientTokenis the unique value for using during the shutdown.

◆ NDK_INTEG()

int __stdcall NDK_INTEG ( double * X,
size_t N,
size_t S,
size_t D,
double * X0,
size_t N0 )

Returns an array of cells for the integrated time series (inverse operator of NDK_DIFF).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_LAG(), NDK_DIFF
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Sis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]Dis the number of repeated differencing (e.g. d=0 (none), d=1 (difference once), 2=(difference twice), etc.).
X0[in,optional] is the initial (un-differenced) univariate time series data (a one dimensional array). If missing (i.e. NULL), zeros are assumed.
[in]N0is the number of observations in X0.

◆ NDK_INTERP_NAN()

int __stdcall NDK_INTERP_NAN ( double * X,
size_t N,
WORD nMethod,
double plug,
double h )

Returns an array of a time series after substituting all missing values with the mean/median.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_RMNA(), NDK_INTERPOLATE()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]nMethodis an identifier for the method used to generate values for any missing data:
  1. Mean (default)
  2. Median
  3. Constant
  4. Forward flat
  5. Backward flat
  6. Linear
  7. Cubic spline
  8. Weighted moving average
  9. Exponential smoothing
  10. Brownian bridge
[in]plugis the data argument related to the selected treatment method (if applicable). For instance, if the method is constant, then the value would be the actual value.
[in]his the kernel smoothing parameter (aka. bandwidth)

◆ NDK_INTERPOLATE()

int __stdcall NDK_INTERPOLATE ( double * pXData,
size_t nXSize,
double * pYData,
size_t nYSize,
double * pXTargets,
size_t nXTargetSize,
WORD nMethod,
BOOL allowExtrp,
double * pYTargets,
size_t nYTargetSize )

estimate the value of the function represented by (x,y) data set at an intermediate x-value.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA()
Parameters
[in]pXDatais the x-component of the input data table (a one dimensional array)
[in]nXSizeis the number of elements in X
[in]pYDatais the y-component of the input data table (a one dimensional array)
[in]nYSizeis the number of elements in Y
[in]pXTargetsis the desired x-value(s) to interpolate for (a single value or a one dimensional array).
[in]nXTargetSizeis the number of elements in XT
[in]nMethodis the interpolation method (1=Forward Flat, 2=Backward Flat, 3=Linear, 4=Cubic Spline). 0. Linear
  1. Forward Flat
  2. Backward Flat
  3. Cublic Spline
  4. Akima
  5. Steffen's method
[in]allowExtrpsets whether or not to allow extrapolation (1=Yes, 0=No). If missing, the default is to not allow extrapolation
[out]pYTargetsis the output buffer to store the interpolated values
[in]nYTargetSizeis the number of elements in YVals (must equal to Nxt).

◆ NDK_INTRNL_NAN_SUB()

int __stdcall NDK_INTRNL_NAN_SUB ( double * X,
size_t N,
WORD nMethod,
WORD WGH,
WORD KRNL,
WORD P )

Returns an array of a time series after fitting all missing values.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_RMNA(), NDK_INTERPOLATE()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]nMethodis an identifier for the method used to generate values for any missing data:
  1. Mean (default)
  2. Median
  3. Constant
  4. Forward flat
  5. Backward flat
  6. Linear
  7. Cubic spline
  8. KNN
  9. KREG
  1. LOCREG
[in]WGHweighting method (KNN) 0 = none (or equal), 1=distance, 2=kernel (ignore nMethod <>7 )
[in]KRNLkernel function (ignore nMethod <7 or (nMethod =7 and WGH <>2)) 0. UNIFORM_KERNEL
  1. TRIANGULAR_KERNEL
  2. EPANECHNIKOV_KERNEL
  3. QUARTIC_KERNEL
  4. TRIWEIGHT_KERNEL
  5. TRICUBE_KERNEL
  6. GAUSSIAN_KERNEL
  7. COSINE_KERNEL
  8. LOGISTIC_KERNEL
  9. SIGMOID_KERNEL
  10. SILVERMAN_KERNEL
[in]PPolynomial order (KREG and LOCREG) (ignore nMethod < 8)

◆ NDK_INTRPLT2D()

int __stdcall NDK_INTRPLT2D ( const double ** pXData,
size_t nXSize,
size_t nXVars,
const LPBYTE mask,
size_t nMaskLen,
WORD nMethod,
BOOL extrapolate,
double ** target,
size_t ntargetSize )
Parameters
[in]pXDatais the independent (explanatory) variables data matrix, such that each row represents one variable.
[in]nXSizeis the number of observations (columns) in X.
[in]nXVarsis the number of independent (explanatory) variables (rows) in X.
[in]maskis the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLenis the number of elements in the "mask."
[in]nMethodis the interpolation method: 0. BiLinear
  1. Bicubic
[in]extrapolatesets whether or not to allow extrapolation (1=Yes, 0=No). If missing, the default is to not allow extrapolation
[in,out]targetis the desired x-value(s) to interpolate for (a single value or a one dimensional array).
[in]ntargetSizeis the number of elements (columns) in target.

◆ NDK_IQR()

int __stdcall NDK_IQR ( double * X,
size_t N,
double * retVal )

Returns the interquartile range (IQR), also called the midspread or middle fifty.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The input time series data may include missing values (NaN), but they will not be included in the calculations.
2. The interquartile range is defined as follows:
  • $\textup{IQR}=Q_3-Q_1$, where:
    • $Q_3$ is the third quartile.
    • $Q_1$ is the first quartile.
3. Interquartile range (IQR) is a robust statistic because it has a break down point of 25%. It is often preferred to the total range.
See also
NDK_QUANTILE(), NDK_MIN(), NDK_MAX()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[out]retValis the calculated IQR value.

◆ NDK_JOHANSENTEST()

int __stdcall NDK_JOHANSENTEST ( double ** XX,
size_t N,
size_t M,
size_t K,
short nPolyOrder,
BOOL tracetest,
WORD R,
double alpha,
double * retStat,
double * retCV )

Returns the Johansen (cointegration) test statistics for two or more time series.

Note
1. Each column in the input matrix corresponds to a separate time series variable.
2. The input matrix can have no more than twelve (12) columns (or variables).
3. Each row in the input matrix corresponds to an observation.
4. The number of cointegrating relationships should be no greater than the number of input variables.
5. The time series data are homogeneous or equally spaced.
6. The time series may include missing values (e.g. NaN) at either end.
7. There are two types of Johansen tests - with trace or with eigenvalue - and the inferences might be a bit different for each.
  • The null hypothesis for the trace test is the number of cointegration vectors r <= ?
  • The null hypothesis for the eigenvalue test is r = ?
8. The function was added in version 1.62 DEWDROP.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_ADFTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_SKEWTEST()
Parameters
[in]XXis the multivariate time series matrix data (two dimensional).
[in]Nis the number of observations in XX.
[in]Mis the number of variables in XX.
[in]Kis the number of lagged difference terms used when computing the estimator.
[in]nPolyOrderis the order of the polynomial: (-1=no constant, 0=contant-only (default), 1=constant and trend).
[in]tracetestis a flag to select test: TRUE=trace, FALSE=maximal eignvalue test.
[in]Ris the assumed number of cointegrating relationships between the variables (if missing, r=1).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]retStatis the calculated test statistics score.
[out]retCVis the calculated test critical value.

◆ NDK_KDE()

int __stdcall NDK_KDE ( double * pData,
size_t nSize,
double lo,
double hi,
WORD transform,
double lambda,
WORD argKernelFunc,
double * bandwidth,
BOOL bOptimize,
WORD argOptMethod,
BOOL argAdaptive,
WORD argRetType,
double * argTargets,
size_t argCount,
double * argOutBuffer )
Parameters
[in]pDatais the input data series (one/two dimensional array).
[in]nSizeis the number of elements in pData.
[in]lois the lower bound of the x-domain. If none, pass NAN
[in]hiis the upper bound of the x-domain. If none, pass NAN
[in]transformis the transform function to use. If none (or reflective). 0=Reflective (Silverman) (default) 1=Logit (double-bound domain), 2=Probit (double-bound domain) 3=Clog-Log (double-bound domain) 4=Log (single-bound domain) 5=Power Transform (Box-Cox) (single-bound domain)
[in]lambdais the exponent for Box-Cox (power transform). Must be [0,1), Ignored for non-Box transform
[in]argKernelFuncis a switch to select the kernel function: 0=Gaussian (default), 1=Uniform 2=Triangular 3=Biweight (Quatric) 4=Triweight 5=Epanechnikov 6=Cosine
[in,out]bandwidthis the smoothing parameter (bandwidth) of the kernel density estimator. If Optimization is on, then use as initial value.
[in]bOptimizeis a flag (True/False) for searching and using the optimal value of the bandwidth factor. If missing or omitted, optimize is assumed false.
[in]argOptMethodis a switch to select the optimization method: 0=Silverman rule-of-thumb (default), 1=Direct Plug-in Method (Sheather and Jones (1991)) 2=Least squared cross validation Method (Unbiased CV) 3=Biased Cross-Validation (BCV) by (Scott & Terrel 1987)
[in]argAdaptiveis a flag (True/False) for adopting a variable bandwidth or fixed bandwidth
[in]argRetTypeis a switch specifying the desired output type: 0=probability density function (pdf) (default), 1=cumulative density function (cdf) 2=inverse cumulative function (invCDF)
argTargets[in, optional] is an array of values to calculate the KDE for. Set to NULL, if no calculation is required.
[in]argCountis the number of elements in the argTargets
argOutBuffer[out, optional] is an array of values to hold the calculated values. Set to NULL, if no calculation is required.

◆ NDK_KERNEL_DENSITY_ESTIMATE()

int __stdcall NDK_KERNEL_DENSITY_ESTIMATE ( double * pData,
size_t nSize,
double targetVal,
double bandwidth,
WORD argKernelFunc,
double * retVal )

Returns the upper/lower limit or center value of the k-th histogram bin.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_HIST_BINS(), NDK_HISTOGRAM()
Parameters
[in]pDatais the input data series (one/two dimensional array).
[in]nSizeis the number of elements in pData.
[in]targetValis the target value to compute the underlying cdf for.
[in]bandwidthis the smoothing parameter (bandwidth) of the kernel density estimator. If missing, the KDE function calculates an optimal value.
[in]argKernelFuncis a switch to select the kernel function: 1=Gaussian (default), 2=Uniform 3=Triangular 4=Biweight (Quatric) 5=Triweight 6=Epanechnikov
[out]retValis the computed value.

◆ NDK_KNN_REGRESSION()

int __stdcall NDK_KNN_REGRESSION ( double * pXData,
size_t nXSize,
double * pYData,
size_t nYSize,
size_t * pK,
WORD nMethod,
WORD KernelFn,
BOOL optimize,
double * pCVRMSE,
double * pXTargets,
size_t nXTargetSize,
double * pYForecastValues,
size_t nYTargetValuesSize,
double * pYForecastErrors,
size_t nYTargetErrorsSize )

using k-nn algorithm, estimate the value of the function represented by (x,y) data set at an intermediate x-value.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful (see SFMacros.h)
See also
NDK_INTERPOLATE(), NDK_EWMA()
Parameters
[in]pXDatais the x-component of the input data table (a one dimensional array)
[in]nXSizeis the number of elements in X
[in]pYDatais the y-component of the input data table (a one dimensional array)
[in]nYSizeis the number of elements in Y
[in,out]pKis the K-parameter of the K-NN algorithm
[in]nMethodis the K-NN regression method (0=Origional, 1=weighted by distance, 2=variable-bandwidth kernel).
0. Original K-NN
  1. Weighted (inverse of distance)
  2. Variable bandwidth Gaussian kernel-based weighting.
[in]KernelFnis the kernel function. 0. UNIFORM_KERNEL
  1. TRIANGULAR_KERNEL
  2. EPANECHNIKOV_KERNEL
  3. QUARTIC_KERNEL
  4. TRIWEIGHT_KERNEL
  5. TRICUBE_KERNEL
  6. GAUSSIAN_KERNEL
  7. COSINE_KERNEL
  8. LOGISTIC_KERNEL
  9. SIGMOID_KERNEL
  10. SILVERMAN_KERNEL
[in]optimizeis a flag (True/False) for searching and using the optimal value of the K-parameter.
[out]pCVRMSEis the RMSE measure of the cross validation
[in]pXTargetsis the desired x-value(s) to interpolate for (a single value or a one dimensional array).
[in]nXTargetSizeis the number of elements in XT
[out]pYForecastValuesis the output buffer to store the forecast/regression values of the query data points
[in]nYTargetValuesSizeis the number of elements in pYForecastValues (must equal to nXTargetSize).
[out]pYForecastErrorsis the output buffer to store the regression errors.
[in]nYTargetErrorsSizeis the number of elements in pYForecastErrors (must equal to nXTargetSize).

◆ NDK_KRNL_INTERPOLATE()

int __stdcall NDK_KRNL_INTERPOLATE ( double * X,
size_t Nx,
double * Y,
size_t Ny,
double * XT,
size_t Nxt,
WORD KernelFn,
double * kernelParam,
BOOL bOptimize,
BOOL extrapolate,
double * YVals,
size_t Nyvals,
double * pCV )

estimate the value of the function represented by (x,y) data set at an intermediate x-value.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA()
Parameters
[in]Xis the x-component of the input data table (a one dimensional array)
[in]Nxis the number of elements in X
[in]Yis the y-component of the input data table (a one dimensional array)
[in]Nyis the number of elements in Y
[in]XTis the desired x-value(s) to interpolate for (a single value or a one dimensional array).
[in]Nxtis the number of elements in XT
[in]KernelFnis the kernel function. 0. UNIFORM_KERNEL
  1. TRIANGULAR_KERNEL
  2. EPANECHNIKOV_KERNEL
  3. QUARTIC_KERNEL
  4. TRIWEIGHT_KERNEL
  5. TRICUBE_KERNEL
  6. GAUSSIAN_KERNEL
  7. COSINE_KERNEL
  8. LOGISTIC_KERNEL
  9. SIGMOID_KERNEL
  10. SILVERMAN_KERNEL
[in,out]kernelParamis the kernel smoothing parameter (aka bandwith).
[in]bOptimizeis a flag to turn on/off the optimization
[in]extrapolatesets whether or not to allow extrapolation (1=Yes, 0=No). If missing, the default is to not allow extrapolation
[out]YValsis the output buffer to store the interpolated values
[in]Nyvalsis the number of elements in YVals (must equal to Nxt).
[out]pCVis the leave-one-out cross-validation RMSE

◆ NDK_KRNL_REGRESSION()

int __stdcall NDK_KRNL_REGRESSION ( double * pXData,
size_t nXSize,
double * pYData,
size_t nYSize,
WORD POrder,
WORD nKernelFunc,
double * pAlpha,
BOOL optimize,
double * pCVRMSE,
double * pXTargets,
size_t nXTargetSize,
double * pYForecastValues,
size_t nYTargetValuesSize,
double * pYForecastErrors,
size_t nYTargetErrorsSize )

using kernel regression algorithm, estimate the value of the function represented by (x,y) data set at an intermediate x-value.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful (see SFMacros.h)
See also
NDK_KNN_REGRESSION, NDK_LOC_REGRESSION
Parameters
[in]pXDatais the x-component of the input data table (a one dimensional array)
[in]nXSizeis the number of elements in X
[in]pYDatais the y-component of the input data table (a one dimensional array)
[in]nYSizeis the number of elements in Y
[in]POrderis the order of the regression polynomial
[in]nKernelFuncis the kernel function. 0. UNIFORM_KERNEL
  1. TRIANGULAR_KERNEL
  2. EPANECHNIKOV_KERNEL
  3. QUARTIC_KERNEL
  4. TRIWEIGHT_KERNEL
  5. TRICUBE_KERNEL
  6. GAUSSIAN_KERNEL
  7. COSINE_KERNEL
  8. LOGISTIC_KERNEL
  9. SIGMOID_KERNEL
  10. SILVERMAN_KERNEL
[in,out]pAlphais the smoothing parameter of the kernel function.
[in]optimizeis a flag (True/False) for searching and using the optimal value of the K-parameter.
[out]pCVRMSEis the RMSE measure of the cross validation
[in]pXTargetsis the desired x-value(s) to interpolate for (a single value or a one dimensional array).
[in]nXTargetSizeis the number of elements in XT
[out]pYForecastValuesis the output buffer to store the forecast/regression values of the query data points
[in]nYTargetValuesSizeis the number of elements in pYForecastValues (must equal to nXTargetSize).
[out]pYForecastErrorsis the output buffer to store the regression errors.
[in]nYTargetErrorsSizeis the number of elements in pYForecastErrors (must equal to nXTargetSize).

◆ NDK_LAG()

int __stdcall NDK_LAG ( double * X,
size_t N,
size_t K )

Returns an array of cells for the backward shifted, backshifted or lagged time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_DIFF()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).

◆ NDK_LESMTH()

int __stdcall NDK_LESMTH ( double * pData,
size_t nSize,
BOOL bAscending,
double * alpha,
int xlHorizon,
BOOL bOptimize,
double * internals,
size_t nInternalsSize,
WORD wInternalSeries,
double * retVal )

Returns the (Brown's) linear exponential smoothing estimate of the value of X at time T+m (based on the raw data up to time t).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_TESMTH, NDK_DESMTH()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of elements in pData.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]alphais the smoothing factor (alpha should be between zero and one (exclusive)). If missing or omitted, a value of 0.333 is used.
[in]xlHorizonis the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.
[in]bOptimizeis a flag (True/False) for searching and using the optimal value of the smoothing factor. If missing or omitted, optimize is assumed false.
internals[out,opt] is an array of the intermediate forecast calculation.
nInternalsSize[in,opt] size of the output buffer, and number or values to return.
wInternalSeries[in, opt] a switch to select the series to return in internals ( 0 = Smoothing forecast, 1=level, 2=trend)
[out]retValis the calculated value of this function.

◆ NDK_LOCAL_REGRESSION()

int __stdcall NDK_LOCAL_REGRESSION ( double * pXData,
size_t nXSize,
double * pYData,
size_t nYSize,
WORD POrder,
WORD nKernelFunc,
double * pSpan,
BOOL optimize,
double * pCVRMSE,
double * pXTargets,
size_t nXTargetSize,
double * pYForecastValues,
size_t nYTargetValuesSize,
double * pYForecastErrors,
size_t nYTargetErrorsSize )

using local regression (LOESS or LOWESS) algorithm, estimate the value of the function represented by (x,y) data set at an intermediate x-value.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful (see SFMacros.h)
See also
NDK_KNN_REGRESSION, NDK_LOC_REGRESSION
Parameters
[in]pXDatais the x-component of the input data table (a one dimensional array)
[in]nXSizeis the number of elements in X
[in]pYDatais the y-component of the input data table (a one dimensional array)
[in]nYSizeis the number of elements in Y
[in]POrderis the order of the regression polynomial
[in]nKernelFuncis the kernel function. 0. UNIFORM_KERNEL
  1. TRIANGULAR_KERNEL
  2. EPANECHNIKOV_KERNEL
  3. QUARTIC_KERNEL
  4. TRIWEIGHT_KERNEL
  5. TRICUBE_KERNEL
  6. GAUSSIAN_KERNEL
  7. COSINE_KERNEL
  8. LOGISTIC_KERNEL
  9. SIGMOID_KERNEL
  10. SILVERMAN_KERNEL
[in,out]pSpanis the percentage of the total number of the data points used in local regression .
[in]optimizeis a flag (True/False) for searching and using the optimal value of the K-parameter.
[out]pCVRMSEis the RMSE measure of the cross validation
[in]pXTargetsis the desired x-value(s) to interpolate for (a single value or a one dimensional array).
[in]nXTargetSizeis the number of elements in XT
[out]pYForecastValuesis the output buffer to store the forecast/regression values of the query data points
[in]nYTargetValuesSizeis the number of elements in pYForecastValues (must equal to nXTargetSize).
[out]pYForecastErrorsis the output buffer to store the regression errors.
[in]nYTargetErrorsSizeis the number of elements in pYForecastErrors (must equal to nXTargetSize).

◆ NDK_LOGIT()

int __stdcall NDK_LOGIT ( double * X,
size_t N,
double lo,
double hi,
WORD retTYpe )

Computes the complementary log-log transformation, including its inverse.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_PROBIT(), NDK_BOXCOX(), NDK_CLOGLOG()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]lois the domain lower bound, if missing, lo=0
[in]hiis the domain upper bound, if missing, hi=1
[in]retTYpeis a number that determines the type of return value: 1 (or missing)=logit, 2=inverse logit.

◆ NDK_LRVAR()

int __stdcall NDK_LRVAR ( double * X,
size_t N,
size_t w,
double * retVal )

Returns the long-run variance using a Bartlett kernel with window size k.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The input time series data may include missing values (NaN), but they will not be included in the calculations.
2. The long-run variance is computed as follows:
  • $\sigma^2=\frac{1}{T}\sum_{t=k}^{T-k}\sum_{i=-k}^k w_i(x_t-\bar{x})(x_{t-i}-\bar{x})$
3. Where:
  • $x_{t} \in X$ is a value from the input time series data.
  • $\bar{x}$ is the mean of the input time series data. -The weight $w_i$ in Bartlett kernel is defined as follows:
    • $w_i= 1- \frac{\left | i \right |}{k+1}$
  • $k$ is the input window size for the Bartlett kernel.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]Xis the input data sample (a one/two dimensional array).
[in]Nis the number of observations in X.
[in]wis the input Bartlett kernel window size. If omitted, the default value is the cubic root of the sample data size.
[out]retValis the calculated value of this function.

◆ NDK_MA()

int __stdcall NDK_MA ( double * pData,
size_t nSize,
BOOL bAscending,
int nWindowSize,
int nVariant,
double * internals,
size_t nInternalsSize,
double * retVal )

Returns the moving/rolling (MA) estimate of the value of X at time t+m (based on the raw data up to time t).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA(), NDK_DESMTH(), NDK_TESMTH, NDK_LESMTH()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of elements in pData.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]nWindowSizeis the number of observation in the rolling window.
[in]nVariantis the type of exponential moving average (i.e. 0= Simple (default), 1= Double, 2=Triple, 3=Zero-lagged)
internals[out,opt] is an array of the intermediate forecast calculation.
nInternalsSize[inout,opt] size of the output buffer, and number or values to return.
[out]retValis the calculated value of this function.

◆ NDK_MAAPE()

int __stdcall NDK_MAAPE ( double * X,
double * Y,
size_t N,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecast time series data (a one dimensional array).
[in]Nis the number of observations in X.
[out]retValis the calculated value of this function.

◆ NDK_MAD()

int __stdcall NDK_MAD ( double * X,
size_t N,
WORD reserved,
double * retVal )

Returns the sample median of absolute deviation (MAD).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The input data series may include missing values (NaN), but they will not be included in the calculations.
2. The median of absolute deviation (MAD) is defined as follows:
  • $\operatorname{MAD} = \operatorname{median}_{i}\left(\ \left| X_{i} - \operatorname{median}_{j} (X_{j}) \right|\ \right)$
3. In short, starting with the deviations from the data's median, the MAD is the median of their absolute values.
4. The median of absolute deviation (MAD) is a measure of statistical dispersion.
5. MAD is a more robust estimator of scale than the sample variance or standard deviation.
6. MAD is especially useful with distributions that have neither mean nor variance (e.g. the Cauchy distribution.)
7. MAD is a robust statistic because it is less sensitive to outliers in a data series than standard deviation.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]Xis the input data sample (a one/two dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated value of this function.

◆ NDK_MAE()

int __stdcall NDK_MAE ( double * X,
double * Y,
size_t N,
double * retVal )

Calculates the mean absolute error function for the forecast and the eventual outcomes.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The mean absolute error is a common measure of forecast error in time series analysis.
2. The time series is homogeneous or equally spaced.
3. The two time series must be identical in size.
4. The mean absolute error is given by:
  • $\mathrm{MAE}=\frac{\mathrm{SAE}}{N}=\frac{\sum_{i=1}^N \left | x_i - \hat x_i \right |}{N}$, where:
    • $\{x_i\}$ is the actual observations time series.
    • $\{\hat x_i\}$ is the estimated or forecasted time series.
    • $\mathrm{SAE}$ is the sum of the absolute errors (or deviations).
    • $N$ is the number of non-missing data points.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecast time series data (a one dimensional array).
[in]Nis the number of observations in X.
[out]retValis the calculated value of this function.

◆ NDK_MAPE()

int __stdcall NDK_MAPE ( double * X,
double * Y,
size_t N,
BOOL SMAPE,
double * retVal )

Calculates the mean absolute percentage error (deviation) function for the forecast and the eventual outcomes.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. MAPE is also referred to as MAPD.
2. The time series is homogeneous or equally spaced.
3. For a plain MAPE calculation, in the event that an observation value (i.e. $x_k$) is equal to zero, the MAPE function skips that data point.
4. The mean absolute percentage error (MAPE), also known as mean absolute percentage deviation (MAPD), measures the accuracy of a method for constructing fitted time series values in statistics.
5. The two time series must be identical in size.
6. The mean absolute percentage error (MAPE) is defined as follows:
  • $\mathrm{MAPE}=\frac{100}{N}\times \sum_{i=1}^N \left | \frac{x_i - \hat x_i}{x_i} \right |$, where:
    • $\{x_i\}$ is the actual observations time series.
    • $\{\hat x_i\}$ is the estimated or forecasted time series.
    • $N$ is the number of non-missing data points.
7. When calculating the average MAPE for a number of time series, you may encounter a problem: a few of the series that have a very high MAPE might distort a comparison between the average MAPE of a time series fitted with one method compared to the average MAPE when using another method.
8. In order to avoid this problem, other measures have been defined, for example the SMAPE (symmetrical MAPE), weighted absolute percentage error (WAPE), real aggregated percentage error and relative measure of accuracy (ROMA).
9. The symmetrical mean absolute percentage error (SMAPE) is defined as follows:
  • $\mathrm{SMAPE}=\frac{200}{N}\times \sum_{i=1}^N \left | \frac{x_i - \hat x_i}{x_i+\hat x_i} \right |$
10. The SMAPE is easier to work with than MAPE, as it has a lower bound of 0% and an upper bound of 200%.
11. The SMAPE does not treat over-forecast and under-forecast equally.
12. For a SMAPE calculation, in the event the sum of the observation and forecast values (i.e. $x_k + \hat x_k$) equals zero, the MAPE function skips that data point.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecast time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]SMAPEis a switch to select the return output (FALSE=MAPE (default), TRUE=Symmetric MAPE (SMAPI)).
[out]retValis the calculated value of this function.

◆ NDK_MASE()

int __stdcall NDK_MASE ( double * X,
double * Y,
size_t N,
size_t M,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecast time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Mis the seasonal period (for non-seasonal time series, set M=1).
[out]retValis the calculated value of this function.

◆ NDK_MAX()

int __stdcall NDK_MAX ( double * X,
size_t N,
WORD reserved,
double * retVal )

Calculates the maximum value in a given sample.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_MIN(), NDK_QAUNTILE()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated maximum value.

◆ NDK_MD()

int __stdcall NDK_MD ( double * pData,
size_t nSize,
WORD reserved,
double * retVal )

Returns the mean difference of the input data series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series may include missing values (NaN), but they will not be included in the calculations.
2. The sample mean difference (MD) is computed as follows:
  • $\Delta = \textup{MD} = \frac{\sum_{i=1}^n \sum_{j=1}^n \| x_i - x_j \|}{n \times \left ( n-1 \right )}$
3. Where:
  • $x_i$ is the value of the i-th non-missing observation.
  • $n$ is the number of non-missing observations in the sample.
4. The mean difference is the product of the sample mean and the relative mean difference (RMD) and so can also be expressed in terms of the NDK_GINI:
  • $\textup{MD}= 2 \times G \times \bar{x}$
5. Where:
  • $\bar{x}$ is the arithmetic sample mean.
  • $G$ is the NDK_GINI.
6. Because of its ties to the Gini coefficient, the mean difference is also called the "Gini mean difference." It is also known as the "absolute mean difference."
7. The sample mean difference is not dependent on a specific measure of central tendency like the standard deviation.
8. The mean difference of a sample is an unbiased and consistent estimator of the population mean difference.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]pDatais the input data series (one/two dimensional array).
[in]nSizeis the number of observations in pData.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the computed value.

◆ NDK_MDA()

int __stdcall NDK_MDA ( double * X,
double * Y,
size_t N,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecast time series data (a one dimensional array).
[in]Nis the number of observations in X.
[out]retValis the calculated value of this function.

◆ NDK_MdAPE()

int __stdcall NDK_MdAPE ( double * X,
double * Y,
size_t N,
BOOL SMAPE,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecast time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]SMAPEis a switch to select the scale to divide on: FALSE = Actual obs., TRUE= Average (Actual, Forecast)
[out]retValis the calculated value of this function.

◆ NDK_MdRAE()

int __stdcall NDK_MdRAE ( double * X,
double * Y,
size_t N,
size_t period,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecasted time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]periodis the seasonal period (for non-seasonal time series, set M=1).
[out]retValis the calculated median of relative absolute error

◆ NDK_MEANTEST()

int __stdcall NDK_MEANTEST ( double * X,
size_t N,
double target,
double alpha,
WORD method,
WORD retType,
double * retVal )

Calculates the p-value of the statistical test for the population mean.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_SKEWTEST(), NDK_STDEVTEST()
Parameters
[in]Xis the sample data (a one dimensional array).
[in]Nis the number of observations in X.
[in]targetis the assumed mean value. If missing, a default of zero is assumed.
[in]alphais the statistical significance level. If missing, the default of 5% is assumed.
[in]methodis the statistical test to perform (1=parametric).
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[out]retValis the calculated test statistics.

◆ NDK_MIN()

int __stdcall NDK_MIN ( double * X,
size_t N,
WORD reserved,
double * retVal )

Calculates the minimum value in a given sample.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_MAX(), NDK_QAUNTILE(), NDK_IQR()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated minimum value.

◆ NDK_MLR_ANOVA()

int __stdcall NDK_MLR_ANOVA ( double ** pXData,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
WORD nRetType,
double * retVal )

Calculates the regression model analysis of the variance (ANOVA) values.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_FITTED(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE
Parameters
[in]pXDatais the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSizeis the number of observations (rows) in X
[in]nXVarsis the number of independent (explanatory) variables (columns) in X.
[in]maskis the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLenis the number of elements in the "mask."
[in]Yis the response or dependent variable data array (one dimensional array of cells).
[in]nYSizeis the number of observations in Y.
[in]interceptis the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.
[in]nRetTypeis a switch to select the output (1=SSR (default), 2=SSE, 3=SST, 4=MSR, 5=MSE, 6=F-stat, 7=P-value):
  1. SSR (sum of squares of the regression)
  2. SSE (sum of squares of the residuals)
  3. SST (sum of squares of the dependent variable)
  4. MSR (mean squares of the regression)
  5. MSE (mean squares error or residuals)
  6. F-stat (test score)
  7. Significance F (P-value of the test)
[out]retValis the calculated statistics ANOVA output.

◆ NDK_MLR_FITTED()

int __stdcall NDK_MLR_FITTED ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
WORD nRetType )

Returns the fitted values of the conditional mean, residuals or leverage measures.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE
Parameters
[in]Xis the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSizeis the number of observations (rows) in X.
[in]nXVarsis the number of independent (explanatory) variables (columns) in X.
[in]maskis the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLenis the number of elements in the "mask."
[in]Yis the response or dependent variable data array (one dimensional array of cells).
[in]nYSizeis the number of observations in Y.
[in]interceptis the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.
[in]nRetTypeis a switch to select the return output (1=fitted values (default), 2=residuals, 3=standardized residuals, 4=leverage, 5=Cook's distance).
  1. Fitted/conditional mean
  2. Residuals
  3. Standardized residuals
  4. Leverage factor (H)
  5. Cook's distance (D)

◆ NDK_MLR_FORE()

int __stdcall NDK_MLR_FORE ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
double * target,
double alpha,
WORD nRetType,
double * retVal )

Calculates the forecast mean, error and confidence interval.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_MLR_PARAM(), NDK_MLR_FITTED(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE
Parameters
[in]Xis the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSizeis the number of observations (rows) in X.
[in]nXVarsis the number of independent (explanatory) variables (columns) in X.
[in]maskis the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLenis the number of elements in the "mask."
[in]Yis the response or the dependent variable data array (one dimensional array of cells).
[in]nYSizeis the number of observations in Y.
[in]interceptis the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.
[in]targetis the value of the explanatory variables (a one dimensional array).
[in]alphais the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nRetTypeis a switch to select the return output (1=forecast (default), 2=error, 3=upper limit, 4=lower limit):
  1. Forecast (mean)
  2. Std error
  3. Upper limit of the confidence interval
  4. Lower limit of the conficence interval
[out]retValis the computed forecast statistics.

◆ NDK_MLR_GOF()

int __stdcall NDK_MLR_GOF ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
WORD nRetType,
double * retVal )

Calculates a measure for the goodness of fit (e.g. R^2).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_FITTED(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE
Parameters
[in]Xis the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSizeis the number of observations (rows) in X.
[in]nXVarsis the number of independent (explanatory) variables (columns) in X.
[in]maskis the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLenis the number of elements in the "mask."
[in]Yis the response or dependent variable data array (one dimensional array of cells).
[in]nYSizeis the number of observations in Y.
[in]interceptis the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.
[in]nRetTypeis a switch to select a fitness measure (1=R-square (default), 2=adjusted R-square, 3=RMSE, 4=LLF, 5=AIC, 6=BIC/SIC):
  1. R-square (coefficient of determination)
  2. Adjusted R-square
  3. Regression Error (RMSE)
  4. Log-likelihood (LLF)
  5. Akaike information criterion (AIC)
  6. Schwartz/Bayesian information criterion (SIC/BIC)
[out]retValis the calculated goodness-of-fit statistics.

◆ NDK_MLR_PARAM()

int __stdcall NDK_MLR_PARAM ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
double alpha,
WORD nRetType,
WORD nParamIndex,
double * retVal )

Calculates the OLS regression coefficients values.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_MLR_FORE(), NDK_MLR_FITTED(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE
Parameters
[in]Xis the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSizeis the number of observations (rows) in X.
[in]nXVarsis the number of independent (explanatory) variables (columns) in X.
[in]maskis the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLenis the number of elements in the "mask."
[in]Yis the response or the dependent variable data array (one dimensional array of cells).
[in]nYSizeis the number of observations in Y.
[in]interceptis the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.
[in]alphais the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nRetTypeis a switch to select the return output (1=value (default), 2=std. error, 3=t-stat, 4=P-value, 5=upper limit (CI), 6=lower limit (CI)):
  1. Value (mean)
  2. Std error
  3. Test score
  4. P-value
  5. Upper limit of the confidence interval
  6. Lower limit of the confidence interval
[in]nParamIndexis a switch to designate the target parameter (0=intercept (default), 1=first variable, 2=2nd variable, etc.).
[out]retValis the computed statistics of the regression coefficient.

◆ NDK_MLR_PRFTest()

int __stdcall NDK_MLR_PRFTest ( double ** X,
size_t nXSize,
size_t nXVars,
double * Y,
size_t nYSize,
double intercept,
LPBYTE mask1,
size_t nMaskLen1,
LPBYTE mask2,
size_t nMaskLen2,
double alpha,
WORD nRetType,
double * retVal )

Calculates the p-value and related statistics of the partial f-test (used for testing the inclusion/exclusion variables).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_FITTED, NDK_MLR_STEPWISE
Parameters
[in]Xis the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSizeis the number of observations (rows) in X.
[in]nXVarsis the number of independent (explanatory) variables (columns) in X.
[in]Yis the response or dependent variable data array (one dimensional array of cells).
[in]nYSizeis the number of observations in Y.
[in]interceptis the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.
[in]mask1is the boolean array to choose the explanatory variables in model 1. If missing, all variables in X are included.
[in]nMaskLen1is the number of elements in "mask1."
[in]mask2is the boolean array to choose the explanatory variables in model 2. If missing, all variables in X are included.
[in]nMaskLen2is the number of elements in "mask2."
[in]alphais the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nRetTypeis a switch to select the return output (1 = P-Value (default), 2 = Test Stats, 3 = Critical Value.)
[out]retValis the calculated test statistics/

◆ NDK_MLR_STEPWISE()

int __stdcall NDK_MLR_STEPWISE ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
double alpha,
WORD nMode )

Returns a list of the selected variables after performing the stepwise regression.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE
Parameters
[in]Xis the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSizeis the number of observations (rows) in X.
[in]nXVarsis the number of independent (explanatory) variables (columns) in X.
[in,out]maskis the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLenis the number of elements in the "mask."
[in]Yis the response or dependent variable data array (one dimensional array of cells).
[in]nYSizeis the number of observations in Y.
[in]interceptis the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.
[in]alphais the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nModeis a switch to select the variable's inclusion/exclusion approach (1=forward selection (default), 2=backward elimination , 3=bi-directional elimination):
  1. Forward selection
  2. Bacward elemination
  3. Bi-directional elemination

◆ NDK_MRAE()

int __stdcall NDK_MRAE ( double * X,
double * Y,
size_t N,
size_t period,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecasted time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]periodis the seasonal period (for non-seasonal time series, set M=1).
[out]retValis the calculated mean of relative absolute error

◆ NDK_MSE()

int __stdcall NDK_MSE ( double * X,
double * Y,
size_t N,
double * retVal )

Calculates the mean squared errors of the prediction function.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The two data sets must be identical in size.
2. A missing value (e.g. $x_k$ or $\hat x_k$) in either time series will exclude the data point $(x_k,\hat x_k)$ from the MSE.
See also
NDK_SSE()
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecasted time series data (a one dimensional array).
[in]Nis the number of observations in X.
[out]retValis the calculated mean of squared errors.

◆ NDK_MSG()

int __stdcall NDK_MSG ( int nRetCode,
LPTSTR pMsg,
size_t nSize )

write a log message to the logging system

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
SFMacros.h, SFLogger.h, SFLOG_LogMsg()
Parameters
[in]nRetCodeis the log level (1=trace, 2=Debug, 3=Info, 4=Warn, 5=Error, 6=Fatal Error)
[in]pMsgis the log message
[in]nSizeus the number of characters in pMsg

◆ NDK_NORMALTEST()

int __stdcall NDK_NORMALTEST ( double * X,
size_t N,
double alpha,
WORD method,
WORD retType,
double * retVal )

Returns the p-value of the normality test (i.e. whether a data set is well-modeled by a normal distribution).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_MEANTEST(), NDK_SKEWTEST(), NORMALTEST_METHOD, TEST_RETURN
Parameters
[in]Xis the sample data (a one dimensional array).
[in]Nis the number of observations in X.
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]methodis the statistical test to perform (1=Jarque-Bera, 2=Shapiro-Wilk, 3=Chi-Square (Doornik and Hansen)).
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[out]retValis the calculated test statistics.

◆ NDK_PACF()

int __stdcall NDK_PACF ( double * X,
size_t N,
size_t K,
WORD method,
double * retVal )

Calculates the sample partial autocorrelation function (PACF).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ACF(), NDK_PACF_ERROR(),NDK_PACFCI()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]methodis the method for calculating PACF: 0 = MLR, 1= From ACF
[out]retValis the calculated sample partial-autocorrelation value.

◆ NDK_PACF_ERROR()

int __stdcall NDK_PACF_ERROR ( double * X,
size_t N,
size_t K,
double * retVal )

Calculates the standard error of the sample partial autocorrelation function (PACF).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_PACF(), NDK_PACFCI()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[out]retValis the standard error in the sample partial-autocorrelation value.

◆ NDK_PACFCI()

int __stdcall NDK_PACFCI ( double * X,
size_t N,
size_t K,
double alpha,
double * ULCI,
double * LLCI )

Calculates the confidence interval limits (upper/lower) for the partial-autocorrelation function.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ACF(), NDK_ACF_ERROR()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]ULCIis the upper limit value of the confidence interval.
[out]LLCIis the lower limit value of the confidence interval.

◆ NDK_PB()

int __stdcall NDK_PB ( double * X,
double * Y,
size_t N,
size_t period,
WORD basis,
double * retVal )
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecasted time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]periodis the seasonal period (for non-seasonal time series, set M=1).
[in]basisis the switch to specify the metric used for comparison: 0=absolute error, 1=MAE, 2=MSE
[out]retValis the calculated geometric mean of relative absolute error

◆ NDK_PCA_COMP()

int __stdcall NDK_PCA_COMP ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
WORD standardize,
WORD nCompIndex,
WORD retType,
double * retVal,
size_t nOutSize )

Returns an array of cells for the i-th principal component (or residuals).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nXSizeis the number of observations (i.e. rows) in X
[in]nXVarsis the number of variables (i.e. columns) in X
[in]maskis the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLenis the number of elements in
[in]standardizeis a flag or switch to standardize the input variables prior to the analysis:
  1. standardize ((subtract mean and divide by standard deviation)
  2. subtract mean.
[in]nCompIndexis the component number to return.
[in]retTypeis a switch to select the return output
  1. proportion of variance,
  2. variance,
  3. eigenvalue,
  4. loadings,
  5. Principal Component (PC) data.
[out]retValis the calculated value or data
[in]nOutSizeis the size of retVal

◆ NDK_PCA_VAR()

int __stdcall NDK_PCA_VAR ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE varMask,
size_t nMaskLen,
WORD standardize,
WORD nVarIndex,
WORD wMacPC,
WORD retType,
double * retVal,
size_t nOutSize )

Returns an array of cells for the fitted values of the i-th input variable.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nXSizeis the number of observations (i.e. rows) in X
[in]nXVarsis the number of variables (i.e. columns) in X
[in]varMaskis the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLenis the number of elements in mask
[in]standardizeis a flag or switch to standardize the input variables prior to the analysis:
  1. standardize ((subtract mean and divide by standard deviation)
  2. subtract mean.
[in]nVarIndexis the input variable number
[in]wMacPCis the number of principal components (PC) to include
[in]retTypeis a switch to select the return output:
  1. final communality
  2. loading/weights
  3. fitted values
  4. residuals
[out]retValis the calculated value or data
[in]nOutSizeis the size of retVal

◆ NDK_PCR_ANOVA()

int __stdcall NDK_PCR_ANOVA ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
WORD nRetType,
double * retVal )

Returns an array of cells for the i-th principal component (or residuals).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nXSizeis the number of observations (i.e. rows) in X
[in]nXVarsis the number of variables (i.e. columns) in X
[in]maskis the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLenis the number of elements in mask
[in]Yis the response or the dependent variable data array (one dimensional array)
[in]nYSizeis the number of elements in Y
[in]interceptis the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally
[in]nRetTypeis a switch to select the return output:
  1. SSR (sum of squares of the regression)
  2. SSE (sum of squares of the residuals)
  3. SST (sum of squares of the dependent variable)
  4. MSR (mean squares of the regression)
  5. MSE (mean squares error or residuals)
  6. F-stat (test score)
  7. Significance F (P-value of the test)
[out]retValis the calculated statistics ANOVA output.

◆ NDK_PCR_FITTED()

int __stdcall NDK_PCR_FITTED ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
WORD nRetType )

Returns an array of cells for the i-th principal component (or residuals).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nXSizeis the number of observations (i.e. rows) in X
[in]nXVarsis the number of variables (i.e. columns) in X
[in]maskis the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLenis the number of elements in mask
[in,out]Yis the response or the dependent variable data array (one dimensional array)
[in]nYSizeis the number of elements in Y
[in]interceptis the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally
[in]nRetTypeis a switch to select the return output
  1. fitted values (default),
  2. residuals,
  3. standardized residuals,
  4. leverage (H),
  5. Cook's distance.

◆ NDK_PCR_FORE()

int __stdcall NDK_PCR_FORE ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
double * target,
double alpha,
WORD nRetType,
double * retVal )

Calculates the model's estimated values, std. errors and related statistics.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nXSizeis the number of observations (i.e. rows) in X
[in]nXVarsis the number of variables (i.e. columns) in X
[in]maskis the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLenis the number of elements in mask
[in]Yis the response or the dependent variable data array (one dimensional array)
[in]nYSizeis the number of elements in Y
[in]interceptis the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally
[in]targetis the value of the explanatory variables (a one dimensional array)
[in]alphais the statistical significance of the test (i.e. alpha)
[in]nRetTypeis a switch to select the return output (1 = forecast (default), 2 = error, 3 = upper limit, 4 = lower limit).
[out]retValis the calculated forecast value or statistics.

◆ NDK_PCR_GOF()

int __stdcall NDK_PCR_GOF ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
WORD nRetType,
double * retVal )

Returns an array of cells for the i-th principal component (or residuals).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nXSizeis the number of observations (i.e. rows) in X
[in]nXVarsis the number of variables (i.e. columns) in X
[in]maskis the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLenis the number of elements in mask
[in]Yis the response or the dependent variable data array (one dimensional array)
[in]nYSizeis the number of elements in Y
[in]interceptis the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally
[in]nRetTypeis a switch to select a fitness measure (1 = R-Square (default), 2 = Adjusted R Square, 3 = RMSE, 4 = LLF, 5 = AIC, 6 = BIC/SIC ).
  1. R-square (coefficient of determination)
  2. Adjusted R-square
  3. Regression Error (RMSE)
  4. Log-likelihood (LLF)
  5. Akaike information criterion (AIC)
  6. Schwartz/Bayesian information criterion (SIC/BIC)
[out]retValis the calculated goodness of fit measure

◆ NDK_PCR_PARAM()

int __stdcall NDK_PCR_PARAM ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
double alpha,
WORD nRetType,
WORD nParamIndex,
double * retVal )

Calculates the regression coefficients values for a given input variable.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nXSizeis the number of observations (i.e. rows) in X
[in]nXVarsis the number of variables (i.e. columns) in X
[in]maskis the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLenis the number of elements in mask
[in]Yis the response or the dependent variable data array (one dimensional array)
[in]nYSizeis the number of elements in Y
[in]interceptis the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally
[in]alphais the statistical significance of the test (i.e. alpha)
[in]nRetTypeis a switch to select the return output:
  1. Value (default),
  2. Std. Error
  3. t-stat
  4. P-Value
  5. Upper Limit (CI)
  6. Lower Limit (CI))
[in]nParamIndexis a switch to designate the target parameter (0 = intercept (default), 1 = first variable, 2 = 2nd variable, etc.).
[out]retValis the calculated parameter value or statistics.

◆ NDK_PCR_PRFTest()

int __stdcall NDK_PCR_PRFTest ( double ** X,
size_t nXSize,
size_t nXVars,
double * Y,
size_t nYSize,
double intercept,
LPBYTE mask1,
size_t nMaskLen1,
LPBYTE mask2,
size_t nMaskLen2,
double alpha,
WORD nRetType,
double * retVal )

Returns an array of cells for the i-th principal component (or residuals).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nXSizeis the number of observations (i.e. rows) in X
[in]nXVarsis the number of variables (i.e. columns) in X
[in]Yis the response or the dependent variable data array (one dimensional array)
[in]nYSizeis the number of elements in Y
[in]interceptis the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally
[in]mask1is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLen1is the number of elements in mask1
[in]mask2is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLen2is the number of elements in mask2
[in]alphais the statistical significance of the test (i.e. alpha)
[in]nRetTypeis a switch to select the return output (1 = P-Value (default), 2 = Test Stats, 3 = Critical Value.)
[out]retValis the calculated test statistics/

◆ NDK_PCR_STEPWISE()

int __stdcall NDK_PCR_STEPWISE ( double ** X,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * Y,
size_t nYSize,
double intercept,
double alpha,
WORD nMode )

Returns an array of cells for the i-th principal component (or residuals).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()
Parameters
[in]Xis the independent variables data matrix, such that each column represents one variable
[in]nXSizeis the number of observations (i.e. rows) in X
[in]nXVarsis the number of variables (i.e. columns) in X
[in]maskis the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included.
[in]nMaskLenis the number of elements in mask
[in]Yis the response or the dependent variable data array (one dimensional array)
[in]nYSizeis the number of elements in Y
[in]interceptis the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally
[in]alphais the statistical significance of the test (i.e. alpha)
[in]nModeis a switch to select the variable's inclusion/exclusion approach (1=forward selection (default), 2=backward elimination , 3=bi-directional elimination):
  1. Forward selection
  2. Bacward elemination
  3. Bi-directional elemination

◆ NDK_PERIODOGRAM()

int __stdcall NDK_PERIODOGRAM ( double * pData,
size_t nSize,
PERIODOGRAM_OPTION_TYPE option,
double alpha,
double * retVal,
size_t nOutSize )

Calculates the periodgram value for different lags.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ACF(), NDK_PACF()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in pData.
[in]optionis the pre-processing option to the time series (e.g. detrend, difference, auto, etc.)
[in]alphais the statistical significance level (used in the auto-process procedure). If missing, a default of 5% is assumed.
[out]retValis the periodogram values for this series
[in]nOutSizeis the size of the output buffer (i.e. retVal)

◆ NDK_PORTFOLIO_CAPM()

int __stdcall NDK_PORTFOLIO_CAPM ( double * returns,
double * benchmark,
double * Rf,
size_t nLen,
WORD frequency,
double * retBeta,
double * retAlpha )

Calculates the CAPM Alpha and Beta.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE() [out] is the CAPM Alpha
Parameters
[in]frequencyis the number of observations in a year (e.g., 12=monthly)
[out]retBetais the CAPM Beta

◆ NDK_PORTFOLIO_COVARIANCE()

int __stdcall NDK_PORTFOLIO_COVARIANCE ( double * weights1,
double * weights2,
size_t nAssets,
double ** covar,
double * retVal )

Calculates the covariance between two portfolios.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_VARIANCE()

◆ NDK_PORTFOLIO_CVaR()

int __stdcall NDK_PORTFOLIO_CVaR ( double * returns,
size_t nLen,
double confidence,
WORD argOptMethod,
WORD argKDEMethod,
WORD argTheoDist,
double * argVaR,
double * retVal )

Calculates the theoretical/Gaussian and Historical CVaR.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE() [out] is the conditional VaR (CVaR) value
Parameters
[in]confidenceis the confidence level of the VaR
[in]argOptMethodis a switch to select the CVaR method: 0=Historical (default), 1=Kernel density estimation (KDE) 2=Theoretical
[in]argKDEMethodis a switch to select the KDE B/W optimization method: 0=Silverman rule-of-thumb (default), 1=Direct Plug-in Method (Sheather and Jones (1991)) 2=Least squared cross validation Method (Unbiased CV) 3=Biased Cross-Validation (BCV) by (Scott & Terrel 1987)
[in]argTheoDistis a switch to select underlying theoretical probability distribution : 0=Gaussin (default), 1=Log-Normal distribution
argVaR[out, optional] is the VaR value

◆ NDK_PORTFOLIO_DWSDEV()

int __stdcall NDK_PORTFOLIO_DWSDEV ( double * returns,
size_t nLen,
double MAR,
double * retVal )

Calculates the downside deviation of a series of simple returns.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE()

◆ NDK_PORTFOLIO_MCR()

int __stdcall NDK_PORTFOLIO_MCR ( double * returns,
double * index,
size_t nLen,
BOOL downside,
WORD frequency,
double * retVal )

Calculates the upside/downside market capture ratio (MCR) of a series of simple returns.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE()

◆ NDK_PORTFOLIO_MDD()

int __stdcall NDK_PORTFOLIO_MDD ( double * returns,
size_t nLen,
double * retVal )

Calculates the overall max-drawdown (MDD) of a series of simple returns.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE()

◆ NDK_PORTFOLIO_RET()

int __stdcall NDK_PORTFOLIO_RET ( double * weights,
size_t nAssets,
double * returns,
double * ret )

compute the portfolio equivalent returns

Calculates the portfolio equivalent return.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_VARIANCE(), NDK_PORTFOLIO_COVARIANCE()

◆ NDK_PORTFOLIO_RISK_RATIO()

int __stdcall NDK_PORTFOLIO_RISK_RATIO ( double * returns,
double * riskfree,
size_t nLen,
WORD frequency,
double beta,
WORD ratioType,
double * retVal )

Calculates the portfolio risk rations.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE() [out] is the computer risk ratio (Annualized)
Parameters
[in]ratioTypeis a switch to select underlying theoretical probability distribution : 0=Gaussin (default), 1=Log-Normal distribution

◆ NDK_PORTFOLIO_VaR()

int __stdcall NDK_PORTFOLIO_VaR ( double * returns,
size_t nLen,
double confidence,
WORD argOptMethod,
WORD argKDEMethod,
WORD argTheoDist,
double * retVal )

Calculates the theoretical/Gaussian and Historical VaR.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE()
Parameters
[in]argOptMethodis a switch to select the VaR method: 0=Historical (default), 1=Kernel density estimation (KDE) 2=Theoretical
[in]argKDEMethodis a switch to select the KDE B/W optimization method: 0=Silverman rule-of-thumb (default), 1=Direct Plug-in Method (Sheather and Jones (1991)) 2=Least squared cross validation Method (Unbiased CV) 3=Biased Cross-Validation (BCV) by (Scott & Terrel 1987)
[in]argTheoDistis a switch to select underlying theoretical probability distribution : 0=Gaussin (default), 1=Log-Normal distribution

◆ NDK_PORTFOLIO_VARIANCE()

int __stdcall NDK_PORTFOLIO_VARIANCE ( double * weights,
size_t nAssets,
double ** covar,
double * variance )

Calculates the overall portfolio variance (volatility squared).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE()

◆ NDK_PROBIT()

int __stdcall NDK_PROBIT ( double * X,
size_t N,
double lo,
double hi,
WORD retTYpe )

Computes the probit transformation, including its inverse.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_HodrickPrescotFilter(), NDK_DFT(), NDK_IDFT()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]lois the domain lower bound, if missing, lo=0
[in]hiis the domain upper bound, if missing, hi=1
[in]retTYpeis a number that determines the type of return value: 1 (or missing)=probit , 2=inverse probit.

◆ NDK_QUANTILE()

int __stdcall NDK_QUANTILE ( double * X,
size_t N,
double p,
double * retVal )

Returns the sample p-quantile of the non-missing observations (i.e. divides the sample data into equal parts determined by the percentage p).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series may include missing values (NaN), but they will not be included in the calculations.
2. The quantile function for any distribution is defined between 0 and 1. Its function is the inverse of the cumulative distribution function (CDF).
3. The quantile function returns the sample median when $p=0.5$.
4. The quantile function returns the sample minimum when $p=0$.
5. The quantile function returns the sample maximum when $p=1$.
6. For any probability distribution, the following holds true for the probability $p$:
  • $P(X< q)\geq p$, where:
    • $q$ is the sample $p$-quantile.
See also
NDK_IQR(), NDK_MIN(), NDK_MAX()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[in]pis a scalar value between 0 and 1 (exclusive).
[out]retValis the calculated p-th quantile value.

◆ NDK_REGEX_MATCH()

int __stdcall NDK_REGEX_MATCH ( LPCTSTR szLine,
LPCTSTR szPattern,
BOOL ignoreCase,
BOOL partialOK,
BOOL * bMatch )

Returns TRUE if the string matches the regular expression expressed.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
NDK_REGEX_REPLACE(), NDK_TOKENIZE()
Parameters
[in]szLineis the input string to match for.
[in]szPatternis the regular expression (regex PERL-style) to match the input string with (e.g. ^Thi[sS].*$).
[in]ignoreCaseis a flag to instruct the function to ignore the letter-case in the string
[in]partialOKis a flag/switch to indicate whether a substring or a partial match (search) is permitted or to only consider full-string match.
[out]bMatchis the return value of the match.

◆ NDK_REGEX_REPLACE()

int __stdcall NDK_REGEX_REPLACE ( LPCTSTR szLine,
LPCTSTR szKey,
LPCTSTR szValue,
BOOL ignoreCase,
BOOL global,
LPTSTR pRetVal,
size_t * nSize )

Returns the modified string after performing match/replace on the given string.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
NDK_REGEX_REPLACE(), NDK_TOKENIZE()
Parameters
[in]szLineis the input string to process.
[in]szKeyis the regular expression (PERL-style) (e.g. "^\d\w{1,2}.*$").
[in]szValueis the value to replace the match with. If missing or omitted, an empty string is used
[in]ignoreCaseis a flag to instruct the matching function whether to ignore letter-case. If missing, ignore_case is set to TRUE
[in]globalis a flag to instruct the function whether to match and replace the first occurence (FALSE) or all the matches (TRUE).
[out]pRetValis the modified string after replacement
[in,out]nSizeis the size of the output buffer (pRetVal)

◆ NDK_REGRESSION()

int __stdcall NDK_REGRESSION ( double * X,
size_t nX,
double * Y,
size_t nY,
WORD nRegressType,
WORD POrder,
double intercept,
double target,
WORD nRetType,
double alpha,
double * retVal )

calculates the value of the regression function for an intermediate x-value.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
NDK_TREND(), NDK_DETREND()
Parameters
[in]Xis the x-component of the input data table (a one dimensional array).
[in]nXis the number of elements in X.
[in]Yis the y-component (i.e. function) of the input data table (a one dimensional array).
[in]nYis the number of elements in Y
[in]nRegressTypeis the model description flag for the trend function (1 = Linear (default), 2 = Polynomial, 3 = Exponential, 4 = Logarithmic, 5 = Power).
[in]POrderis the polynomial order. This is only relevant for a polynomial type of trend and is ignored for all others. If missing, POrder = 1.
[in]interceptis the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally.
[in]targetis the desired x-value to calculate regression value for (a single value).
[in]nRetTypeis a switch to select the return output (1 = Forecast value (default), 2 = Upper limit, 3 = Lower Limit, 4 = R-Squared).
[in]alphais the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed
[out]retValis the calculated value

◆ NDK_RESAMPLE()

int __stdcall NDK_RESAMPLE ( double * pData,
size_t nSize,
BOOL isStock,
double relSampling,
IMPUTATION_METHOD method,
double * pOutData,
size_t * newSize )

Returns the resampled time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SESMTH(), NDK_EWMA(), NDK_DESMTH(), NDK_TESMTH, NDK_LESMTH()

◆ NDK_REVERSE()

int __stdcall NDK_REVERSE ( double * X,
size_t N )

Returns the time-reversed order time series (i.e. the first observation is swapped with the last observation, etc.): both missing and non-missing values.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_LAG(), NDK_DIFF
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.

◆ NDK_RMD()

int __stdcall NDK_RMD ( double * X,
size_t N,
WORD reserved,
double * retVal )

Returns the sample relative mean difference.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series may include missing values (NaN), but they will not be included in the calculations.
2. The relative mean difference is defined in terms of the NDK_MD as follows:
  • $\textup{RMD}= \frac{\textup{MD}}{\bar{x}}$
3: Where:
  • $\bar{x}$ is the sample mean (average) of the time series.
  • $\textup{MD}$ is the mean difference of the time series.
4: The RMD is also equal to twice the NDK_GINI.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]Xis the input data sample (a one/two dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated value of this function.

◆ NDK_RMNA()

int __stdcall NDK_RMNA ( double * X,
size_t * N )

Returns an array of cells of a time series after removing all missing values.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_LAG(), NDK_DIFF
Parameters
[in,out]Xis the univariate sample data (a one dimensional array).
[in,out]Nis the number of observations in X.

◆ NDK_RMS()

int __stdcall NDK_RMS ( double * X,
size_t N,
WORD reserved,
double * retVal )

Returns the sample root mean square (RMS).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The input time series data may include missing values (NaN), but they will not be included in the calculations.
2. The root mean square (RMS) is defined as follows for a set of $n$ values ${x_1,x_2,...,x_n}$:
  • $\textrm{RMS}=\sqrt{\frac{x_1^2+x_2^2+\cdots +x_N^2}{N}} =\sqrt{\frac{\sum_{i=1}^N {x_i^2}}{N}}$
3. Where:
  • $x_i$ is the value of the i-th non-missing observation.
  • $N$ is the number of non-missing observations in the input sample data.
4. The root mean square (RMS) is a statistical measure of the magnitude of a varying quantity.
5. The root mean square (RMS) has an interesting relationship to the mean ( $\bar{x}$) and the population standard deviation ( $\sigma$), such that:
  • $\textrm{RMS}^2=\bar{x}^2+\sigma^2$
See also
NDK_MD(), NDK_RMD()
Parameters
[in]Xis the input data sample (a one/two dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated value of this function.

◆ NDK_RMSE()

int __stdcall NDK_RMSE ( double * X,
double * Y,
size_t N,
WORD retType,
double * retVal )

Calculates the root mean squared error (aka root mean squared deviation (RMSD)) function.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The RMSE is also known as root mean squared deviation (RMSD).
2. Please see NDK_RMSD for definition and notes.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecast time series data (a one dimensional array).
N[In] is the number of observations in X.
retType[In] is a switch to select the return output (1=RMSE (default), 2=NRMSE, 3=CV(RMSE)).
[out]retValis the calculated value of this function.

◆ NDK_RMSEASONAL()

int __stdcall NDK_RMSEASONAL ( double * X,
size_t N,
size_t period )

Returns an array of the deseasonalized time series, assuming a linear model.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_DETREND(), NDK_DIFF()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]periodis the number of observations(i.e. points) in one season.

◆ NDK_SAD()

int __stdcall NDK_SAD ( double * X,
double * Y,
size_t N,
double * retVal )

Calculates the sum of absolute errors (SAE) between the forecast and the eventual outcomes.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series is homogeneous or equally spaced.
2. The two time series must be identical in size.
3. A missing value (say $x_k$ or $\hat x_k$) in either time series will exclude the data point $(x_k,\hat x_k)$ from the SSE.
4. The sum of absolute errors (SAE) or deviations (SAD), is defined as follows:
  • $\mathrm{SAE}=\mathrm{SAD}=\sum_{i=1}^N \left | x_i-\hat x_i  \right |$, where:
    • $\{x_i\}$ is the actual observations time series.
    • $\{\hat x_i\}$ is the estimated or forecasted time series.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecast time series data (a one dimensional array).
[in]Nis the number of observations in X.
[out]retValis the calculated value of this function.

◆ NDK_SARIMA_FITTED()

int __stdcall NDK_SARIMA_FITTED ( double * pData,
size_t nSize,
double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
FIT_RETVAL_FUNC retType )

Returns the in-sample model fitted values of the conditional mean, volatility or 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 long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.
6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.
7. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FORE(), NDK_SARIMA_VALIDATE()
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[in]retTypeis a switch to select a output type ( see FIT_RETVAL_FUNC).

◆ NDK_SARIMA_FORE()

int __stdcall NDK_SARIMA_FORE ( double * pData,
size_t nSize,
double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
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).

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 mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.
6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.
7. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[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 (see FORECAST_RETVAL_FUNC).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]retValis the calculated forecast value.

◆ NDK_SARIMA_GOF()

int __stdcall NDK_SARIMA_GOF ( double * pData,
size_t nSize,
double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
GOODNESS_OF_FIT_FUNC retType,
double * retVal )

Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the SARIMA 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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
4. The maximum likelihood estimation (MLE) is a statistical method for fitting a model to the data and provides estimates for the model's parameters.
5. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.
6. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.
7. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.
8. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[in]retTypeis a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC).
[out]retValis the calculated goodness of fit value.

◆ NDK_SARIMA_PARAM()

int __stdcall NDK_SARIMA_PARAM ( double * pData,
size_t nSize,
double * mean,
double * sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
MODEL_RETVAL_FUNC retType,
size_t maxIter )

Returns the quick guess, optimal (calibrated) or std. errors of the values of 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 long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.
6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.
7. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in,out]meanis the mean of the ARMA process.
[in,out]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in,out]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in,out]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in,out]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in,out]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[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_SARIMA_SIM()

int __stdcall NDK_SARIMA_SIM ( double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
double * pData,
size_t nSize,
size_t nSeed,
double * retVal,
size_t nStep )

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

Note
1. The time series is homogeneous or equally spaced.
2. SARIMA_SIM returns an array of one simulation path starting from the end of the input data.
3. The time series may include missing values (e.g. NaN) at either end.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
5. The input data argument (i.e. latest observations) is optional. If omitted, an array of zeroes is assumed.
6. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.
7. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.
8. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.
9. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. Plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()
Parameters
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]nSeedis an unsigned integer for setting up the random number generators.
[out]retValis the simulated value.
[in]nStepis the simulation time/horizon (expressed in terms of steps beyond end of the time series).

◆ NDK_SARIMA_VALIDATE()

int __stdcall NDK_SARIMA_VALIDATE ( double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ )

Examines the model's parameters for stability constraints (e.g. stationarity, invertibility, causality, 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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
4. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.
5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.
6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.
7. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED()
Parameters
[in]meanis the model mean (i.e. mu).
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.

◆ NDK_SARIMAX_FITTED()

int __stdcall NDK_SARIMAX_FITTED ( double * pData,
double ** pFactors,
size_t nSize,
size_t nFactors,
double * fBetas,
double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
FIT_RETVAL_FUNC retType )

Returns the in-sample model fitted values of the conditional mean, volatility or 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 intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
5. The long-run mean argument (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed.
6. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.
7. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.
8. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMAX_GOF(), NDK_SARIMAX_RESID(), NDK_SARIMAX_PARAM(), NDK_SARIMAX_FORE(), NDK_SARIMAX_VALIDATE()
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]pFactorsis the exogneous factors time series data (each column is a separate factor, and each row is an observation).
[in]nSizeis the number of observations.
[in]nFactorsis the number of exognous factors.
[in]fBetasis the weights or loading of the exogneous factors.
[in]meanis the ARIMA/SARIMA model's long-run mean/trend (i.e. mu). If missing (i.e. NaN), then it is assumed zero.
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[in]retTypeis a switch to select a output type ( see FIT_RETVAL_FUNC).

◆ NDK_SARIMAX_FORE()

int __stdcall NDK_SARIMAX_FORE ( double * pData,
double ** pFactors,
size_t nSize,
size_t nFactors,
double * fBetas,
double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
size_t nStep,
FORECAST_RETVAL_FUNC 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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
4. The exogneous factors input are expected to have at least n-more observations than the reponse variable.
5. The intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.
6. The long-run mean argument (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed.
7. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.
8. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.
9. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]pFactorsis the exogneous factors time series data (each column is a separate factor, and each row is an observation).
[in]nSizeis the number of observations.
[in]nFactorsis the number of exognous factors.
[in,out]fBetasis the weights or loading of the exogneous factors.
[in,out]meanis the mean of the ARMA process.
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[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 (see FORECAST_RETVAL_FUNC).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[out]retValis the calculated forecast value.

◆ NDK_SARIMAX_GOF()

int __stdcall NDK_SARIMAX_GOF ( double * pData,
double ** pFactors,
size_t nSize,
size_t nFactors,
double * fBetas,
double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
GOODNESS_OF_FIT_FUNC retType,
double * retVal )

Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit functions of the SARIMA-X 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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
4. The maximum likelihood estimation (MLE) is a statistical method for fitting a model to the data and provides estimates for the model's parameters.
5. The intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.
6. The long-run mean argumen (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed.
7. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.
8. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.
9. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMAX_FITTED(), NDK_SARIMAX_PARAM(), NDK_SARIMAX_FORE(), NDK_SARIMAX_FORE(), NDK_SARIMAX_VALIDATE()
Parameters
[in]pDatais the response univariate time series data (a one dimensional array).
[in]pFactorsis the exogneous factors time series data (each column is a separate factor, and each row is an observation).
[in]nSizeis the number of observations.
[in]nFactorsis the number of exognous factors.
[in]fBetasis the weights or loading of the exogneous factors.
[in]meanis the ARIMA/SARIMA model's long-run mean/trend (i.e. mu). If missing (i.e. NaN), then it is assumed zero.
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[in]retTypeis a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC).
[out]retValis the calculated goodness of fit value.

◆ NDK_SARIMAX_PARAM()

int __stdcall NDK_SARIMAX_PARAM ( double * pData,
double ** pFactors,
size_t nSize,
size_t nFactors,
double * fBetas,
double * mean,
double * sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
MODEL_RETVAL_FUNC retType,
size_t maxIter )

Returns the quick guess, optimal (calibrated) or std. errors of the values of 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 intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
5. The long-run mean argument (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed.
6. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.
7. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.
8. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMAX_GOF(), NDK_SARIMAX_RESID(), NDK_SARIMAX_FORE(), NDK_SARIMAX_FITTED(), NDK_SARIMAX_VALIDATE()
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]pFactorsis the exogneous factors time series data (each column is a separate factor, and each row is an observation).
[in]nSizeis the number of observations.
[in]nFactorsis the number of exognous factors.
[in,out]fBetasis the weights or loading of the exogneous factors.
[in,out]meanis the mean of the differenced time series process.
[in,out]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in,out]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in,out]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in,out]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in,out]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[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_SARIMAX_SIM()

int __stdcall NDK_SARIMAX_SIM ( double * fBetas,
size_t nFactors,
double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ,
double * pData,
double ** pFactors,
size_t nSize,
UINT nSeed,
size_t nStep,
double * retVal )

Calculates the out-of-sample simulated values.

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 residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
4. The intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.
5. The exogenous factors input are expected to have at least n-more observations than the reponse variable.
6. The long-run mean argument (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed.
7. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.
8. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.
9. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()
Parameters
[in,out]fBetasis the weights or loading of the exogneous factors.
[in]nFactorsis the number of exognous factors.
[in,out]meanis the mean of the ARMA process.
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.
[in]pDatais the univariate time series data (a one dimensional array).
[in]pFactorsis the past exogneous factors time series data (each column is a separate factor, and each row is an observation).
[in]nSizeis the number of observations in X.
[in]nSeedis an unsigned integer for setting up the random number generators.
[in]nStepis the simulation time/horizon (expressed in terms of steps beyond end of the time series).
[out]retValis the simulated value.

◆ NDK_SARIMAX_VALIDATE()

int __stdcall NDK_SARIMAX_VALIDATE ( double mean,
double sigma,
WORD nIntegral,
double * phis,
size_t p,
double * thetas,
size_t q,
WORD nSIntegral,
WORD nSPeriod,
double * sPhis,
size_t sP,
double * sThetas,
size_t sQ )

Examines the model's parameters for stability constraints (e.g. causality, invertability, stationary, 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 intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.
4. The residuals/innovations standard deviation (i.e. $\sigma$) should be greater than zero.
5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.
6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.
7. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).
Returns
status code of the operation
Return values
NDK_SUCCESSoperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED()
Parameters
[in]meanis the model mean (i.e. mu) for the differenced series.
[in]sigmais the standard deviation of the model's residuals/innovations.
[in]nIntegralis the non-seasonal difference order.
[in]phisare the coefficients's values of the non-seasonal AR component.
[in]pis the order of the non-seasonal AR component.
[in]thetasare the coefficients's values of the non-seasonal MA component.
[in]qis the order of the non-seasonal MA component.
[in]nSIntegralis the seasonal difference.
[in]nSPeriodis the number of observations per one period (e.g. 12=Annual, 4=Quarter).
[in]sPhisare the coefficients's values of the seasonal AR component.
[in]sPis the order of the seasonal AR component.
[in]sThetasare the coefficients's values of the seasonal MA component.
[in]sQis the order of the seasonal MA component.

◆ NDK_SCALE()

int __stdcall NDK_SCALE ( double * X,
size_t N,
double K )

Returns an array of cells for the scaled time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ADD(), NDK_SUB()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the scalar/multiplier value.

◆ NDK_SESMTH()

int __stdcall NDK_SESMTH ( double * pData,
size_t nSize,
BOOL bAscending,
double * alpha,
int nHorizon,
BOOL bOptimize,
double * internals,
size_t nInternalsSize,
double * retVal )

Returns the (Brown's) simple exponential (EMA) smoothing estimate of the value of X at time t+m (based on the raw data up to time t).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA(), NDK_DESMTH(), NDK_TESMTH, NDK_LESMTH()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of elements in pData.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in,out]alphais the smoothing factor (alpha should be between zero and one (exclusive)). If missing or omitted, a value of 0.333 is used.
[in]nHorizonis the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.
[in]bOptimizeis a flag (True/False) for searching and using the optimal value of the smoothing factor. If missing or omitted, optimize is assumed false.
internals[out,opt] is an array of the intermediate forecast calculation.
nInternalsSize[inout,opt] size of the output buffer, and number or values to return.
[out]retValis the calculated value of this function.

◆ NDK_SHUFFLE()

int __stdcall NDK_SHUFFLE ( double * pData,
size_t nSize,
ULONG ulSeed )

Returns shuffled version of the input array.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_LAG(), NDK_DIFF
Parameters
[in,out]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of observations in X.
[in]ulSeedis random number generator seed.

◆ NDK_Shutdown()

int __stdcall NDK_Shutdown ( BOOL cleanup,
unsigned int uClientToken )

Shutdown and release resources used by the SFSDK Library.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful
Otherssee SFMacros.h
See also
SFMacros.h, NDK_Init()
int nRet = NDK_FAILED;
...
nRet= NDK_Shutdown(); // This is the last SDK API called.
// Check for error
if( nRet < NDK_SUCCESS){
...
}
#define NDK_SUCCESS
SUCCESS return code.
Definition SFLOG.h:27
int __stdcall NDK_Shutdown(BOOL cleanup, unsigned int uClientToken)
Shutdown and release resources used by the SFSDK Library.
Parameters
[in]cleanupis a flag. If true, the NDK_Shutdown() deletes all data files generated in the data directory
[in]uClientTokenis the token returned during the the SDK initialization

◆ NDK_SKEW()

int __stdcall NDK_SKEW ( double * X,
size_t N,
WORD reserved,
double * retVal )

Calculates the sample skewness.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ACF_SKEWTEST()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated sample skew value.

◆ NDK_SKEWTEST()

int __stdcall NDK_SKEWTEST ( double * X,
size_t N,
double alpha,
WORD method,
WORD retType,
double * retVal )

Calculates the p-value of the statistical test for the population skew (i.e. 3rd moment).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_NORMALTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_XKURTTEST()
Parameters
[in]Xis the sample data (a one dimensional array).
[in]Nis the number of observations in X.
[in]alphais the statistical significance level. If missing, the default of 5% is assumed.
[in]methodis the statistical test to perform (1=parametric).
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[out]retValis the calculated test statistics.

◆ NDK_SMA_WGHTS()

int __stdcall NDK_SMA_WGHTS ( size_t M,
double * pterms,
size_t * pSize )

Computes Spencer weighted moving average series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful (see SFMacros.h)
See also
NDK_CMA_WGHTS(), NDK_BMA_WGHTS(), NDK_HMA_WGHTS()
Parameters
[in]Mis the number of terms in the filter
[out]ptermsis the filter's terms or weights array.
[in,out]pSizeis the output buffer size.

◆ NDK_SORT_ASC()

int __stdcall NDK_SORT_ASC ( double * X,
size_t N )

Returns the sorted sample data.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in,out]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.

◆ NDK_SSE()

int __stdcall NDK_SSE ( double * X,
double * Y,
size_t N,
double * retVal )

Calculates the sum of the squared errors of the prediction function.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series is homogeneous or equally spaced.
2. The two time series must be identical in size.
3. A missing value (e.g. $x_k$ or $\hat x_k$) in either time series will exclude the data point $(x_k,\hat x_k)$ from the SSE.
4. The sum of the squared errors, $\mathrm{SSE}$, is defined as follows: $\mathrm{SSE}=\sum_{i=1}^N \left(x_i-\hat x_i \right )^2$, where:
  • $\{x_i\}$ is the actual observations time series.
  • $\{\hat x_i\}$ is the estimated or forecasted time series.
See also
NDK_ACF_ERROR(), NDK_XCF()
Parameters
[in]Xis the original (eventual outcomes) time series sample data (a one dimensional array).
[in]Yis the forecasted time series data (a one dimensional array).
[in]Nis the number of observations in X.
[out]retValis the calculated sum of squared errors.

◆ NDK_STDEVTEST()

int __stdcall NDK_STDEVTEST ( double * X,
size_t N,
double target,
double alpha,
WORD method,
WORD retType,
double * retVal )

Calculates the p-value of the statistical test for the population standard deviation.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_MEANTEST(), NDK_SKEWTEST(), NDK_XKURTTEST()
Parameters
[in]Xis the sample data (a one dimensional array).
[in]Nis the number of observations in X.
[in]targetis the assumed standard deviation value. If missing, a default of one is assumed
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]methodis the statistical test to perform (1=parametric).
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[out]retValis the calculated test statistics.

◆ NDK_SUB()

int __stdcall NDK_SUB ( double * X,
size_t N1,
const double * Y,
size_t N2 )

Returns an array of the difference between two time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ADD(), NDK_SCALE()
Parameters
[in,out]Xis the univariate time series data (a one dimensional array).
[in]N1is the number of observations in X.
[in]Yis the second univariate time series data (a one dimensional array).
[in]N2is the number of observations in Y.

◆ NDK_TDIST_XKURT()

int __stdcall NDK_TDIST_XKURT ( double df,
double * retVal )

Calculates the excess kurtosis of the student's t-distribution.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_TDIST_XKURT(), NDK_XKURTTEST()
Parameters
[in]dfis the degrees of freedom of the student's t-distribution (v > 4).
[out]retValis the computed value.

◆ NDK_TESMTH()

int __stdcall NDK_TESMTH ( double * pData,
size_t nSize,
BOOL bAscending,
double * alpha,
double * beta,
double * gamma,
int L,
int nHorizon,
BOOL bOptimize,
double * internals,
size_t nInternalsSize,
WORD wInternalSeries,
double * retVal )

Returns the (Winters's) triple exponential smoothing estimate of the value of X at time T+m.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_LESMTH, NDK_DESMTH()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of elements in pData.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]alphais the data smoothing factor (alpha should be between zero and one (exclusive)).
[in]betais the trend smoothing factor (beta should be between zero and one (exclusive)).
[in]gammais the seasonal change smoothing factor (Gamma should be between zero and one (exclusive)).
[in]Lis the season length.
[in]nHorizonis the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.
[in]bOptimizeis a flag (True/False) for searching and using optimal value of the smoothing factor. If missing or omitted, optimize is assumed false.
internals[out,opt] is an array of the intermediate forecast calculation.
nInternalsSize[in,opt] size of the output buffer, and number or values to return.
wInternalSeries[in, opt] a switch to select the series to return in internals ( 0 = Smoothing forecast, 1=level, 2=trend)
[out]retValis the calculated value of this function.

◆ NDK_TOKENIZE()

int __stdcall NDK_TOKENIZE ( LPCTSTR szTxt,
LPCTSTR szDelim,
short nOrder,
LPTSTR pRetVal,
size_t * pSize )

Returns the n-th token/substring in a string after splitting it using a given delimiter.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
Errorcode
See also
NDK_REGEX_REPLACE(), NDK_REGEX_MATCH()
Parameters
[in]szTxtis the input string to match for.
[in]szDelimis the character to use for splitting the string. If missing, comma (,) is used.
[in]nOrderis the order of the token to return, where first = 1, second = 2,..., and last = -1.
[out]pRetValis the n-th token/substring in a string
[in,out]pSizeis the number of characters in pRetVal buffer, and returns number of characters copied to pRetVal.

◆ NDK_TREND()

int __stdcall NDK_TREND ( double * pData,
size_t nSize,
BOOL bAscending,
WORD nTrendType,
WORD argPolyOrder,
BOOL AllowIntercep,
double InterceptVal,
int nHorizon,
WORD retType,
double argAlpha,
double * retVal )

Returns values along a trend curve (e.g. linear, quadratic, exponential, etc.) at time T+m.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_LESMTH, NDK_DESMTH(), NDK_TESMTH
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of elements in pData.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]nTrendTypeis the model description flag for the trend function:
  1. Linear
  2. Polynomial
  3. Exponential
  4. Logarithmic
  5. Power
[in]argPolyOrderis the polynomial order. This is only relevant for a polynomial trend type and is ignored for all others. If missing, POrder = 1.
[in]AllowIntercepis a switch to include or exclude an intercept in the regression.
[in]InterceptValis the constant or the intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.
[in]nHorizonis the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.
[in]retTypeis a switch to select the return output:
  1. Forecast value
  2. Upper limit of the confidence interval
  3. Lower limit of the confidence interval
  4. R-Squared
[in]argAlphais the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[out]retValis the calculated value of this function.

◆ NDK_TSTUDENT_FORECI()

int __stdcall NDK_TSTUDENT_FORECI ( double mean,
double sigma,
double df,
double alpha,
BOOL upper,
double * retVal )

Returns the upper & lower limit of the confidence interval for the student\'s t-distribution.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_GAUSS_FORECI(), NDK_GED_FORECI()
Parameters
[in]meanis the mean of the student's t-distribution.
[in]sigmais the standard deviation of the student's t-distribution.
[in]dfis the degrees of freedom (nu) of the student's t-distribution.
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]upperis a switch to select the limit (upper/lower).
[out]retValis the computed value.

◆ NDK_VARIANCE()

int __stdcall NDK_VARIANCE ( double * X,
size_t N,
WORD reserved,
double * retVal )

Calculates the sample variance.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
See also
NDK_ACF_STDEVTEST()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated variance value.

◆ NDK_WMA()

int __stdcall NDK_WMA ( double * pData,
size_t nSize,
BOOL bAscending,
double * weights,
size_t nwSize,
int nHorizon,
double * retVal )

Returns the weighted moving (rolling/running) average using the previous m data points.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_SESMTH(), NDK_EWMA(), NDK_DESMTH(), NDK_TESMTH, NDK_LESMTH()
Parameters
[in]pDatais the univariate time series data (a one dimensional array).
[in]nSizeis the number of elements in pData.
[in]bAscendingis the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
[in]weightsis the size of the equal-weighted window or an array of multiplying factors (i.e. weights) of the moving/rolling window.
[in]nwSizeis the number of elements in the weights array.
[in]nHorizonis the forecast time/horizon beyond the end of X. If missing, a default value of 0 (Latest or end of X) is assumed.
[out]retValis the calculated value of the weighted moving average.

◆ NDK_WNTEST()

int __stdcall NDK_WNTEST ( double * X,
size_t N,
size_t K,
double alpha,
WORD method,
WORD retType,
double * retVal )

Computes the p-value of the statistical portmanteau test (i.e. whether any of a group of autocorrelations of a time series are different from zero).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_NORMALTEST(), NDK_ARCHTEST()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]methodis the statistical test to perform (1=Ljung-Box).
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[out]retValis the calculated test statistics.

◆ NDK_X12_DATA_FILE()

int __stdcall NDK_X12_DATA_FILE ( LPCTSTR szScenarioName,
double * X,
size_t nLen,
BOOL monthly,
LONG startDate,
WORD reserved,
size_t * ulDataHash )

Write the given data into an X12a formatted data file.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]nLenis the number of observations in X
[in]monthlyis a boolean flag for whether the data is monthly/quartelry sampled.
[in]startDateis the serial date number of the 1st observation in the series
[in]reservedis a reserved argument for future releases. must be set to 1
[in,out]ulDataHash(optional) is CRC hash of the data file (tab delimated).

◆ NDK_X12_ENV_CLEANUP()

int __stdcall NDK_X12_ENV_CLEANUP ( void )

Finalize the X12A environment and release any resources allocated.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X12_ENV_INIT()

int __stdcall NDK_X12_ENV_INIT ( BOOL override)

Initialize the filesystem environment on the local machine for the current user.

Note
1. This function creates a subfolder under the current user local profile for X12ARIMA models, and copy all the scripts needed to run the x12a program.
Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]overrideis a boolean flag to wipe our existing files and copy new ones.

◆ NDK_X12_FORE_SERIES()

int __stdcall NDK_X12_FORE_SERIES ( LPCTSTR szScenarioName,
size_t nStep,
WORD retType,
double * pData )

Read the output forecaste series generated by x12a program.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES()
Parameters
[in]szScenarioNameis the given X12-ARIMA scenario/model identifier
[in]nStepis the forecast horizon
[in]retTypeis the switch to designate desired output
  1. Mean
  2. Lower limit value of the conficent interval
  3. Upper limit value of the confidence interval
[out]pDatais the forecast output value

◆ NDK_X12_OUT_FILE()

int __stdcall NDK_X12_OUT_FILE ( LPCTSTR szScenarioName,
WORD retType,
LPTSTR szOutFile,
size_t * nLen,
BOOL OpenFileFlag )

Return the full path of the output file generated by x12a program.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]szScenarioNameis the scenaio.model name
[in]retTypeis a switch to designate the desired specific output file. 0. The X12 specification file (*.spc)
  1. The X12 log file
  2. The output file
  3. The error file
[out]szOutFileis a buffer to hold the return full path
[in,out]nLenis the length of the szOutFile. Upon return, this argument stores the actual number of bytes used.
[in]OpenFileFlagis a switch to instruct the functiona whether it should open the file using system default editor (e.g. notepad)

◆ NDK_X12_OUT_SERIES()

int __stdcall NDK_X12_OUT_SERIES ( LPCTSTR szScenarioName,
WORD nComponent,
double * pData,
size_t * nLen )

Read the output time series (e.g. seasonal adjusted data) generated by x12a program.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_FORE_SERIES()
Parameters
[in]szScenarioNameis the given scenario/model
[in]nComponentis the desired output of the X12a output
  1. Final seasonal factors (d11)
  2. final trend-cycle (d12)
  3. final irregular component (d13)
  4. final seasonal factors (d10)
  5. combined holiday and trading day factors (d18)
  6. combined seasonal and trading day factors (d16)
[out]pDatais the output buffer to hold the data series
[in,out]nLenis the original size of the output buffer. Upon return, nLen will have the actual number of data copied.

◆ NDK_X12_READ_DATA_FILE()

int __stdcall NDK_X12_READ_DATA_FILE ( LPCTSTR szScenarioName,
double * pData,
size_t nLen,
WORD fileType,
size_t * ulDataHash )

Read the scenario data file into the given data into an X12a formatted data file.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[out]pDatais the univariate time series data (a one dimensional array).
[in]nLenis the number of observations in pData
[in]fileTypeis a reserved argument for future releases. must be set to 1
[out]ulDataHash(optional) is CRC hash of the data file (tab delimated).

◆ NDK_X12_RUN_BATCH()

int __stdcall NDK_X12_RUN_BATCH ( LPCTSTR szScenarioName,
LPCTSTR szBatchFile,
LPWORD status )

Run a batch file in x12a environment.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X12_RUN_SCENARIO()

int __stdcall NDK_X12_RUN_SCENARIO ( LPCTSTR szScenarioName,
LPWORD status )

Run a x12a program for the given model or scenrio.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X12_RUN_STAT()

int __stdcall NDK_X12_RUN_STAT ( LPCTSTR szScenarioName,
LPWORD status,
LPTSTR szMsg,
size_t * nLen )

Read the status file generated by x12a program.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X12_SCEN_CLEAUP()

int __stdcall NDK_X12_SCEN_CLEAUP ( LPCTSTR szScenarioName)

Finalize the given scenario/model and free allocated resources.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]szScenarioNameis the scenario name or the model unique identifier

◆ NDK_X12_SCEN_INIT()

int __stdcall NDK_X12_SCEN_INIT ( LPCTSTR szScenarioName,
LPVOID X12Options,
size_t * ulModelHash )

Initialize the required files for the given scenario/model.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]szScenarioNameis the scenario name, must be unique
[in]X12Options(optional) is an instance of X12ARIMA_OPTIONS structure with all X12 model options.
[in,out]ulModelHash(optional) CRC hash for the options.ini file

◆ NDK_X12_SCEN_READ()

int __stdcall NDK_X12_SCEN_READ ( LPCTSTR szScenarioName,
LPVOID X12Options,
size_t * ulModelHash )

Read the model configuration file.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (e.g., scenario not found)
See also
NDK_X12_SCEN_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]szScenarioNameis the scenario name, must be unique
[out]X12Optionsis an instance of X12ARIMA_OPTIONS structure with all X12 model options.
[out]ulModelHash(optional) is CRC hash of the model option file (ini file).

◆ NDK_X12_SPC_FILE()

int __stdcall NDK_X12_SPC_FILE ( LPCTSTR szScenarioName,
LPVOID X12Options,
size_t * ulModelHash )

Create or updates the x12a specification file using the options selected.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]szScenarioNameis the scenario name, must be unique
[in]X12Options(optional) is an instance of X12ARIMA_OPTIONS structure with all X12 model options.
[in,out]ulModelHash(optional) CRC hash for the options.ini file

◆ NDK_X13AS_ADD_OUTPUT_SERIES()

int __stdcall NDK_X13AS_ADD_OUTPUT_SERIES ( LPCTSTR szScenarioName,
LPCTSTR szComponent )

Add an output component to the spc file.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_DATA_STARTOFFSET()

int __stdcall NDK_X13AS_DATA_STARTOFFSET ( double * pData,
size_t nLen,
size_t nForecastPeriods,
size_t * startIndex )

Get the start index of the data set to support maximum limit of X13AS.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X13_WRITE_DATA_FILE(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_DATE_TO_DATEVALUE()

int __stdcall NDK_X13AS_DATE_TO_DATEVALUE ( LONG serialDate,
WORD freq,
LPTSTR szDateTxt,
size_t * nLen )

Covert a serial datenumber to X13AS datevalue (Year.month/quarter).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_DATEVALE_TO_DATE()

int __stdcall NDK_X13AS_DATEVALE_TO_DATE ( LPCTSTR szDateTxt,
WORD freq,
LONG * serialDate )

Covert X13AS datevalue (Year.month/quarter) into date serial number.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_ENV_CLEANUP()

int __stdcall NDK_X13AS_ENV_CLEANUP ( void )

Finalize the X13AS environment and release any resources allocated.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X13_SCEN_CLEAUP()

◆ NDK_X13AS_FORE_SERIES()

int __stdcall NDK_X13AS_FORE_SERIES ( LPCTSTR szScenarioName,
WORD freq,
LONG dateSerial,
WORD retType,
double * pData )

Parse the forecast output file.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_GET_METADATA()

int __stdcall NDK_X13AS_GET_METADATA ( LPCTSTR szScenarioName,
LPCTSTR szkey,
LPTSTR szOutBuffer,
size_t * pLen )

Get the value of a model's metadata (by key: metadata.keys.key).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_GET_PROP()

int __stdcall NDK_X13AS_GET_PROP ( LPCTSTR szScenarioName,
LPCTSTR szPropert,
LPTSTR szOutBuffer,
size_t * pLen )

Return the model's option (given by a path: section.key).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_OUT_FILE()

int __stdcall NDK_X13AS_OUT_FILE ( LPCTSTR szScenarioName,
WORD retType,
LPTSTR szOutFile,
size_t * nLen,
BOOL OpenFileFlag )

Return the output filename, or open the file in a notepad.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_OUT_SERIES()

int __stdcall NDK_X13AS_OUT_SERIES ( LPCTSTR szScenarioName,
LPCTSTR szComponent,
WORD freq,
double * pData,
size_t * nLen,
LONG * startDate )

Parse the output file of a given component.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_READ_DATA_FILE()

int __stdcall NDK_X13AS_READ_DATA_FILE ( LPCTSTR szScenarioName,
LPCTSTR szDataFileName,
WORD freq,
double * pData,
size_t * pLen,
LONG * startDate,
WORD fileType,
size_t * ulDataHash )

Read the scenario data file into the given data into an X12a formatted data file.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]szDataFileNameis the basefilename of the datafile in the scenario folder
[in]freqis the sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[out]pDatais the univariate time series data (a one dimensional array).
[in,out]pLenis the number of observations in X, and original the size of the elements in pData
[out]startDateis the serial date number of the 1st observation in the series
[in]fileTypeis a reserved argument for future releases. must be set to 1
[out]ulDataHash(optional) is CRC hash of the data file (tab delimated).

◆ NDK_X13AS_READ_FACTORS_FILE()

int __stdcall NDK_X13AS_READ_FACTORS_FILE ( LPCTSTR szScenarioName,
LPCTSTR szOutputFile,
double ** pXData,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
LPLONG startDate,
WORD freq,
WORD reserved,
size_t * ulDataHash )

Read the 2D data file into the given data into an X13a formatted data file.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]szOutputFileis the base filename (and extension) of the output data file in the scenario folder
[in]pXDatais the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSizeis the number of observations (rows) in X
[in]nXVarsis the number of independent (explanatory) variables (columns) in X.
[in]maskis the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLenis the number of elements in the "mask."
[out]startDateis the serial date number of the 1st observation in the series
[in]freqis the data sampling frequency (per year)
[in]reservedis a reserved argument for future releases. must be set to 1
[in,out]ulDataHash(optional) is CRC hash of the data file (tab delimated).

◆ NDK_X13AS_READ_SPC_FILE()

int __stdcall NDK_X13AS_READ_SPC_FILE ( LPCTSTR szSPCFilename,
LPTSTR szOptions,
size_t * nLen,
size_t * ulModelHash )

Read an SPC file and convert it to a JSON formatted string.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_RUN_SPC_FILE()

int __stdcall NDK_X13AS_RUN_SPC_FILE ( LPCTSTR szScenarioName,
BOOL bValidateOnly )

Invoke the x13as_ascii.exe file to process the spc file in a given scenario.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_SCEN_CLEAUP()

int __stdcall NDK_X13AS_SCEN_CLEAUP ( LPCTSTR szScenarioName)

Finalize the given scenario/model and free allocated resources.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()
Parameters
[in]szScenarioNameis the scenario name or the model unique identifier

◆ NDK_X13AS_SCEN_ERROR_STATUS()

int __stdcall NDK_X13AS_SCEN_ERROR_STATUS ( LPCTSTR szScenarioName,
LPTSTR szStatus,
size_t * nLen )

Parse the error file in a given scenario for errors.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_SCEN_INIT()

int __stdcall NDK_X13AS_SCEN_INIT ( LPCTSTR szScenarioName,
LPCTSTR X13Options,
size_t * ulModelHash )

Initialize the required files for the given scenario/model.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X13_ENV_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_CLEAUP()
Parameters
[in]szScenarioNameis the scenario name, must be unique
[in]X13Options(optional) is Json data structure #X13ARIMA_OPTIONS structure with all X13 model options.
[in,out]ulModelHash(optional) the CRC hash for the spc file

◆ NDK_X13AS_SCEN_PATH()

int __stdcall NDK_X13AS_SCEN_PATH ( LPCTSTR szScenarioName,
LPTSTR szOutBuffer,
size_t * pLen )

Returns the filesystem path for the scenario's different files.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X13_SCEN_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_CLEAUP()

◆ NDK_X13AS_SCEN_REFRESH()

int __stdcall NDK_X13AS_SCEN_REFRESH ( LPCTSTR szScenarioName)

reconstruct the different (input/intermediate/output) files

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X13_ENV_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_CLEAUP()

◆ NDK_X13AS_SCEN_SPEC()

int __stdcall NDK_X13AS_SCEN_SPEC ( LPCTSTR szScenarioName,
LPTSTR szOutBuffer,
size_t * pLen )

Query the properties/options of given scenario and return them in a JSON data string.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X13_SCEN_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_CLEAUP()

◆ NDK_X13AS_SET_METADATA()

int __stdcall NDK_X13AS_SET_METADATA ( LPCTSTR szScenarioName,
LPCTSTR szkey,
LPCTSTR szValue )

Set (or reset) the value of a model's metadata (by key: metadata.keys.key).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_SET_PROP()

int __stdcall NDK_X13AS_SET_PROP ( LPCTSTR szScenarioName,
LPCTSTR szPropert,
LPCTSTR szOutBuffer )

Set (or reset) the value of a model's option (by path: section.key).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_X13AS_WRITE_DATA_FILE()

int __stdcall NDK_X13AS_WRITE_DATA_FILE ( LPCTSTR szScenarioName,
LPCTSTR szOutputFile,
double * X,
size_t nLen,
WORD freq,
LONG startDate,
WORD reserved,
size_t * ulDataHash )

Write the given data into an X13as formatted data file.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X13_ENV_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_INIT(), NDK_X13_SCEN_CLEAUP()
Parameters
[in]Xis the univariate time series data (a one dimensional array).
[in]nLenis the number of observations in X
[in]freqis the sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[in]startDateis the serial date number of the 1st observation in the series
[in]reservedis a reserved argument for future releases. must be set to 1
[in,out]ulDataHash(optional) is CRC hash of the data file (tab delimated).

◆ NDK_X13AS_WRITE_FACTORS_FILE()

int __stdcall NDK_X13AS_WRITE_FACTORS_FILE ( LPCTSTR szScenarioName,
LPCTSTR szOutputFile,
double ** pXData,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
WORD freq,
LONG startDate,
WORD reserved,
size_t * ulDataHash )

Write the given 2-D data into an X13as formatted data file.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X13_ENV_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_INIT(), NDK_X13_SCEN_CLEAUP()
Parameters
[in]szOutputFileis the base filename (and extension) of the output data file in the scenario folder
[in]pXDatais the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSizeis the number of observations (rows) in X
[in]nXVarsis the number of independent (explanatory) variables (columns) in X.
[in]maskis the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLenis the number of elements in the "mask."
[in]freqis the sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[in]startDateis the serial date number of the 1st observation in the series
[in]reservedis a reserved argument for future releases. must be set to 1
[in,out]ulDataHash(optional) is CRC hash of the data file (tab delimated).

◆ NDK_X13AS_WRITE_SPC_FILE()

int __stdcall NDK_X13AS_WRITE_SPC_FILE ( LPCTSTR szSPCFilename,
LPCTSTR szOptions,
size_t * ulModelHash )

Write an SPC file from a JSON formatted string.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDoperation is unsuccessful (see SFMacros.h)
See also
NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()

◆ NDK_XCF()

int __stdcall NDK_XCF ( double * X,
double * Y,
size_t N,
size_t K,
WORD method,
WORD retType,
double * retVal )

Calculates the cross-correlation function between two time series.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation unsuccessful. See SFMacros.h for more details.
Note
1. The time series is homogeneous or equally spaced.
2. The two time series must be identical in size.
3. The Pearson correlation, $r_{xy}$, is defined as follows:
  • $r_{xy}= \frac{\sum_{i=1}^N(x_i-\bar{x})(y_i-\bar{y})}{\sqrt{\sum_{i=1}^N(x_i-\bar{x})^2\times\sum_{i=1}^N(y_i-\bar{y})^2}}$, where:
    • $\bar{x}$ is the sample average of time series X.
    • $\bar{y}$ is the sample average of time series Y.
    • $x_i \in X$ is a value from the first input time series data.
    • $y_i \in Y$ is a value from the second input time series data.
    • $N$ is the number of pairs $\left ( x_i,y_i \right )$ that do not contain a missing observation.
See also
NDK_ACF(), NDK_XCF()
Parameters
[in]Xis the first univariate time series data (a one dimensional array).
[in]Yis the second univariate time series data (a one dimensional array).
[in]Nis the number of observations in X.
[in]Kis the lag order (e.g. 0=no lag, 1=1st lag, etc.) to use with the second time series input (X). If missing, a default lag order of zero (i.e. no-lag) is assumed.
[in]methodis the algorithm to use for calculating the correlation (see CORRELATION_METHOD)
[in]retTypeis a switch to select the return output (1 = correlation value(default), 2 = std error).
[out]retValis the calculated value of this function.

◆ NDK_XCFTEST()

int __stdcall NDK_XCFTEST ( double * X,
double * Y,
size_t N,
int K,
double target,
double alpha,
WORD method,
WORD retType,
double * retVal )

Calculates the test stats, p-value or critical value of the correlation test.

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
NDK_NORMALTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_SKEWTEST()
Parameters
[in]Xis the first univariate time series data (a one dimensional array).
[in]Yis the second univariate time series data (a one dimensional array).
[in]Nis the number of observations in X (or Y).
[in]Kis the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]targetis the assumed correlation value. If missing, a default of zero is assumed.
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]methodis the desired correlation coefficient (1=Pearson (default), 2=Spearman, 3=Kendall). If missing, a Pearson coefficient is assumed.
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[out]retValis the calculated test statistics.

◆ NDK_XKURT()

int __stdcall NDK_XKURT ( double * X,
size_t N,
WORD reserved,
double * retVal )
\brief Calculates the sample excess kurtosis.
\return status code of the operation
\retval #NDK_SUCCESS Operation successful
\retval #NDK_FAILED Operation unsuccessful. See \ref SFMacros.h for more details.

The time series is homogeneous or equally spaced.

Note
1. The data sample may include missing values (e.g. #N/A).
2. The test hypothesis for the population excess kurtosis: $H_{o}: K=0$ $H_{1}: K\neq 0$, where: $H_{o}$ is the null hypothesis. $H_{1}$ is the alternate hypothesis.
3. For the case in which the underlying population distribution is normal, the sample excess kurtosis also has a normal sampling distribution: $\hat K \sim N(0,\frac{24}{T})$, where: $\hat k$ is the sample excess kurtosis (i.e. 4th moment). $T$ is the number of non-missing values in the data sample. $N(.)$ is the normal (i.e. gaussian) probability distribution function.
4. Using a given data sample, the sample excess kurtosis is calculated as: $\hat K (x)= \frac{\sum_{t=1}^T(x_t-\bar x)^4}{(T-1)\hat \sigma^4}-3$, where: $\hat K(x)$ is the sample excess kurtosis. $x_i$ is the i-th non-missing value in the data sample. $T$ is the number of non-missing values in the data sample. $\hat \sigma$ is the sample standard deviation.
5. The underlying population distribution is assumed normal (gaussian)..
6. This is a two-sides (i.e. two-tails) test, so the computed p-value should be compared with half of the significance level $\frac{\alpha}{2}$.
See also
NDK_XKURTTEST(), NDK_GED_XCF(), NDK_TDIST_XKURT()
Parameters
[in]Xis the input data sample (a one dimensional array).
[in]Nis the number of observations in X.
[in]reservedThis parameter is reserved and must be 1.
[out]retValis the calculated sample excess-kurtosis value.

◆ NDK_XKURTTEST()

int __stdcall NDK_XKURTTEST ( double * X,
size_t N,
double alpha,
WORD method,
WORD retType,
double * retVal )

Calculates the p-value of the statistical test for the population excess kurtosis (4th moment).

Returns
status code of the operation
Return values
NDK_SUCCESSOperation successful
NDK_FAILEDOperation is unsuccessful. see SFMacros.h
See also
SFMacros.h, NDK_NORMALTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_SKEWTEST()
Parameters
[in]Xis the sample data (a one dimensional array).
[in]Nis the number of observations in X.
[in]alphais the statistical significance level. If missing, a default of 5% is assumed.
[in]methodis the statistical test to perform (1=parametric).
[in]retTypeis a switch to select the return output: (TEST_RETURN)
  1. P-value
  2. Test statistics (aka score)
  3. Critical value
[out]retValis the calculated test statistics.