Seasonal ajustments using X-13ARIMA-SEATS functions. More...
Enumerations | |
enum | X13TRANSFORM_METHOD { X13TRANSFOR_NONE = 0 , X13TRANSFOR_AUTO = 1 , X13TRANSFOR_LOG = 2 , X13TRANSFOR_SQRT = 3 , X13TRANSFOR_INV = 4 , X13TRANSFOR_LOGIST = 5 , X13TRANSFOR_BOXCOX = 6 } |
enum | X13PRIORADJUST_TYPE { X13PRIORADJUST_RATIO = 0 , X13PRIORADJUST_PERCENT = 1 , X13PRIORADJUST_DIFF = 2 } |
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) |
The X-13ARIMA-SEATS software comes with extensive time series modeling and model selection capabilities for linear regression models with ARIMA errors (regARIMA models).
enum X13PRIORADJUST_TYPE |
enum X13TRANSFORM_METHOD |
X13 transformation methods
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | szComponent | is the name of the component to read |
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 ( ) |
[in] | pData | is the input time series |
[in] | nLen | is the number of observations in pData |
[in] | nForecastPeriods | is the requested number of forecast perios |
[out] | startIndex | is the calculated new start index |
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 ( ) |
[in] | serialDate | is the serial date number we wish to convert |
[in] | freq | is thge frequency of the dataset (12=monthly) |
[out] | szDateTxt | the date expressed in DATEVALUE format |
nLen | [in,out] is the size of the buufer to hold the DATEVALUE |
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 ( ) |
[in] | szDateTxt | the date expressed in DATEVALUE format |
[in] | freq | is thge frequency of the dataset (12=monthly) |
[out] | serialDate | is the return serial date of the DATEVALUE |
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 ( ) |
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | freq | is thge frequency of the dataset (12=monthly) |
[in] | dateSerial | the target serial date |
[in] | retType | is the type of output |
[out] | pData | is the returned value |
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | szkey | is the key name (in a tree structure) |
[out] | szOutBuffer | the buffereto hold the value in, |
pLen | [in,out] the initial size of the szOutBuffer |
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | szPropert | is the property name (in a tree structure) |
[out] | szOutBuffer | the buffereto hold the value in, |
pLen | [in,out] the initial size of the szOutBuffer |
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | retType | type of output time series |
[out] | szOutFile | is the output buffer |
nLen | [in,out] is the initial size of pData | |
[in] | OpenFileFlag | is the openFile flag |
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | szComponent | is the name of the component |
[in] | freq | is thge frequency of the dataset (12=monthly) |
[out] | pData | is the output buffer |
nLen | [in,out] is the initial size of pData | |
[out] | startDate | is the serial date of the 1st obs. in pData |
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[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). |
pLen | [inout] 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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[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 |
ulDataHash | [inout] (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 ( ) |
[in] | szSPCFilename | is the scenario name or the model unique identifier |
[out] | szOptions | is the SPC value |
nLen | [in,out] is the size of output buffer | |
ulModelHash | [in,out] is the calculated hash of the spc file. |
int __stdcall NDK_X13AS_RUN_SPC_FILE | ( | LPCTSTR | szScenarioName, |
BOOL | bValidateOnly ) |
Invoke the x13as_ascii.exe file to process the spc file in a given scenario
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | bValidateOnly | is a switch to run X13 in verify mode or full-scale. |
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 ( ) |
[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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[out] | szStatus | is the runtime status |
nLen | [in,out] is the size of the buffer |
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 ( ) |
[in] | szScenarioName | is the scenario name, must be unique |
[in] | X13Options | is Json data structure with all X13 model options. |
ulModelHash | [inout] (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 ( ) |
[in] | szScenarioName | is the scenario name, must be unique |
[out] | szOutBuffer | is the output buffer to write the spec file to |
pLen | [in,out] is the size of the buffer (i.e., szOutBuffer ) |
int __stdcall NDK_X13AS_SCEN_REFRESH | ( | LPCTSTR | szScenarioName | ) |
reconstruct the different (input/intermediate/output) files
NDK_SUCCESS | Operation successful |
NDK_FAILED | operation is unsuccessful ( ) |
[in] | szScenarioName | is the scenario name, must be unique |
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 ( ) |
[in] | szScenarioName | is the scenario name, must be unique |
[out] | szOutBuffer | is the output buffer to write the spec file to |
pLen | [in,out] is the size of the bugger (i.e., szOutBuffer ) |
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | szkey | is the key name (in a tree structure) |
[in] | szValue | is the new value to associate the key with |
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | szPropert | is the property name (in a tree structure) |
[in] | szOutBuffer | is the new value to associate the property |
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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[in] | szOutputFile | is the name of the filename to write the data to |
[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 |
ulDataHash | [inout] (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 ( ) |
[in] | szScenarioName | is the scenario name or the model unique identifier |
[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 |
ulDataHash | [inout] (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 ( ) |
[in] | szSPCFilename | is the scenario name or the model unique identifier |
[in] | szOptions | is the SPC text |
ulModelHash | [in,out] is the calculated hash |