SDK 1.69.1
Brief about SDK
|
Data Structures | |
struct | __X12ARIMA_OPTIONS__ |
Typedefs | |
typedef struct __X12ARIMA_OPTIONS__ | X12ARIMA_OPTIONS |
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) |
typedef struct __X12ARIMA_OPTIONS__ X12ARIMA_OPTIONS |
Data structure to capture X-12-ARIMA options.
enum ADFTEST_OPTION |
enum COLNRTY_TEST_TYPE |
multi-colinearity test method
Enumerator | |
---|---|
COLNRTY_CN | Condition Number. |
COLNRTY_VIF | Variation Inflation Factor (VIF) |
COLNRTY_DET | Determinant. |
COLNRTY_EIGEN | Eigenvalues. |
enum CORRELATION_METHOD |
Support correlation methods.
Enumerator | |
---|---|
XCF_PEARSON | Pearson. |
XCF_SPEARMAN | Spearman. |
XCF_KENDALL | Kendall. |
enum FIT_RETVAL_FUNC |
enum FORECAST_RETVAL_FUNC |
enum GLM_LINK_FUNC |
Supported Link function.
Enumerator | |
---|---|
GLM_LVK_IDENTITY | Identity (default) |
GLM_LVK_LOG | Log. |
GLM_LVK_LOGIT | Logit. |
GLM_LVK_PROBIT | Probit. |
GLM_LVK_CLOGLOG | Complementary log-log. |
enum GOODNESS_OF_FIT_FUNC |
enum IMPUTATION_METHOD |
Imputation methods for resampling.
enum INNOVATION_TYPE |
Supported innovation types.
Enumerator | |
---|---|
INNOVATION_GAUSSIAN | Gaussian or normal distribution. |
INNOVATION_TDIST | Standardized student's T-distribution. |
INNOVATION_GED | Standardized generalized error distribution (GED) |
enum MODEL_RETVAL_FUNC |
enum NORMALTEST_METHOD |
Enumerator | |
---|---|
NORMALTEST_JB | Jacque-Berra. |
NORMALTEST_WS | Shapiro-Wilson. |
NORMALTEST_CHISQ | Chi-Square test - Doornik and Hansen, "An Omnibus Test for Normality", 1994. |
Periodogram method options.
enum RESID_RETVAL_FUNC |
Enumerator | |
---|---|
RESIDS_STD | Standardized residuals. |
RESIDS_RAW | Raw residuals. |
enum TEST_RETURN |
Supported statistical test outputs.
Enumerator | |
---|---|
TEST_PVALUE | P-value. |
TEST_SCORE | Test statistics (aka score) |
TEST_CRITICALVALUE | Critical value. |
enum TREND_TYPE |
Supported innovation types.
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. |
enum X11_SEASONALMA_TYPE |
enum X13TRANSFORM_METHOD |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | method | is the method selecor (0 = sample autocorrelation, 1= periodogram-based estimate, 2= cross-correlation based estimate). |
[out] | retVal | is the calculated sample autocorrelation value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | method | is the method selecor (0 = sample autocorrelation, 1= periodogram-based estimate, 2= cross-correlation based estimate). |
[out] | retVal | is the standard error in the sample autocorrelation value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | method | is the method selecor (0 = sample autocorrelation, 1= periodogram-based estimate, 2= cross-correlation based estimate). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | ULCI | is the upper limit value of the confidence interval |
[out] | LLCI | is the lower limit value of the confidence interval. |
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.
NDK_SUCCESS | Operation successful |
Error | code |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | method | is the type of test: parametric or non-parametric. |
[in] | target | is the assumed autocorrelation function value. If missing, the default of zero is assumed. |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[out] | retVal | is the calculated test statistics. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N1 | is the number of observations in X. |
[in] | Y | is the second univariate time series data (a one dimensional array). |
[in] | N2 | is the number of observations in Y. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is 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] | options | is 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] | testDown | is 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] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | method | is the statistical test to perform (1=ADF). |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[in,out] | retVal | is the calculated test statistics. |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | S | is the length of seasonality (expressed in terms of lags, where s > 1). |
[in] | theta | is the coefficient of first-lagged innovation (see model description). |
[in] | theta2 | is the coefficient of s-lagged innovation (see model description). |
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC). |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | S | is the length of seasonality (expressed in terms of lags, where s > 1). |
[in] | theta | is the coefficient of first-lagged innovation (see model description). |
[in] | theta2 | is the coefficient of s-lagged innovation (see model description). |
[in] | nStep | is the forecast time/horizon (expressed in terms of steps beyond end of the time series). |
[in] | retType | is a switch to select the type of value returned (see FORECAST_RETVAL_FUNC). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retVal | is the calculated forecast value. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the model mean (i.e. ). |
[in] | sigma | is the standard deviation ( ) of the model's residuals/innovations. |
[in] | S | is the length of seasonality (expressed in terms of lags, where s > 1). |
[in] | theta | is the coefficient of first-lagged innovation ( )(see model description). |
[in] | theta2 | is the coefficient of s-lagged innovation ( ) (see model description). |
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC). |
[out] | retVal | is the calculated value of the goodness of fit. |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in,out] | mean | is the model mean (i.e. mu). |
[in,out] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | S | is the length of seasonality (expressed in terms of lags, where s > 1). |
[in,out] | theta | is the coefficient of first-lagged innovation (see model description). |
[in,out] | theta2 | is the coefficient of s-lagged innovation (see model description. |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC). |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | S | is the length of seasonality (expressed in terms of lags, where s > 1). |
[in] | theta | is the coefficient of first-lagged innovation (see model description). |
[in] | theta2 | is the coefficient of s-lagged innovation (see model description). |
[in] | retType | is a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC. |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is a univariate time series of the initial values (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | S | is the length of seasonality (expressed in terms of lags, where s > 1). |
[in] | theta | is the coefficient of first-lagged innovation (see model description). |
[in] | theta2 | is the coefficient of s-lagged innovation (see model description). |
[in] | nSeed | is an unsigned integer for setting up the random number generators. |
[out] | retArray | is the calculated simulation value. |
[in] | nSteps | is the number of future steps to simulate for. |
int __stdcall NDK_AIRLINE_VALIDATE | ( | double | mean, |
double | sigma, | ||
WORD | S, | ||
double | theta, | ||
double | theta2 ) |
Examines the model's parameters for stability constraints (e.g. stationarity, etc.).
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | S | is the length of seasonality (expressed in terms of lags, where s > 1). |
[in] | theta | is the coefficient of first-lagged innovation (see model description). |
[in] | theta2 | is the coefficient of s-lagged innovation (see model description). |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | method | is the statistical test to perform (1=Ljung-Box). |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[out] | retVal | is the calculated test statistics. |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the model's integration order. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC). |
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).
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the model's integration order. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | nStep | is the forecast time/horizon (expressed in terms of steps beyond end of the time series). |
[in] | retType | is a switch to select the type of value returned (see FORECAST_RETVAL_FUNC). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retVal | is the calculated forecast value. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the model's integration order. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC). |
[out] | retVal | is the calculated GOF return value. |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in,out] | mean | is the ARMA model mean (i.e. mu). |
[in,out] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the model's integration order. |
[in,out] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in,out] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC). |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the model's integration order. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | nSeed | is an unsigned integer for setting up the random number generators. |
[out] | retVal | is the calculated simulation value. |
[in] | nSteps | is the number of future steps to simulate for. |
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.).
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the integration order. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
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).
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC). |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | nStep | is the forecast time/horizon (expressed in terms of steps beyond end of the time series). |
[in] | retType | is a switch to select the type of value returned (FORECAST_MEAN, FORECAST_STDEV , ..) (see FORECAST_RETVAL_FUNC). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retVal | is the calculated forecast value. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC). |
[out] | retVal | is the calculated goodness of fit value. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in,out] | mean | is the ARMA model mean (i.e. mu). |
[in,out] | sigma | is the standard deviation of the model's residuals/innovations. |
[in,out] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in,out] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC). |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component) |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component) |
[in] | retType | is a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mean | is the ARMA model long-run mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
[in] | pData | are the values of the latest (most recent) observations. |
[in] | nSize | is the number elements in pData. |
[in] | nSeed | is an unsigned integer to initialize the psuedorandom number generator. |
[out] | retArray | is the output array to hold nSteps future simulations. |
[in] | nSteps | is the number of future steps to simulate for. |
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.).
NDK_TRUE | model is stable |
NDK_FALSE | model is instable |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mean | is the ARMA model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | phis | are the parameters of the AR(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in phis (order of AR component). |
[in] | thetas | are the parameters of the MA(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in thetas (order of MA component). |
int __stdcall NDK_AVERAGE | ( | double * | X, |
size_t | N, | ||
WORD | reserved, | ||
double * | retVal ) |
Calculates the sample average.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated average value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | bAscending | is 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_min | is the number of periods for the high pass filter (e.g. 6 for quarterly data, 18 for monthly data). |
[in] | freq_max | is the number of periods for the low passfilter (e.g. 32 for quarterly data, 96 for montly data). |
[in] | K | is the number of points(aka terms) to use in the approximate optimal filter. If missing, a default value of 12 is assumed |
[in] | drift | is a logical value: FALSE if no drift in time series (default), TRUE if drift in time series. |
[in] | unitroot | is a logical value: FALSE if no unit-root is in time series (default), TRUE if unit-root is in time series. |
[in] | retTYpe | is the integer enumeration for the filter output: (1= trend component (default), 2=cyclical component, 3=noise component) |
int __stdcall NDK_BMA_WGHTS | ( | size_t | M, |
double * | pterms, | ||
size_t * | pSize ) |
Computes Binomial weighted moving average series.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in] | M | is the number of terms in the filter |
[out] | pterms | is the filter's terms or weights array. |
[in,out] | pSize | is the output buffer size. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | lo | is the domain lower bound |
[in] | hi | is the domain upper bound |
[in] | lambda | is the input power parameter of the transformation, on a scale from 1 to 0. If omitted, a default value of 0 is assumed. |
[in] | retTYpe | is a number that determines the type of return value: 1 (or missing)=Box-Cox, 2=inverse Box-Cox, 3= LLF of Box-Cox. |
[out] | retVal | is the calculated log-likelihood value of the transform (retType=3). |
int __stdcall NDK_CAGR | ( | double | endValue, |
double | startValue, | ||
double | time, | ||
double * | retVal ) |
Calculates the overall CAGR of a series of returns.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | nItems | is the number of draws or objects. |
[in] | replacement | is the type of draw: with replacement or without replacement. |
[in] | ulSeed | is random number generator seed. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | XX1 | is the independent variables data matrix of the first data set (two dimensional). |
[in] | M | is the number of variables (columns) in XX1 and XX2. |
[in] | Y1 | is the response or the dependent variable data array for the first data set (one dimensional array). |
[in] | N1 | is the number of observations (rows) in the first data set. |
[in] | XX2 | is the independent variables data matrix of the second data set, such that each column represents one variable. |
[in] | Y2 | is the response or the dependent variable data array of the second data set (one dimensional array). |
[in] | N2 | is the number of observations (rows) in the second data set. |
[in] | mask | is the boolean array to select a subset of the input variables in X. If NULL, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the mask, which must be zero or equal to M. |
[in] | intercept | is 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] | retType | is a switch to select the return output (see TEST_RETURN for more details). |
[in] | retVal | is the calculated Chow test statistics. |
int __stdcall NDK_CLOGLOG | ( | double * | X, |
size_t | N, | ||
double | lo, | ||
double | hi, | ||
WORD | retTYpe ) |
Computes the complementary log-log transformation, including its inverse.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | lo | is the domain lower bound, if missing, lo=0 |
[in] | hi | is the domain upper bound, if missing, hi=1 |
[in] | retTYpe | is a number that determines the type of return value: 1 (or missing)=C-log-log , 2=inverse C-log-log. |
int __stdcall NDK_CMA | ( | double * | X, |
size_t | N, | ||
BOOL | bAscending, | ||
const double * | pWeights, | ||
size_t | K, | ||
BOOL | bEndPoints ) |
Computes central moving average series.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | pWeights | is the filter's terms or weights array. |
[in] | K | is the number of terms in the filter |
[in] | bEndPoints | is a flag to apply asymmetric filter to the end-points. |
int __stdcall NDK_CMA_WGHTS | ( | size_t | M, |
double * | pterms, | ||
size_t * | pSize ) |
Computes centered weighted moving average series.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in] | M | is the number of terms in the filter |
[out] | pterms | is the filter's terms or weights array. |
[in,out] | pSize | is the output buffer size. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | XX | is the input variables matrix data (two dimensional). |
[in] | N | is the number of rows (observations) in XX. |
[in] | M | is the number of columns (variables) in XX. |
[in] | mask | is the boolean array to select a subset of the input variables in X. If NULL, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the mask. Must be zero or equal to M. |
[in] | nMethod | is the multi-colinearity measure to compute (see COLNRTY_TEST_TYPE). |
[in] | nColIndex | is a switch to designate the explanatory variable to examine (not required for condition number). |
[out] | retVal | is the calculated statistics of collinearity. |
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.
NDK_SUCCESS | Operation successful |
Error | code |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N1 | is the number of observations in X. |
[in] | Y | is the second univariate time series data (a one dimensional array) |
[in] | N2 | is the number of observations in Y. |
[out] | Z | is the convolution time series output |
[in,out] | W | is the maximum number of elements in Z. |
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.
NDK_SUCCESS | Operation successful |
Error | code |
[out] | szFullPath | is the buffer that will receive the return value |
[in,out] | nSize | is the maximum number of characters to copy to the buffer. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | alpha | is the data smoothing factor (alpha should be between zero and one (exclusive)). |
[in] | beta | is the trend smoothing factor (beta should be between zero and one (exclusive)). |
[in] | xlHorizon | is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed. |
[in] | bOptimize | is 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] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | polyOrder | is the order of the polynomial time trend: 0. subtracts mean (default)
|
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.
NDK_SUCCESS | Operation successful |
Error | code |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[out] | retAmp | is an array of the amplitudes of the fourier transformation components |
[out] | retPhase | is an array of the phase angle (radian) of the Fourier transformation components . |
[in] | M | is the number of spectrum components (i.e. size of amp and phase) |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | S | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | D | is the number of repeated differencing (e.g. d=0 (none), d=1 (difference once), 2=(difference twice), etc.). |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in] | pOuterWeights | is the second MA weights. |
[in] | M | is the number of terms in the second MA. |
[in] | pInnerWeights | is the first MA weights. |
[in] | K | is the number of terms in the first MA. |
[out] | pterms | is the filter weights (a one dimensional array). |
[in,out] | pSize | is the filter weights terms size. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | pData | is the input data series (one/two dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | targetVal | is the target value to compute the underlying cdf for. |
[in] | retType | is a switch to select the return output (1=CDF (default), 2=Inverse CDF). |
[out] | retVal | is the computed value. |
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)
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Gammas | are the leverage parameters (starting with the lowest lag). |
[in] | g | is the number of elements in Gammas. Must be equal to (p-1). |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC) |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | sigmas | is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. |
[in] | nSigmaSize | is the number of elements in sigmas. Only the latest q observations are used. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in,out] | Gammas | are the leverage parameters (starting with the lowest lag). |
[in] | g | is the number of elements in Gammas. Must be equal to (p-1). |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | nStep | is the forecast time/horizon (expressed in terms of steps beyond end of the time series). |
[in] | retType | is a switch to select the type of value returned
|
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retVal | is the simulated value for the GARCH process. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the EGARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Gammas | are the leverage parameters (starting with the lowest lag). |
[in] | g | is the number of elements in Gammas. Must be equal to (p-1). |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC) |
[out] | retVal | is the calculated goodness of fit value. |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in,out] | Gammas | are the leverage parameters (starting with the lowest lag). |
[in] | g | is the number of elements in Gammas. Must be equal to (p-1). |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[out] | retVal | is the calculated Long run volatility. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in,out] | mu | is the EGARCH model conditional mean (i.e. mu). |
[in,out] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in,out] | Gammas | are the leverage parameters (starting with the lowest lag). |
[in] | g | is the number of elements in Gammas. Must be equal to (p-1). |
[in,out] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in,out] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC) |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. |
int __stdcall NDK_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
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the EGARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Gammas | are the leverage parameters (starting with the lowest lag). |
[in] | g | is the number of elements in Gammas. Must be equal to (p-1). |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Gammas | are the leverage parameters (starting with the lowest lag). |
[in] | g | is the number of elements in Gammas. Must be equal to (p-1). |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE) |
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | sigmas | is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. |
[in] | nSigmaSize | is the number of elements in sigmas. Only the latest q observations are used. |
[in] | nSeed | is an unsigned integer for setting up the random number generators |
[out] | retArray | is the calculated simulation value |
[in] | nSteps | is the number of future steps to simulate for. |
int __stdcall NDK_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.).
NDK_TRUE | Model is stable (i.e. variance process is stationary and yield positive values) |
NDK_FALSE | Model is unstable. |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in,out] | Gammas | are the leverage parameters (starting with the lowest lag). |
[in] | g | is the number of elements in Gammas. Must be equal to (p-1). |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | nWindowSize | is the number of observation in the rolling window. |
[in] | nVariant | is 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] | retVal | is the calculated value of this function. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | lambda | is the smoothing parameter used for the exponential-weighting scheme. If missing, a default value of 0.94 is assumed |
[in] | step | is 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] | retVal | is the estimated value of the exponential-weighted volatility. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the first univariate time series data (a one dimensional array). |
[in] | Y | is the second univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X (or Y). |
[in] | lambda | is the smoothing parameter used for the exponential-weighting scheme. If missing, a default value of 0.94 is assumed. |
[in] | step | is 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] | retVal | is the estimated value of the correlation factor. |
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)
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_GARCH_FITTED | ( | double * | pData, |
size_t | nSize, | ||
double | mu, | ||
const double * | Alphas, | ||
size_t | p, | ||
const double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double | nu, | ||
WORD | retType ) |
Returns an array of cells for the fitted values (i.e. mean, volatility and residuals)
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC) |
int __stdcall NDK_GARCH_FORE | ( | double * | pData, |
size_t | nSize, | ||
double * | sigmas, | ||
size_t | nSigmaSize, | ||
double | mu, | ||
const double * | Alphas, | ||
size_t | p, | ||
const double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double | nu, | ||
size_t | nStep, | ||
WORD | retType, | ||
double | alpha, | ||
double * | retVal ) |
Calculates the out-of-sample forecast statistics.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | sigmas | is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. |
[in] | nSigmaSize | is the number of elements in sigmas. Only the latest q observations are used. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | nStep | is the forecast time/horizon (expressed in terms of steps beyond end of the time series). |
[in] | retType | is a switch to select the type of value returned
|
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retVal | is the calculated forecast value |
int __stdcall NDK_GARCH_GOF | ( | double * | pData, |
size_t | nSize, | ||
double | mu, | ||
const double * | Alphas, | ||
size_t | p, | ||
const double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double | nu, | ||
WORD | retType, | ||
double * | retVal ) |
Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the GARCH model.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC) |
[out] | retVal | is the calculated goodness of fit value. |
int __stdcall NDK_GARCH_LRVAR | ( | double | mu, |
const double * | Alphas, | ||
size_t | p, | ||
const double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double | nu, | ||
double * | retVal ) |
Calculates the long-run average volatility for the given GARCH model.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[out] | retVal | is the calculated long run value |
int __stdcall NDK_GARCH_PARAM | ( | double * | pData, |
size_t | nSize, | ||
double * | mu, | ||
double * | Alphas, | ||
size_t | p, | ||
double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double * | nu, | ||
WORD | retType, | ||
size_t | maxIter ) |
Returns an array of cells for the initial (non-optimal), optimal or standard errors of the model's parameters.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in,out] | mu | is the GARCH model conditional mean (i.e. mu). |
[in,out] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in,out] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in,out] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC) |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. |
int __stdcall NDK_GARCH_RESID | ( | double * | pData, |
size_t | nSize, | ||
double | mu, | ||
const double * | Alphas, | ||
size_t | p, | ||
const double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double | nu, | ||
WORD | retType ) |
Returns an array of cells for the standardized residuals of a given GARCH model
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC |
int __stdcall NDK_GARCH_SIM | ( | double | mu, |
const double * | Alphas, | ||
size_t | p, | ||
const double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double | nu, | ||
double * | pData, | ||
size_t | nSize, | ||
double * | sigmas, | ||
size_t | nSigmaSize, | ||
UINT | nSeed, | ||
double * | retArray, | ||
size_t | nSteps ) |
Returns a simulated data series the underlying GARCH process.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE) |
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | pData | is the univariate time series of the latest observations (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | sigmas | is the univariate time series of the latest observations (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. |
[in] | nSigmaSize | is the number of elements in sigmas. Only the latest q observations are used. |
[in] | nSeed | is an unsigned integer for setting up the random number generators |
[out] | retArray | is the calculated simulation value |
[in] | nSteps | is the number of future steps to simulate for. |
int __stdcall NDK_GARCH_VALIDATE | ( | double | mu, |
const double * | Alphas, | ||
size_t | p, | ||
const double * | Betas, | ||
size_t | q, | ||
WORD | nInnovationType, | ||
double | nu ) |
Examines the model's parameters for stability constraints (e.g. variance stationary, positive variance, etc.).
NDK_TRUE | Model is stable (i.e. variance process is stationary and yield positive values) |
NDK_FALSE | Model is unstable. |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
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)
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | flambda | is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium. |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC) |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | sigmas | is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. |
[in] | nSigmaSize | is the number of elements in sigmas. Only the latest q observations are used. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | flambda | is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium. |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | nStep | is the forecast time/horizon (expressed in terms of steps beyond end of the time series). |
[in] | retType | is a switch to select the type of value returned
|
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retVal | is the calculated forecast value |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | flambda | is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium. |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC) |
[out] | retVal | is the calculated goodness of fit value. |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | flambda | is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium. |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[out] | retVal | is the calculated long run value |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in,out] | mu | is the GARCH model conditional mean (i.e. mu). |
[in,out] | flambda | is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium. |
[in,out] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in,out] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in,out] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC) |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. |
int __stdcall NDK_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
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | flambda | is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium. |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | retType | is a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | flambda | is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium. |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE) |
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | sigmas | is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. |
[in] | nSigmaSize | is the number of elements in sigmas. Only the latest q observations are used. |
[in] | nSeed | is an unsigned integer for setting up the random number generators |
[out] | retArray | is the calculated simulation value |
[in] | nSteps | is the number of future steps to simulate for. |
int __stdcall NDK_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.).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mu | is the GARCH model conditional mean (i.e. mu). |
[in] | flambda | is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium. |
[in] | Alphas | are the parameters of the ARCH(p) component model (starting with the lowest lag). |
[in] | p | is the number of elements in Alphas array |
[in] | Betas | are the parameters of the GARCH(q) component model (starting with the lowest lag). |
[in] | q | is the number of elements in Betas array |
[in] | nInnovationType | is the probability distribution function of the innovations/residuals (see INNOVATION_TYPE)
|
[in] | nu | is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | mean | is the mean of the Gaussian distribution. |
[in] | sigma | is the standard deviation of the Gaussian distribution. |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | upper | is a switch to select the limit (upper/lower). |
[out] | retVal | is the computed value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | mean | is the mean of the Gaussian distribution. |
[in] | sigma | is the standard deviation of the Gaussian distribution. |
[in] | seed | is a number to initialize the psuedorandom number generator. |
[out] | retArray | are the generated random values. |
[in] | nArraySize | is the number of elements in retArray |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | mean | is the mean of the GED distribution. |
[in] | sigma | is the standard deviation of the GED distribution. |
[in] | df | is the degrees of freedom (nu) of the GED distribution. |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | upper | is a switch to select the limit (upper/lower). |
[out] | retVal | is the computed value. |
int __stdcall NDK_GED_XKURT | ( | double | df, |
double * | retVal ) |
Calculates the excess kurtosis of the generalized error distribution (GED).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | df | is the shape parameter (or degrees of freedom) of the distribution (V > 1). |
[out] | retVal | is the computed value |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | alpha | is the data smoothing factor (alpha should be between zero and one (exclusive)). |
[in] | beta | is the trend smoothing factor (beta should be between zero and one (exclusive)). |
[in] | gamma | is the seasonal change smoothing factor (Gamma should be between zero and one (exclusive)). |
[in] | phi | is the damping coefficient for the trend. |
[in] | lambda | is the coefficient value for the autocorrelation adjustment |
[in] | TrendType | is the type of trend in the model (0=none, 1=additive, 2- damped additive, 3=multiplicative, 4=damped multiplicative) |
[in] | SeasonalityType | is the type of seasonality in the modem (0=none, 1=additive, 2=multiplicative) |
[in] | seasonLength | is the season length. |
[in] | nHorizon | is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed. |
[in] | bOptimize | is a flag (True/False) for searching and using optimal value of the smoothing factor. If missing or omitted, optimize is assumed false. |
[in] | bAutoCorrelationAdj | is a flag (True/False) for adding a correction term for the 1st ourder autocorrelation in the |
[in] | bLogTransform | is 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] | retVal | is the calculated value of this function. |
int __stdcall NDK_GINI | ( | double * | x, |
size_t | N, | ||
double * | retVal ) |
Returns the sample Gini coefficient, a measure of statistical dispersion.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | x | is the input data sample (must be non-negative) (a one dimensional array of values). |
[in] | N | is the number of observations in X. |
[out] | retVal | is the calculated value of this function. |
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 ) |
[in,out] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nSize | is the number of observations |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nVars | is the number of independent variables (or columns in X) |
[in] | betas | are the coefficients of the GLM model (a one dimensional array) |
[in] | nBetas | is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1 |
[in] | phi | is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
|
[in] | Lvk | is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
|
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nVars | is the number of independent variables (or columns in X) |
[in,out] | betas | are the coefficients of the GLM model (a one dimensional array) |
[in] | nBetas | is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1 |
[in,out] | phi | is 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.
| |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see # FORECAST_RETVAL_FUNC) |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retval | is the calculated forecast value |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nSize | is the number of observations |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nVars | is the number of independent variables (or columns in X) |
[in] | betas | are the coefficients of the GLM model (a one dimensional array) |
[in] | nBetas | is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1 |
[in] | phi | is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
|
[in] | Lvk | is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
|
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC) |
[out] | retVal | is the calculated goodness of fit measure. |
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
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nSize | is the number of observations |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nVars | is the number of independent variables (or columns in X) |
[in,out] | betas | are the coefficients of the GLM model (a one dimensional array) |
[in] | nBetas | is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1 |
[in,out] | phi | is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
|
[in] | Lvk | is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
|
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC) |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing, the default maximum of 100 is assumed. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nSize | is the number of observations |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nVars | is the number of independent variables (or columns in X) |
[in] | betas | are the coefficients of the GLM model (a one dimensional array) |
[in] | nBetas | is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1 |
[in] | phi | is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
|
[in] | Lvk | is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
|
[in] | retType | is a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC |
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.).
NDK_TRUE | GLM model is valid |
NDK_FALSE | GLM model in invalid. For other return values, see SFMacros.h |
[in] | betas | are the coefficients of the GLM model (a one dimensional array) |
[in] | nBetas | is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1 |
[in] | phi | is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
|
[in] | Lvk | is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
|
int __stdcall NDK_GMEAN | ( | double * | X, |
size_t | N, | ||
WORD | reserved, | ||
double * | retVal ) |
Calculates the geometric mean of the sample.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated geometric average value. |
int __stdcall NDK_GMRAE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
size_t | period, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecasted time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | period | is the seasonal period (for non-seasonal time series, set M=1). |
[out] | retVal | is the calculated geometric mean of relative absolute error |
int __stdcall NDK_GMSE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecasted time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[out] | retVal | is the calculated mean of squared errors. |
int __stdcall NDK_GRMSE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecast time series data (a one dimensional array). |
N | [In] is the number of observations in X. | |
[out] | retVal | is the calculated value of this function. |
int __stdcall NDK_HASNA | ( | const double * | X, |
size_t | nSize, | ||
BOOL | intermediate ) |
Examine whether the given array has one or more missing values.
NDK_TRUE | One or more missing value are detected. |
NDK_FALSE | No missing value is found. |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | intermediate | is a switch to tune the search for missng values:
|
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | pData | is the input data series (one/two dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | nBins | is the input number of bins for the histogram. |
[in] | index | is the bin index or order; e.g. 0=1st bin (default),1=2nd bin,..., N-1. |
[in] | argRetTYpe | is a switch to select the return output (0=lower limit (default), 1=upper limit of the bin, 2=center of the bin). |
[out] | retVal | is the computed value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | pData | is the input data series (one/two dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | argMethod | is 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] | retVal | is the computed value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | pData | is the input data series (one/two dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | nBins | is the input number of bins for the histogram. |
[in] | index | is the bin index or order; e.g. 0=1st bin (default),1=2nd bin,..., N. |
[in] | argRetTYpe | is a switch to select the return output: 0. histogram
|
[out] | retVal | is the computed value. |
int __stdcall NDK_HMA_WGHTS | ( | size_t | M, |
double * | pterms, | ||
size_t * | pSize ) |
Computes Henderson weighted moving average series.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in] | M | is the number of terms in the filter |
[out] | pterms | is the filter's terms or weights array. |
[in,out] | pSize | is the output buffer size. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | lambda | is the multiplier used to penalize the variation in the trend component. If missing, a default is used based on data frequency. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | alpha | is the statistical significance level (1%, 5%, 10%). If missing, a default of 5% is assumed. |
[in] | retType | is 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] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | Operation successful |
Error | code |
[in] | amp | is an array of the amplitudes of the fourier transformation components. |
[in] | phase | is an array of the phase angle (radian) of the Fourier transformation components . |
[in] | nSize | is the number of spectrum components (i.e. size of amp and phase). |
[out] | X | is the filtered (recovered) time series output |
[in] | N | is the original number of observations used to calculate the fourier transform. |
int __stdcall NDK_INFO | ( | int | nRetType, |
LPTSTR | szMsg, | ||
int | nSize ) |
Query & retrieve NumXL SDK environment information.
NDK_SUCCESS | Operation successful |
Error | code |
[in] | nRetType | is a key/identifier to select the desired output
|
[out] | szMsg | The buffer that will receive the return value |
[in,out] | nSize | maximum number of characters to copy to the buffer. |
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:
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | szAppName | is 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] | uClientToken | is the unique value for using during the shutdown. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | S | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | D | is 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] | N0 | is the number of observations in X0. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | nMethod | is an identifier for the method used to generate values for any missing data:
|
[in] | plug | is 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] | h | is the kernel smoothing parameter (aka. bandwidth) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful (see SFMacros.h) |
[in] | pXData | is the x-component of the input data table (a one dimensional array) |
[in] | nXSize | is the number of elements in X |
[in] | pYData | is the y-component of the input data table (a one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | pXTargets | is the desired x-value(s) to interpolate for (a single value or a one dimensional array). |
[in] | nXTargetSize | is the number of elements in XT |
[in] | nMethod | is the interpolation method (1=Forward Flat, 2=Backward Flat, 3=Linear, 4=Cubic Spline). 0. Linear
|
[in] | allowExtrp | sets whether or not to allow extrapolation (1=Yes, 0=No). If missing, the default is to not allow extrapolation |
[out] | pYTargets | is the output buffer to store the interpolated values |
[in] | nYTargetSize | is the number of elements in YVals (must equal to Nxt). |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | nMethod | is an identifier for the method used to generate values for any missing data:
|
[in] | WGH | weighting method (KNN) 0 = none (or equal), 1=distance, 2=kernel (ignore nMethod <>7 ) |
[in] | KRNL | kernel function (ignore nMethod <7 or (nMethod =7 and WGH <>2)) 0. UNIFORM_KERNEL
|
[in] | P | Polynomial order (KREG and LOCREG) (ignore nMethod < 8) |
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 ) |
[in] | pXData | is the independent (explanatory) variables data matrix, such that each row represents one variable. |
[in] | nXSize | is the number of observations (columns) in X. |
[in] | nXVars | is the number of independent (explanatory) variables (rows) in X. |
[in] | mask | is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the "mask." |
[in] | nMethod | is the interpolation method: 0. BiLinear
|
[in] | extrapolate | sets whether or not to allow extrapolation (1=Yes, 0=No). If missing, the default is to not allow extrapolation |
[in,out] | target | is the desired x-value(s) to interpolate for (a single value or a one dimensional array). |
[in] | ntargetSize | is the number of elements (columns) in target. |
int __stdcall NDK_IQR | ( | double * | X, |
size_t | N, | ||
double * | retVal ) |
Returns the interquartile range (IQR), also called the midspread or middle fifty.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[out] | retVal | is the calculated IQR value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | XX | is the multivariate time series matrix data (two dimensional). |
[in] | N | is the number of observations in XX. |
[in] | M | is the number of variables in XX. |
[in] | K | is the number of lagged difference terms used when computing the estimator. |
[in] | nPolyOrder | is the order of the polynomial: (-1=no constant, 0=contant-only (default), 1=constant and trend). |
[in] | tracetest | is a flag to select test: TRUE=trace, FALSE=maximal eignvalue test. |
[in] | R | is the assumed number of cointegrating relationships between the variables (if missing, r=1). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retStat | is the calculated test statistics score. |
[out] | retCV | is the calculated test critical value. |
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 ) |
[in] | pData | is the input data series (one/two dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | lo | is the lower bound of the x-domain. If none, pass NAN |
[in] | hi | is the upper bound of the x-domain. If none, pass NAN |
[in] | transform | is 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] | lambda | is the exponent for Box-Cox (power transform). Must be [0,1), Ignored for non-Box transform |
[in] | argKernelFunc | is 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] | bandwidth | is the smoothing parameter (bandwidth) of the kernel density estimator. If Optimization is on, then use as initial value. |
[in] | bOptimize | is a flag (True/False) for searching and using the optimal value of the bandwidth factor. If missing or omitted, optimize is assumed false. |
[in] | argOptMethod | is 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] | argAdaptive | is a flag (True/False) for adopting a variable bandwidth or fixed bandwidth |
[in] | argRetType | is 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] | argCount | is 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. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | pData | is the input data series (one/two dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | targetVal | is the target value to compute the underlying cdf for. |
[in] | bandwidth | is the smoothing parameter (bandwidth) of the kernel density estimator. If missing, the KDE function calculates an optimal value. |
[in] | argKernelFunc | is a switch to select the kernel function: 1=Gaussian (default), 2=Uniform 3=Triangular 4=Biweight (Quatric) 5=Triweight 6=Epanechnikov |
[out] | retVal | is the computed value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful (see SFMacros.h) |
[in] | pXData | is the x-component of the input data table (a one dimensional array) |
[in] | nXSize | is the number of elements in X |
[in] | pYData | is the y-component of the input data table (a one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in,out] | pK | is the K-parameter of the K-NN algorithm |
[in] | nMethod | is the K-NN regression method (0=Origional, 1=weighted by distance, 2=variable-bandwidth kernel). 0. Original K-NN
|
[in] | KernelFn | is the kernel function. 0. UNIFORM_KERNEL
|
[in] | optimize | is a flag (True/False) for searching and using the optimal value of the K-parameter. |
[out] | pCVRMSE | is the RMSE measure of the cross validation |
[in] | pXTargets | is the desired x-value(s) to interpolate for (a single value or a one dimensional array). |
[in] | nXTargetSize | is the number of elements in XT |
[out] | pYForecastValues | is the output buffer to store the forecast/regression values of the query data points |
[in] | nYTargetValuesSize | is the number of elements in pYForecastValues (must equal to nXTargetSize). |
[out] | pYForecastErrors | is the output buffer to store the regression errors. |
[in] | nYTargetErrorsSize | is the number of elements in pYForecastErrors (must equal to nXTargetSize). |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful (see SFMacros.h) |
[in] | X | is the x-component of the input data table (a one dimensional array) |
[in] | Nx | is the number of elements in X |
[in] | Y | is the y-component of the input data table (a one dimensional array) |
[in] | Ny | is the number of elements in Y |
[in] | XT | is the desired x-value(s) to interpolate for (a single value or a one dimensional array). |
[in] | Nxt | is the number of elements in XT |
[in] | KernelFn | is the kernel function. 0. UNIFORM_KERNEL
|
[in,out] | kernelParam | is the kernel smoothing parameter (aka bandwith). |
[in] | bOptimize | is a flag to turn on/off the optimization |
[in] | extrapolate | sets whether or not to allow extrapolation (1=Yes, 0=No). If missing, the default is to not allow extrapolation |
[out] | YVals | is the output buffer to store the interpolated values |
[in] | Nyvals | is the number of elements in YVals (must equal to Nxt). |
[out] | pCV | is the leave-one-out cross-validation RMSE |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful (see SFMacros.h) |
[in] | pXData | is the x-component of the input data table (a one dimensional array) |
[in] | nXSize | is the number of elements in X |
[in] | pYData | is the y-component of the input data table (a one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | POrder | is the order of the regression polynomial |
[in] | nKernelFunc | is the kernel function. 0. UNIFORM_KERNEL
|
[in,out] | pAlpha | is the smoothing parameter of the kernel function. |
[in] | optimize | is a flag (True/False) for searching and using the optimal value of the K-parameter. |
[out] | pCVRMSE | is the RMSE measure of the cross validation |
[in] | pXTargets | is the desired x-value(s) to interpolate for (a single value or a one dimensional array). |
[in] | nXTargetSize | is the number of elements in XT |
[out] | pYForecastValues | is the output buffer to store the forecast/regression values of the query data points |
[in] | nYTargetValuesSize | is the number of elements in pYForecastValues (must equal to nXTargetSize). |
[out] | pYForecastErrors | is the output buffer to store the regression errors. |
[in] | nYTargetErrorsSize | is the number of elements in pYForecastErrors (must equal to nXTargetSize). |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | alpha | is the smoothing factor (alpha should be between zero and one (exclusive)). If missing or omitted, a value of 0.333 is used. |
[in] | xlHorizon | is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed. |
[in] | bOptimize | is 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] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful (see SFMacros.h) |
[in] | pXData | is the x-component of the input data table (a one dimensional array) |
[in] | nXSize | is the number of elements in X |
[in] | pYData | is the y-component of the input data table (a one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | POrder | is the order of the regression polynomial |
[in] | nKernelFunc | is the kernel function. 0. UNIFORM_KERNEL
|
[in,out] | pSpan | is the percentage of the total number of the data points used in local regression . |
[in] | optimize | is a flag (True/False) for searching and using the optimal value of the K-parameter. |
[out] | pCVRMSE | is the RMSE measure of the cross validation |
[in] | pXTargets | is the desired x-value(s) to interpolate for (a single value or a one dimensional array). |
[in] | nXTargetSize | is the number of elements in XT |
[out] | pYForecastValues | is the output buffer to store the forecast/regression values of the query data points |
[in] | nYTargetValuesSize | is the number of elements in pYForecastValues (must equal to nXTargetSize). |
[out] | pYForecastErrors | is the output buffer to store the regression errors. |
[in] | nYTargetErrorsSize | is the number of elements in pYForecastErrors (must equal to nXTargetSize). |
int __stdcall NDK_LOGIT | ( | double * | X, |
size_t | N, | ||
double | lo, | ||
double | hi, | ||
WORD | retTYpe ) |
Computes the complementary log-log transformation, including its inverse.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | lo | is the domain lower bound, if missing, lo=0 |
[in] | hi | is the domain upper bound, if missing, hi=1 |
[in] | retTYpe | is a number that determines the type of return value: 1 (or missing)=logit, 2=inverse logit. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one/two dimensional array). |
[in] | N | is the number of observations in X. |
[in] | w | is the input Bartlett kernel window size. If omitted, the default value is the cubic root of the sample data size. |
[out] | retVal | is the calculated value of this function. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | nWindowSize | is the number of observation in the rolling window. |
[in] | nVariant | is 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] | retVal | is the calculated value of this function. |
int __stdcall NDK_MAAPE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecast time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[out] | retVal | is the calculated value of this function. |
int __stdcall NDK_MAD | ( | double * | X, |
size_t | N, | ||
WORD | reserved, | ||
double * | retVal ) |
Returns the sample median of absolute deviation (MAD).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one/two dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecast time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[out] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecast time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | SMAPE | is a switch to select the return output (FALSE=MAPE (default), TRUE=Symmetric MAPE (SMAPI)). |
[out] | retVal | is the calculated value of this function. |
int __stdcall NDK_MASE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
size_t | M, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecast time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | M | is the seasonal period (for non-seasonal time series, set M=1). |
[out] | retVal | is the calculated value of this function. |
int __stdcall NDK_MAX | ( | double * | X, |
size_t | N, | ||
WORD | reserved, | ||
double * | retVal ) |
Calculates the maximum value in a given sample.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated maximum value. |
int __stdcall NDK_MD | ( | double * | pData, |
size_t | nSize, | ||
WORD | reserved, | ||
double * | retVal ) |
Returns the mean difference of the input data series.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | pData | is the input data series (one/two dimensional array). |
[in] | nSize | is the number of observations in pData. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the computed value. |
int __stdcall NDK_MDA | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecast time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[out] | retVal | is the calculated value of this function. |
int __stdcall NDK_MdAPE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
BOOL | SMAPE, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecast time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | SMAPE | is a switch to select the scale to divide on: FALSE = Actual obs., TRUE= Average (Actual, Forecast) |
[out] | retVal | is the calculated value of this function. |
int __stdcall NDK_MdRAE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
size_t | period, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecasted time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | period | is the seasonal period (for non-seasonal time series, set M=1). |
[out] | retVal | is the calculated median of relative absolute error |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | X | is the sample data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | target | is the assumed mean value. If missing, a default of zero is assumed. |
[in] | alpha | is the statistical significance level. If missing, the default of 5% is assumed. |
[in] | method | is the statistical test to perform (1=parametric). |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[out] | retVal | is the calculated test statistics. |
int __stdcall NDK_MIN | ( | double * | X, |
size_t | N, | ||
WORD | reserved, | ||
double * | retVal ) |
Calculates the minimum value in a given sample.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated minimum value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pXData | is the independent (explanatory) variables data matrix, such that each column represents one variable. |
[in] | nXSize | is the number of observations (rows) in X |
[in] | nXVars | is the number of independent (explanatory) variables (columns) in X. |
[in] | mask | is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the "mask." |
[in] | Y | is the response or dependent variable data array (one dimensional array of cells). |
[in] | nYSize | is the number of observations in Y. |
[in] | intercept | is 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] | nRetType | is a switch to select the output (1=SSR (default), 2=SSE, 3=SST, 4=MSR, 5=MSE, 6=F-stat, 7=P-value):
|
[out] | retVal | is the calculated statistics ANOVA output. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent (explanatory) variables data matrix, such that each column represents one variable. |
[in] | nXSize | is the number of observations (rows) in X. |
[in] | nXVars | is the number of independent (explanatory) variables (columns) in X. |
[in] | mask | is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the "mask." |
[in] | Y | is the response or dependent variable data array (one dimensional array of cells). |
[in] | nYSize | is the number of observations in Y. |
[in] | intercept | is 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] | nRetType | is a switch to select the return output (1=fitted values (default), 2=residuals, 3=standardized residuals, 4=leverage, 5=Cook's distance).
|
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent (explanatory) variables data matrix, such that each column represents one variable. |
[in] | nXSize | is the number of observations (rows) in X. |
[in] | nXVars | is the number of independent (explanatory) variables (columns) in X. |
[in] | mask | is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the "mask." |
[in] | Y | is the response or the dependent variable data array (one dimensional array of cells). |
[in] | nYSize | is the number of observations in Y. |
[in] | intercept | is 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] | target | is the value of the explanatory variables (a one dimensional array). |
[in] | alpha | is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed. |
[in] | nRetType | is a switch to select the return output (1=forecast (default), 2=error, 3=upper limit, 4=lower limit):
|
[out] | retVal | is the computed forecast statistics. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent (explanatory) variables data matrix, such that each column represents one variable. |
[in] | nXSize | is the number of observations (rows) in X. |
[in] | nXVars | is the number of independent (explanatory) variables (columns) in X. |
[in] | mask | is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the "mask." |
[in] | Y | is the response or dependent variable data array (one dimensional array of cells). |
[in] | nYSize | is the number of observations in Y. |
[in] | intercept | is 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] | nRetType | is a switch to select a fitness measure (1=R-square (default), 2=adjusted R-square, 3=RMSE, 4=LLF, 5=AIC, 6=BIC/SIC):
|
[out] | retVal | is the calculated goodness-of-fit statistics. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent (explanatory) variables data matrix, such that each column represents one variable. |
[in] | nXSize | is the number of observations (rows) in X. |
[in] | nXVars | is the number of independent (explanatory) variables (columns) in X. |
[in] | mask | is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the "mask." |
[in] | Y | is the response or the dependent variable data array (one dimensional array of cells). |
[in] | nYSize | is the number of observations in Y. |
[in] | intercept | is 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] | alpha | is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed. |
[in] | nRetType | is 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] | nParamIndex | is a switch to designate the target parameter (0=intercept (default), 1=first variable, 2=2nd variable, etc.). |
[out] | retVal | is the computed statistics of the regression coefficient. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent (explanatory) variables data matrix, such that each column represents one variable. |
[in] | nXSize | is the number of observations (rows) in X. |
[in] | nXVars | is the number of independent (explanatory) variables (columns) in X. |
[in] | Y | is the response or dependent variable data array (one dimensional array of cells). |
[in] | nYSize | is the number of observations in Y. |
[in] | intercept | is 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] | mask1 | is the boolean array to choose the explanatory variables in model 1. If missing, all variables in X are included. |
[in] | nMaskLen1 | is the number of elements in "mask1." |
[in] | mask2 | is the boolean array to choose the explanatory variables in model 2. If missing, all variables in X are included. |
[in] | nMaskLen2 | is the number of elements in "mask2." |
[in] | alpha | is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed. |
[in] | nRetType | is a switch to select the return output (1 = P-Value (default), 2 = Test Stats, 3 = Critical Value.) |
[out] | retVal | is the calculated test statistics/ |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent (explanatory) variables data matrix, such that each column represents one variable. |
[in] | nXSize | is the number of observations (rows) in X. |
[in] | nXVars | is the number of independent (explanatory) variables (columns) in X. |
[in,out] | mask | is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the "mask." |
[in] | Y | is the response or dependent variable data array (one dimensional array of cells). |
[in] | nYSize | is the number of observations in Y. |
[in] | intercept | is 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] | alpha | is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed. |
[in] | nMode | is a switch to select the variable's inclusion/exclusion approach (1=forward selection (default), 2=backward elimination , 3=bi-directional elimination):
|
int __stdcall NDK_MRAE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
size_t | period, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecasted time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | period | is the seasonal period (for non-seasonal time series, set M=1). |
[out] | retVal | is the calculated mean of relative absolute error |
int __stdcall NDK_MSE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
double * | retVal ) |
Calculates the mean squared errors of the prediction function.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecasted time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[out] | retVal | is the calculated mean of squared errors. |
int __stdcall NDK_MSG | ( | int | nRetCode, |
LPTSTR | pMsg, | ||
size_t | nSize ) |
write a log message to the logging system
NDK_SUCCESS | Operation successful |
Error | code |
[in] | nRetCode | is the log level (1=trace, 2=Debug, 3=Info, 4=Warn, 5=Error, 6=Fatal Error) |
[in] | pMsg | is the log message |
[in] | nSize | us the number of characters in pMsg |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | X | is the sample data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | method | is the statistical test to perform (1=Jarque-Bera, 2=Shapiro-Wilk, 3=Chi-Square (Doornik and Hansen)). |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[out] | retVal | is the calculated test statistics. |
int __stdcall NDK_PACF | ( | double * | X, |
size_t | N, | ||
size_t | K, | ||
WORD | method, | ||
double * | retVal ) |
Calculates the sample partial autocorrelation function (PACF).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | method | is the method for calculating PACF: 0 = MLR, 1= From ACF |
[out] | retVal | is the calculated sample partial-autocorrelation value. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[out] | retVal | is the standard error in the sample partial-autocorrelation value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | ULCI | is the upper limit value of the confidence interval. |
[out] | LLCI | is the lower limit value of the confidence interval. |
int __stdcall NDK_PB | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
size_t | period, | ||
WORD | basis, | ||
double * | retVal ) |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecasted time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | period | is the seasonal period (for non-seasonal time series, set M=1). |
[in] | basis | is the switch to specify the metric used for comparison: 0=absolute error, 1=MAE, 2=MSE |
[out] | retVal | is the calculated geometric mean of relative absolute error |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nXSize | is the number of observations (i.e. rows) in X |
[in] | nXVars | is the number of variables (i.e. columns) in X |
[in] | mask | is 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] | nMaskLen | is the number of elements in |
[in] | standardize | is a flag or switch to standardize the input variables prior to the analysis:
|
[in] | nCompIndex | is the component number to return. |
[in] | retType | is a switch to select the return output
|
[out] | retVal | is the calculated value or data |
[in] | nOutSize | is the size of retVal |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nXSize | is the number of observations (i.e. rows) in X |
[in] | nXVars | is the number of variables (i.e. columns) in X |
[in] | varMask | is 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] | nMaskLen | is the number of elements in mask |
[in] | standardize | is a flag or switch to standardize the input variables prior to the analysis:
|
[in] | nVarIndex | is the input variable number |
[in] | wMacPC | is the number of principal components (PC) to include |
[in] | retType | is a switch to select the return output:
|
[out] | retVal | is the calculated value or data |
[in] | nOutSize | is the size of retVal |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nXSize | is the number of observations (i.e. rows) in X |
[in] | nXVars | is the number of variables (i.e. columns) in X |
[in] | mask | is 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] | nMaskLen | is the number of elements in mask |
[in] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | intercept | is 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] | nRetType | is a switch to select the return output:
|
[out] | retVal | is the calculated statistics ANOVA output. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nXSize | is the number of observations (i.e. rows) in X |
[in] | nXVars | is the number of variables (i.e. columns) in X |
[in] | mask | is 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] | nMaskLen | is the number of elements in mask |
[in,out] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | intercept | is 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] | nRetType | is a switch to select the return output
|
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nXSize | is the number of observations (i.e. rows) in X |
[in] | nXVars | is the number of variables (i.e. columns) in X |
[in] | mask | is 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] | nMaskLen | is the number of elements in mask |
[in] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | intercept | is 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] | target | is the value of the explanatory variables (a one dimensional array) |
[in] | alpha | is the statistical significance of the test (i.e. alpha) |
[in] | nRetType | is a switch to select the return output (1 = forecast (default), 2 = error, 3 = upper limit, 4 = lower limit). |
[out] | retVal | is the calculated forecast value or statistics. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nXSize | is the number of observations (i.e. rows) in X |
[in] | nXVars | is the number of variables (i.e. columns) in X |
[in] | mask | is 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] | nMaskLen | is the number of elements in mask |
[in] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | intercept | is 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] | nRetType | is a switch to select a fitness measure (1 = R-Square (default), 2 = Adjusted R Square, 3 = RMSE, 4 = LLF, 5 = AIC, 6 = BIC/SIC ).
|
[out] | retVal | is the calculated goodness of fit measure |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nXSize | is the number of observations (i.e. rows) in X |
[in] | nXVars | is the number of variables (i.e. columns) in X |
[in] | mask | is 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] | nMaskLen | is the number of elements in mask |
[in] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | intercept | is 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] | alpha | is the statistical significance of the test (i.e. alpha) |
[in] | nRetType | is a switch to select the return output:
|
[in] | nParamIndex | is a switch to designate the target parameter (0 = intercept (default), 1 = first variable, 2 = 2nd variable, etc.). |
[out] | retVal | is the calculated parameter value or statistics. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nXSize | is the number of observations (i.e. rows) in X |
[in] | nXVars | is the number of variables (i.e. columns) in X |
[in] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | intercept | is 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] | mask1 | is 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] | nMaskLen1 | is the number of elements in mask1 |
[in] | mask2 | is 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] | nMaskLen2 | is the number of elements in mask2 |
[in] | alpha | is the statistical significance of the test (i.e. alpha) |
[in] | nRetType | is a switch to select the return output (1 = P-Value (default), 2 = Test Stats, 3 = Critical Value.) |
[out] | retVal | is the calculated test statistics/ |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the independent variables data matrix, such that each column represents one variable |
[in] | nXSize | is the number of observations (i.e. rows) in X |
[in] | nXVars | is the number of variables (i.e. columns) in X |
[in] | mask | is 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] | nMaskLen | is the number of elements in mask |
[in] | Y | is the response or the dependent variable data array (one dimensional array) |
[in] | nYSize | is the number of elements in Y |
[in] | intercept | is 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] | alpha | is the statistical significance of the test (i.e. alpha) |
[in] | nMode | is a switch to select the variable's inclusion/exclusion approach (1=forward selection (default), 2=backward elimination , 3=bi-directional elimination):
|
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in pData. |
[in] | option | is the pre-processing option to the time series (e.g. detrend, difference, auto, etc.) |
[in] | alpha | is the statistical significance level (used in the auto-process procedure). If missing, a default of 5% is assumed. |
[out] | retVal | is the periodogram values for this series |
[in] | nOutSize | is the size of the output buffer (i.e. retVal) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in] | frequency | is the number of observations in a year (e.g., 12=monthly) |
[out] | retBeta | is the CAPM Beta |
int __stdcall NDK_PORTFOLIO_COVARIANCE | ( | double * | weights1, |
double * | weights2, | ||
size_t | nAssets, | ||
double ** | covar, | ||
double * | retVal ) |
Calculates the covariance between two portfolios.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in] | confidence | is the confidence level of the VaR |
[in] | argOptMethod | is a switch to select the CVaR method: 0=Historical (default), 1=Kernel density estimation (KDE) 2=Theoretical |
[in] | argKDEMethod | is 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] | argTheoDist | is a switch to select underlying theoretical probability distribution : 0=Gaussin (default), 1=Log-Normal distribution |
argVaR | [out, optional] is the VaR value |
int __stdcall NDK_PORTFOLIO_DWSDEV | ( | double * | returns, |
size_t | nLen, | ||
double | MAR, | ||
double * | retVal ) |
Calculates the downside deviation of a series of simple returns.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_PORTFOLIO_MDD | ( | double * | returns, |
size_t | nLen, | ||
double * | retVal ) |
Calculates the overall max-drawdown (MDD) of a series of simple returns.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_PORTFOLIO_RET | ( | double * | weights, |
size_t | nAssets, | ||
double * | returns, | ||
double * | ret ) |
compute the portfolio equivalent returns
Calculates the portfolio equivalent return.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in] | ratioType | is a switch to select underlying theoretical probability distribution : 0=Gaussin (default), 1=Log-Normal distribution |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in] | argOptMethod | is a switch to select the VaR method: 0=Historical (default), 1=Kernel density estimation (KDE) 2=Theoretical |
[in] | argKDEMethod | is 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] | argTheoDist | is a switch to select underlying theoretical probability distribution : 0=Gaussin (default), 1=Log-Normal distribution |
int __stdcall NDK_PORTFOLIO_VARIANCE | ( | double * | weights, |
size_t | nAssets, | ||
double ** | covar, | ||
double * | variance ) |
Calculates the overall portfolio variance (volatility squared).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_PROBIT | ( | double * | X, |
size_t | N, | ||
double | lo, | ||
double | hi, | ||
WORD | retTYpe ) |
Computes the probit transformation, including its inverse.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | lo | is the domain lower bound, if missing, lo=0 |
[in] | hi | is the domain upper bound, if missing, hi=1 |
[in] | retTYpe | is a number that determines the type of return value: 1 (or missing)=probit , 2=inverse probit. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | p | is a scalar value between 0 and 1 (exclusive). |
[out] | retVal | is the calculated p-th quantile value. |
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.
NDK_SUCCESS | Operation successful |
Error | code |
[in] | szLine | is the input string to match for. |
[in] | szPattern | is the regular expression (regex PERL-style) to match the input string with (e.g. ^Thi[sS].*$). |
[in] | ignoreCase | is a flag to instruct the function to ignore the letter-case in the string |
[in] | partialOK | is a flag/switch to indicate whether a substring or a partial match (search) is permitted or to only consider full-string match. |
[out] | bMatch | is the return value of the match. |
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.
NDK_SUCCESS | Operation successful |
Error | code |
[in] | szLine | is the input string to process. |
[in] | szKey | is the regular expression (PERL-style) (e.g. "^\d\w{1,2}.*$"). |
[in] | szValue | is the value to replace the match with. If missing or omitted, an empty string is used |
[in] | ignoreCase | is a flag to instruct the matching function whether to ignore letter-case. If missing, ignore_case is set to TRUE |
[in] | global | is a flag to instruct the function whether to match and replace the first occurence (FALSE) or all the matches (TRUE). |
[out] | pRetVal | is the modified string after replacement |
[in,out] | nSize | is the size of the output buffer (pRetVal) |
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.
NDK_SUCCESS | Operation successful |
Error | code |
[in] | X | is the x-component of the input data table (a one dimensional array). |
[in] | nX | is the number of elements in X. |
[in] | Y | is the y-component (i.e. function) of the input data table (a one dimensional array). |
[in] | nY | is the number of elements in Y |
[in] | nRegressType | is the model description flag for the trend function (1 = Linear (default), 2 = Polynomial, 3 = Exponential, 4 = Logarithmic, 5 = Power). |
[in] | POrder | is the polynomial order. This is only relevant for a polynomial type of trend and is ignored for all others. If missing, POrder = 1. |
[in] | intercept | is 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] | target | is the desired x-value to calculate regression value for (a single value). |
[in] | nRetType | is a switch to select the return output (1 = Forecast value (default), 2 = Upper limit, 3 = Lower Limit, 4 = R-Squared). |
[in] | alpha | is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed |
[out] | retVal | is the calculated value |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
int __stdcall NDK_RMD | ( | double * | X, |
size_t | N, | ||
WORD | reserved, | ||
double * | retVal ) |
Returns the sample relative mean difference.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one/two dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated value of this function. |
int __stdcall NDK_RMNA | ( | double * | X, |
size_t * | N ) |
Returns an array of cells of a time series after removing all missing values.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate sample data (a one dimensional array). |
[in,out] | N | is the number of observations in X. |
int __stdcall NDK_RMS | ( | double * | X, |
size_t | N, | ||
WORD | reserved, | ||
double * | retVal ) |
Returns the sample root mean square (RMS).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one/two dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is 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] | retVal | is the calculated value of this function. |
int __stdcall NDK_RMSEASONAL | ( | double * | X, |
size_t | N, | ||
size_t | period ) |
Returns an array of the deseasonalized time series, assuming a linear model.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | period | is the number of observations(i.e. points) in one season. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecast time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[out] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC). |
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).
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | nStep | is the forecast time/horizon (expressed in terms of steps beyond end of the time series). |
[in] | retType | is a switch to select the type of value returned (see FORECAST_RETVAL_FUNC). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retVal | is the calculated forecast value. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC). |
[out] | retVal | is the calculated goodness of fit value. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in,out] | mean | is the mean of the ARMA process. |
[in,out] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in,out] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in,out] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in,out] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in,out] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC). |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | nSeed | is an unsigned integer for setting up the random number generators. |
[out] | retVal | is the simulated value. |
[in] | nStep | is the simulation time/horizon (expressed in terms of steps beyond end of the time series). |
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.).
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mean | is the model mean (i.e. mu). |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | pFactors | is the exogneous factors time series data (each column is a separate factor, and each row is an observation). |
[in] | nSize | is the number of observations. |
[in] | nFactors | is the number of exognous factors. |
[in] | fBetas | is the weights or loading of the exogneous factors. |
[in] | mean | is the ARIMA/SARIMA model's long-run mean/trend (i.e. mu). If missing (i.e. NaN), then it is assumed zero. |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | retType | is a switch to select a output type ( see FIT_RETVAL_FUNC). |
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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | pFactors | is the exogneous factors time series data (each column is a separate factor, and each row is an observation). |
[in] | nSize | is the number of observations. |
[in] | nFactors | is the number of exognous factors. |
[in,out] | fBetas | is the weights or loading of the exogneous factors. |
[in,out] | mean | is the mean of the ARMA process. |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | nStep | is the forecast time/horizon (expressed in terms of steps beyond end of the time series). |
[in] | retType | is a switch to select the type of value returned (see FORECAST_RETVAL_FUNC). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[out] | retVal | is the calculated forecast value. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the response univariate time series data (a one dimensional array). |
[in] | pFactors | is the exogneous factors time series data (each column is a separate factor, and each row is an observation). |
[in] | nSize | is the number of observations. |
[in] | nFactors | is the number of exognous factors. |
[in] | fBetas | is the weights or loading of the exogneous factors. |
[in] | mean | is the ARIMA/SARIMA model's long-run mean/trend (i.e. mu). If missing (i.e. NaN), then it is assumed zero. |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | retType | is a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC). |
[out] | retVal | is the calculated goodness of fit value. |
int __stdcall NDK_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.
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | pFactors | is the exogneous factors time series data (each column is a separate factor, and each row is an observation). |
[in] | nSize | is the number of observations. |
[in] | nFactors | is the number of exognous factors. |
[in,out] | fBetas | is the weights or loading of the exogneous factors. |
[in,out] | mean | is the mean of the differenced time series process. |
[in,out] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in,out] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in,out] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in,out] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in,out] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | retType | is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC). |
[in] | maxIter | is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. |
int __stdcall NDK_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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in,out] | fBetas | is the weights or loading of the exogneous factors. |
[in] | nFactors | is the number of exognous factors. |
[in,out] | mean | is the mean of the ARMA process. |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | pFactors | is the past exogneous factors time series data (each column is a separate factor, and each row is an observation). |
[in] | nSize | is the number of observations in X. |
[in] | nSeed | is an unsigned integer for setting up the random number generators. |
[in] | nStep | is the simulation time/horizon (expressed in terms of steps beyond end of the time series). |
[out] | retVal | is the simulated value. |
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.).
NDK_SUCCESS | operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | mean | is the model mean (i.e. mu) for the differenced series. |
[in] | sigma | is the standard deviation of the model's residuals/innovations. |
[in] | nIntegral | is the non-seasonal difference order. |
[in] | phis | are the coefficients's values of the non-seasonal AR component. |
[in] | p | is the order of the non-seasonal AR component. |
[in] | thetas | are the coefficients's values of the non-seasonal MA component. |
[in] | q | is the order of the non-seasonal MA component. |
[in] | nSIntegral | is the seasonal difference. |
[in] | nSPeriod | is the number of observations per one period (e.g. 12=Annual, 4=Quarter). |
[in] | sPhis | are the coefficients's values of the seasonal AR component. |
[in] | sP | is the order of the seasonal AR component. |
[in] | sThetas | are the coefficients's values of the seasonal MA component. |
[in] | sQ | is the order of the seasonal MA component. |
int __stdcall NDK_SCALE | ( | double * | X, |
size_t | N, | ||
double | K ) |
Returns an array of cells for the scaled time series.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the scalar/multiplier value. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | bAscending | is 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] | alpha | is the smoothing factor (alpha should be between zero and one (exclusive)). If missing or omitted, a value of 0.333 is used. |
[in] | nHorizon | is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed. |
[in] | bOptimize | is 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] | retVal | is the calculated value of this function. |
int __stdcall NDK_SHUFFLE | ( | double * | pData, |
size_t | nSize, | ||
ULONG | ulSeed ) |
Returns shuffled version of the input array.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of observations in X. |
[in] | ulSeed | is random number generator seed. |
int __stdcall NDK_Shutdown | ( | BOOL | cleanup, |
unsigned int | uClientToken ) |
Shutdown and release resources used by the SFSDK Library.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful |
Others | see SFMacros.h |
[in] | cleanup | is a flag. If true, the NDK_Shutdown() deletes all data files generated in the data directory |
[in] | uClientToken | is the token returned during the the SDK initialization |
int __stdcall NDK_SKEW | ( | double * | X, |
size_t | N, | ||
WORD | reserved, | ||
double * | retVal ) |
Calculates the sample skewness.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated sample skew value. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | X | is the sample data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | alpha | is the statistical significance level. If missing, the default of 5% is assumed. |
[in] | method | is the statistical test to perform (1=parametric). |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[out] | retVal | is the calculated test statistics. |
int __stdcall NDK_SMA_WGHTS | ( | size_t | M, |
double * | pterms, | ||
size_t * | pSize ) |
Computes Spencer weighted moving average series.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful (see SFMacros.h) |
[in] | M | is the number of terms in the filter |
[out] | pterms | is the filter's terms or weights array. |
[in,out] | pSize | is the output buffer size. |
int __stdcall NDK_SORT_ASC | ( | double * | X, |
size_t | N ) |
Returns the sorted sample data.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
int __stdcall NDK_SSE | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
double * | retVal ) |
Calculates the sum of the squared errors of the prediction function.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the original (eventual outcomes) time series sample data (a one dimensional array). |
[in] | Y | is the forecasted time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[out] | retVal | is the calculated sum of squared errors. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | X | is the sample data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | target | is the assumed standard deviation value. If missing, a default of one is assumed |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | method | is the statistical test to perform (1=parametric). |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[out] | retVal | is the calculated test statistics. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in,out] | X | is the univariate time series data (a one dimensional array). |
[in] | N1 | is the number of observations in X. |
[in] | Y | is the second univariate time series data (a one dimensional array). |
[in] | N2 | is the number of observations in Y. |
int __stdcall NDK_TDIST_XKURT | ( | double | df, |
double * | retVal ) |
Calculates the excess kurtosis of the student's t-distribution.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | df | is the degrees of freedom of the student's t-distribution (v > 4). |
[out] | retVal | is the computed value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | alpha | is the data smoothing factor (alpha should be between zero and one (exclusive)). |
[in] | beta | is the trend smoothing factor (beta should be between zero and one (exclusive)). |
[in] | gamma | is the seasonal change smoothing factor (Gamma should be between zero and one (exclusive)). |
[in] | L | is the season length. |
[in] | nHorizon | is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed. |
[in] | bOptimize | is 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] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | Operation successful |
Error | code |
[in] | szTxt | is the input string to match for. |
[in] | szDelim | is the character to use for splitting the string. If missing, comma (,) is used. |
[in] | nOrder | is the order of the token to return, where first = 1, second = 2,..., and last = -1. |
[out] | pRetVal | is the n-th token/substring in a string |
[in,out] | pSize | is the number of characters in pRetVal buffer, and returns number of characters copied to pRetVal. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | nTrendType | is the model description flag for the trend function:
|
[in] | argPolyOrder | is the polynomial order. This is only relevant for a polynomial trend type and is ignored for all others. If missing, POrder = 1. |
[in] | AllowIntercep | is a switch to include or exclude an intercept in the regression. |
[in] | InterceptVal | is 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] | nHorizon | is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed. |
[in] | retType | is a switch to select the return output:
|
[in] | argAlpha | is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed. |
[out] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | mean | is the mean of the student's t-distribution. |
[in] | sigma | is the standard deviation of the student's t-distribution. |
[in] | df | is the degrees of freedom (nu) of the student's t-distribution. |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | upper | is a switch to select the limit (upper/lower). |
[out] | retVal | is the computed value. |
int __stdcall NDK_VARIANCE | ( | double * | X, |
size_t | N, | ||
WORD | reserved, | ||
double * | retVal ) |
Calculates the sample variance.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated variance value. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | pData | is the univariate time series data (a one dimensional array). |
[in] | nSize | is the number of elements in pData. |
[in] | bAscending | is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). |
[in] | weights | is the size of the equal-weighted window or an array of multiplying factors (i.e. weights) of the moving/rolling window. |
[in] | nwSize | is the number of elements in the weights array. |
[in] | nHorizon | is the forecast time/horizon beyond the end of X. If missing, a default value of 0 (Latest or end of X) is assumed. |
[out] | retVal | is the calculated value of the weighted moving average. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | method | is the statistical test to perform (1=Ljung-Box). |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[out] | retVal | is the calculated test statistics. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | nLen | is the number of observations in X |
[in] | monthly | is a boolean flag for whether the data is monthly/quartelry sampled. |
[in] | startDate | is the serial date number of the 1st observation in the series |
[in] | reserved | is a reserved argument for future releases. must be set to 1 |
[in,out] | ulDataHash | (optional) is CRC hash of the data file (tab delimated). |
int __stdcall NDK_X12_ENV_CLEANUP | ( | void | ) |
Finalize the X12A environment and release any resources allocated.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X12_ENV_INIT | ( | BOOL | override | ) |
Initialize the filesystem environment on the local machine for the current user.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | override | is a boolean flag to wipe our existing files and copy new ones. |
int __stdcall NDK_X12_FORE_SERIES | ( | LPCTSTR | szScenarioName, |
size_t | nStep, | ||
WORD | retType, | ||
double * | pData ) |
Read the output forecaste series generated by x12a program.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szScenarioName | is the given X12-ARIMA scenario/model identifier |
[in] | nStep | is the forecast horizon |
[in] | retType | is the switch to designate desired output
|
[out] | pData | is the forecast output value |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szScenarioName | is the scenaio.model name |
[in] | retType | is a switch to designate the desired specific output file. 0. The X12 specification file (*.spc)
|
[out] | szOutFile | is a buffer to hold the return full path |
[in,out] | nLen | is the length of the szOutFile. Upon return, this argument stores the actual number of bytes used. |
[in] | OpenFileFlag | is a switch to instruct the functiona whether it should open the file using system default editor (e.g. notepad) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szScenarioName | is the given scenario/model |
[in] | nComponent | is the desired output of the X12a output
|
[out] | pData | is the output buffer to hold the data series |
[in,out] | nLen | is the original size of the output buffer. Upon return, nLen will have the actual number of data copied. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[out] | pData | is the univariate time series data (a one dimensional array). |
[in] | nLen | is the number of observations in pData |
[in] | fileType | is a reserved argument for future releases. must be set to 1 |
[out] | ulDataHash | (optional) is CRC hash of the data file (tab delimated). |
int __stdcall NDK_X12_RUN_BATCH | ( | LPCTSTR | szScenarioName, |
LPCTSTR | szBatchFile, | ||
LPWORD | status ) |
Run a batch file in x12a environment.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X12_RUN_SCENARIO | ( | LPCTSTR | szScenarioName, |
LPWORD | status ) |
Run a x12a program for the given model or scenrio.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X12_RUN_STAT | ( | LPCTSTR | szScenarioName, |
LPWORD | status, | ||
LPTSTR | szMsg, | ||
size_t * | nLen ) |
Read the status file generated by x12a program.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X12_SCEN_CLEAUP | ( | LPCTSTR | szScenarioName | ) |
Finalize the given scenario/model and free allocated resources.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
int __stdcall NDK_X12_SCEN_INIT | ( | LPCTSTR | szScenarioName, |
LPVOID | X12Options, | ||
size_t * | ulModelHash ) |
Initialize the required files for the given scenario/model.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szScenarioName | is 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 |
int __stdcall NDK_X12_SCEN_READ | ( | LPCTSTR | szScenarioName, |
LPVOID | X12Options, | ||
size_t * | ulModelHash ) |
Read the model configuration file.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (e.g., scenario not found) |
[in] | szScenarioName | is the scenario name, must be unique |
[out] | X12Options | is an instance of X12ARIMA_OPTIONS structure with all X12 model options. |
[out] | ulModelHash | (optional) is CRC hash of the model option file (ini 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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szScenarioName | is 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 |
int __stdcall NDK_X13AS_ADD_OUTPUT_SERIES | ( | LPCTSTR | szScenarioName, |
LPCTSTR | szComponent ) |
Add an output component to the spc file.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X13AS_DATEVALE_TO_DATE | ( | LPCTSTR | szDateTxt, |
WORD | freq, | ||
LONG * | serialDate ) |
Covert X13AS datevalue (Year.month/quarter) into date serial number.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X13AS_ENV_CLEANUP | ( | void | ) |
Finalize the X13AS environment and release any resources allocated.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X13AS_FORE_SERIES | ( | LPCTSTR | szScenarioName, |
WORD | freq, | ||
LONG | dateSerial, | ||
WORD | retType, | ||
double * | pData ) |
Parse the forecast output file.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szDataFileName | is the basefilename of the datafile in the scenario folder |
[in] | freq | is the sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual). |
[out] | pData | is the univariate time series data (a one dimensional array). |
[in,out] | pLen | is the number of observations in X, and original the size of the elements in pData |
[out] | startDate | is the serial date number of the 1st observation in the series |
[in] | fileType | is a reserved argument for future releases. must be set to 1 |
[out] | ulDataHash | (optional) is CRC hash of the data file (tab delimated). |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szOutputFile | is the base filename (and extension) of the output data file in the scenario folder |
[in] | pXData | is the independent (explanatory) variables data matrix, such that each column represents one variable. |
[in] | nXSize | is the number of observations (rows) in X |
[in] | nXVars | is the number of independent (explanatory) variables (columns) in X. |
[in] | mask | is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the "mask." |
[out] | startDate | is the serial date number of the 1st observation in the series |
[in] | freq | is the data sampling frequency (per year) |
[in] | reserved | is a reserved argument for future releases. must be set to 1 |
[in,out] | ulDataHash | (optional) is CRC hash of the data file (tab delimated). |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X13AS_SCEN_CLEAUP | ( | LPCTSTR | szScenarioName | ) |
Finalize the given scenario/model and free allocated resources.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
int __stdcall NDK_X13AS_SCEN_ERROR_STATUS | ( | LPCTSTR | szScenarioName, |
LPTSTR | szStatus, | ||
size_t * | nLen ) |
Parse the error file in a given scenario for errors.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X13AS_SCEN_INIT | ( | LPCTSTR | szScenarioName, |
LPCTSTR | X13Options, | ||
size_t * | ulModelHash ) |
Initialize the required files for the given scenario/model.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szScenarioName | is 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 |
int __stdcall NDK_X13AS_SCEN_PATH | ( | LPCTSTR | szScenarioName, |
LPTSTR | szOutBuffer, | ||
size_t * | pLen ) |
Returns the filesystem path for the scenario's different files.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
int __stdcall NDK_X13AS_SCEN_REFRESH | ( | LPCTSTR | szScenarioName | ) |
reconstruct the different (input/intermediate/output) files
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | X | is the univariate time series data (a one dimensional array). |
[in] | nLen | is the number of observations in X |
[in] | freq | is the sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual). |
[in] | startDate | is the serial date number of the 1st observation in the series |
[in] | reserved | is a reserved argument for future releases. must be set to 1 |
[in,out] | ulDataHash | (optional) is CRC hash of the data file (tab delimated). |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
[in] | szOutputFile | is the base filename (and extension) of the output data file in the scenario folder |
[in] | pXData | is the independent (explanatory) variables data matrix, such that each column represents one variable. |
[in] | nXSize | is the number of observations (rows) in X |
[in] | nXVars | is the number of independent (explanatory) variables (columns) in X. |
[in] | mask | is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. |
[in] | nMaskLen | is the number of elements in the "mask." |
[in] | freq | is the sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual). |
[in] | startDate | is the serial date number of the 1st observation in the series |
[in] | reserved | is a reserved argument for future releases. must be set to 1 |
[in,out] | ulDataHash | (optional) is CRC hash of the data file (tab delimated). |
int __stdcall NDK_X13AS_WRITE_SPC_FILE | ( | LPCTSTR | szSPCFilename, |
LPCTSTR | szOptions, | ||
size_t * | ulModelHash ) |
Write an SPC file from a JSON formatted string.
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful (see SFMacros.h) |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation unsuccessful. See SFMacros.h for more details. |
[in] | X | is the first univariate time series data (a one dimensional array). |
[in] | Y | is the second univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | K | is 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] | method | is the algorithm to use for calculating the correlation (see CORRELATION_METHOD) |
[in] | retType | is a switch to select the return output (1 = correlation value(default), 2 = std error). |
[out] | retVal | is the calculated value of this function. |
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.
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | X | is the first univariate time series data (a one dimensional array). |
[in] | Y | is the second univariate time series data (a one dimensional array). |
[in] | N | is the number of observations in X (or Y). |
[in] | K | is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). |
[in] | target | is the assumed correlation value. If missing, a default of zero is assumed. |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | method | is the desired correlation coefficient (1=Pearson (default), 2=Spearman, 3=Kendall). If missing, a Pearson coefficient is assumed. |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[out] | retVal | is the calculated test statistics. |
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.
[in] | X | is the input data sample (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | reserved | This parameter is reserved and must be 1. |
[out] | retVal | is the calculated sample excess-kurtosis value. |
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).
NDK_SUCCESS | Operation successful |
NDK_FAILED | Operation is unsuccessful. see SFMacros.h |
[in] | X | is the sample data (a one dimensional array). |
[in] | N | is the number of observations in X. |
[in] | alpha | is the statistical significance level. If missing, a default of 5% is assumed. |
[in] | method | is the statistical test to perform (1=parametric). |
[in] | retType | is a switch to select the return output: (TEST_RETURN)
|
[out] | retVal | is the calculated test statistics. |