Statistics and time-series analytics API
X-13ARIMA-SEATS Model

X13-ARIMA-SEATS model and seasonal adjustment. 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)
 Finalize the X13AS environment and release any resources allocated.
 
int __stdcall NDK_X13AS_SCEN_INIT (LPCTSTR szScenarioName, LPCTSTR X13Options, size_t *ulModelHash)
 Initialize the required files for the given scenario/model.
 
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.
 
int __stdcall NDK_X13AS_SCEN_PATH (LPCTSTR szScenarioName, LPTSTR szOutBuffer, size_t *pLen)
 Returns the filesystem path for the scenario's different files.
 
int __stdcall NDK_X13AS_SCEN_REFRESH (LPCTSTR szScenarioName)
 Reconstruct the different (input/intermediate/output) files.
 
int __stdcall NDK_X13AS_SCEN_CLEAUP (LPCTSTR szScenarioName)
 Finalize the given scenario/model and free allocated resources.
 
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.
 
int __stdcall NDK_X13AS_WRITE_DATA_FILE (LPCTSTR szScenarioName, LPCTSTR szOutputFileName, double *pData, size_t nLen, WORD freq, LONG startDate, WORD fileType, size_t *ulDataHash)
 Write the given data into an X13as formatted data file.
 
int __stdcall NDK_X13AS_WRITE_FACTORS_FILE (LPCTSTR szScenarioName, LPCTSTR szOutputFile, double **pData, size_t nLen, 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.
 
int __stdcall NDK_X13AS_READ_DATA_FILE (LPCTSTR szScenarioName, LPCTSTR szDataFileName, WORD freq, double *pData, size_t *nLen, LONG *startDate, WORD fileType, size_t *ulDataHash)
 Read the scenario data file into the given data into an X12a formatted data file.
 
int __stdcall NDK_X13AS_READ_FACTORS_FILE (LPCTSTR szScenarioName, LPCTSTR szInputFile, double **pData, size_t nLen, 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.
 
int __stdcall NDK_X13AS_WRITE_SPC_FILE (LPCTSTR szSPCFilename, LPCTSTR szOptions, size_t *ulModelHash)
 Write an SPC file from a JSON formatted string.
 
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.
 
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.
 
int __stdcall NDK_X13AS_SCEN_ERROR_STATUS (LPCTSTR szScenarioName, LPTSTR szStatus, size_t *nLen)
 Parse the error file in a given scenario for errors.
 
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.
 
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.
 
int __stdcall NDK_X13AS_FORE_SERIES (LPCTSTR szScenarioName, WORD freq, LONG dateSerial, WORD retType, double *pData)
 Parse the forecast output file.
 
int __stdcall NDK_X13AS_ADD_OUTPUT_SERIES (LPCTSTR szScenarioName, LPCTSTR szComponent)
 Add an output component to the spc file.
 
int __stdcall NDK_X13AS_GET_PROP (LPCTSTR szScenarioName, LPCTSTR szProperty, LPTSTR szOutBuffer, size_t *pLen)
 Return the model's option (given by a path: section.key).
 
int __stdcall NDK_X13AS_SET_PROP (LPCTSTR szScenarioName, LPCTSTR szProperty, LPCTSTR argValue)
 Set (or reset) the value of a model's option (by path: section.key).
 
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).
 
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).
 
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).
 
int __stdcall NDK_X13AS_DATEVALE_TO_DATE (LPCTSTR szDateTxt, WORD freq, LONG *serialDate)
 Covert X13AS datevalue (Year.month/quarter) into date serial number.
 

Detailed Description

Seasonal adjustment is a statistical method for removing the seasonal component of a time series when analyzing non-seasonal trends. It is normal to report seasonally adjusted data for unemployment rates to reveal the underlying trends in labor markets.

Many economic phenomena have seasonal cycles, such as agricultural production and consumer consumption (e.g., greater consumption leading up to Christmas). It is necessary to adjust for this component to understand what underlying trends are in the economy; thus, official statistics are often adjusted to remove seasonal components.

NumXL supports the X-13ARIMA-SEATS method. X-13ARIMA-SEATS is the software produced, distributed, and maintained by the United States Census Bureau.

Behind the scenes, NumXL translates the user’s options into native X-13ARIMA-SEATS scripts, runs the program, and avails the outputs (e.g., seasonally adjusted trend, seasonal factor, irregulars, forecast) through a set of worksheet functions. Nevertheless, the user can view/access the generated input and output files using the NumXL wizard.

regARIMA Model
The X-12-ARIMA software comes with extensive time series modeling and model selection capabilities for linear regression models with ARIMA errors (regARIMA models).

The ARIMA models, as discussed by Box and Jenkins (1976), are frequently used for seasonal time series. A general multiplicative seasonal ARIMA model for a time series \(z_t \) can be written:

\[\phi(L)\Phi(L^s)(1-L)^d (1-L^s)^D\times z_t = \theta(L)\Theta(L^s)a_t \]

Where:

Remarks
  1. The time series is homogeneous or equally spaced.
  2. The time series may include missing values (e.g. NaN) at either end.
  3. It is common to replace \(z_t\) by deviations from the mean:

    \[z_t-\mu\]

    Where:

    \[\mu=E[z_t] \]

  4. \((1-L)^d(1-L^s)^D\) operator yields a stationary time series.

A natural extension for the ARIMA model results from using a time-varying mean function modeled via linear regression effects.

\[ y_t=\sum_{i=1}^N{\beta_i x_{i,t}}+z_t \]

Where:

Related Links
References

Enumeration Type Documentation

◆ X13PRIORADJUST_TYPE

X13 prior-adjustment methods

See also
Enumerator
X13PRIORADJUST_RATIO 

Ratio.

X13PRIORADJUST_PERCENT 

Percent.

X13PRIORADJUST_DIFF 

Difference.

◆ X13TRANSFORM_METHOD

X13 transformation methods

See also
Enumerator
X13TRANSFOR_NONE 

don't process the input data

X13TRANSFOR_AUTO 

auto-transform

X13TRANSFOR_LOG 

Log transform.

X13TRANSFOR_SQRT 

Square root transform.

X13TRANSFOR_INV 

Inverse.

X13TRANSFOR_LOGIST 

Logist Transform.

X13TRANSFOR_BOXCOX 

BoxCox Transform.

Function Documentation

◆ NDK_X13AS_ADD_OUTPUT_SERIES()

int __stdcall NDK_X13AS_ADD_OUTPUT_SERIES ( LPCTSTR szScenarioName,
LPCTSTR szComponent )

Add an output component to the spc file.

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szComponent(Required) the desired output of the X13 output:
Value Output Type Seasonal Adjustment Method
d11 Final seasonal factors (d11) X11
d12 Final trend-cycle (d12) X11
d13 Final irregular component (d13) X11
d10 Final seasonal factors (d10) X11
s11 Final seasonal factors (s11) SEATS
s12 Final trend-cycle (s12) SEATS
s13 Final irregular component (s13) SEATS
s10 Final seasonal factors (s10) SEATS
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_DATA_STARTOFFSET()

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

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

Parameters
[in]pData(Required) A univariate time series data (a one dimensional array).
[in]nLen(Required) the number of observations in pData.
[in]nForecastPeriods(Required) The requested number of forecast periods.
[out]startIndex(Required) A pointer to a variable that holds the calculated new start index.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_DATE_TO_DATEVALUE()

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

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

Parameters
[in]serialDate(Required) The serial date number we wish to convert.
[in]freq(Required) The sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[out]szDateTxt(Required) A pointer to a buffer to hold the calculated value.
[in,out]nLen(Required) A pointer to a variable that holds the size of the szDateTxt. Upon return, this argument stores the actual number of characters copied.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_DATEVALE_TO_DATE()

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

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

Parameters
[in]szDateTxt(Required) the date expressed in DATEVALUE format.
[in]freq(Required) The sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[out]serialDate(Required) A pointer to a variable to hold the calculated serial date value.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_ENV_CLEANUP()

int __stdcall NDK_X13AS_ENV_CLEANUP ( void )

Finalize the X13AS environment and release any resources allocated

Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_FORE_SERIES()

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

Parse the forecast output file

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]freq(Required) The sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[in]dateSerial(Required) the serial date number of target date.
[in]retType(Required) the desired output of the X12a output:
Value Output Type
1 Mean
2 Lower limit value of the conficent interval
3 Upper limit value of the confidence interval
[out]pData(Required) A pointer to a variable to hold the output value.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_GET_METADATA()

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

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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szkey(Required) the key name (in a tree structure).
[out]szOutBuffer(Required) A pointer to a buffer to hold the value of the meta data.
[in,out]pLen(Required) A pointer to a variable that holds the size of the szOutBuffer. Upon return, this argument stores the actual number of elements copied/used.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_GET_PROP()

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

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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szProperty(Required) the property name (in a tree structure).
[out]szOutBuffer(Required) A pointer to a buffer to hold the output time series data (a one dimensional array).
[in,out]pLen(Required) A pointer to a variable that holds the size of the szOutBuffer. Upon return, this argument stores the actual number of elements copied/used.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_OUT_FILE()

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

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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]retType(Required) A pointer to a variable that holds the status after running the batch file.
Value Output Type
0 The X13 specification file (.spc)
1 The X13 log file (.log)
2 The output file (.out)
3 The error file (.err)
[out]szOutFile(Required) A pointer to a buffer to hold the file full path.
[in,out]nLen(Required) A pointer to a variable that holds the length of the szOutFile. Upon return, this argument stores the actual number of characters used.
[in]OpenFileFlag(Required) a switch to instruct the functiona whether it should open the file using system default editor (e.g.,notepad)
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_OUT_SERIES()

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

Parse the output file of a given component.

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szComponent(Required) the desired output of the X12a output:
Value Output Type Seasonal Adjustment Method
d11 Final seasonal factors (d11) X11
d12 Final trend-cycle (d12) X11
d13 Final irregular component (d13) X11
d10 Final seasonal factors (d10) X11
s11 Final seasonal factors (s11) SEATS
s12 Final trend-cycle (s12) SEATS
s13 Final irregular component (s13) SEATS
s10 Final seasonal factors (s10) SEATS
[in]freq(Required) The sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[out]pData(Required) A pointer to a buffer to hold the output time series data (a one dimensional array).
[in,out]nLen(Required) A pointer to a variable that holds the size of the pData. Upon return, this argument stores the actual number of elements copied/used.
[out]startDate(Required) the serial date number of the 1st observation in the series.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_READ_DATA_FILE()

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

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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szDataFileName(Required) The basefilename of the datafile in the scenario folder.
[in]freq(Required) The sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[in]pData(Required) the univariate time series data (a one dimensional array).
[in]nLen(Required) A pointer to a variable that holds size of buffer referenced by pData. Upon return, the variable will holds the number of elements copied.
[in]startDate(Required) the serial date number of the 1st observation in the series.
[in]fileType(Required) A reserved argument for future releases. must be set to 1
[out]ulDataHash(Optional) A pointer to a variable that holds the current CRC hash of the data file (tab delimated).
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_READ_FACTORS_FILE()

int __stdcall NDK_X13AS_READ_FACTORS_FILE ( LPCTSTR szScenarioName,
LPCTSTR szInputFile,
double ** pData,
size_t nLen,
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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szInputFile(Required) the base filename (and extension) of the output data file in the scenario folder.
[out]pData(Required) the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nLen(Required) the number of observations (rows) in pData.
[in]nXVars(Required) Tthe number of independent (explanatory) variables (columns) in pData.
[in]mask(Required) A boolean array to choose the explanatory variables in the model. If missing, all variables in pData are included.
[in]nMaskLen(Required) the number of elements in the mask.
[out]startdate(Required) the serial date number of the 1st observation in the series.
[in]freq(Required) The sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[in]reserved(Required) A reserved argument for future releases. must be set to 1
[in,out]ulDataHash(Optional) A pointer to a variable that holds the current CRC hash of the data file (tab delimated).
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_READ_SPC_FILE()

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

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

Parameters
[in]szSPCFilename(Required) A full path of an X13AS specification (.spc) file.
[out]szOptions(Required) A Json data structure with all X13 model options.
[in,out]nLen(Required) A pointer to a variable that holds size of buffer referenced by szOptions. Upon return, the variable will holds the number of characters copied.
[in,out]ulModelHash(Required) A pointer to a variable that holds the current CRC hash of the models's spc file.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_RUN_SPC_FILE()

int __stdcall NDK_X13AS_RUN_SPC_FILE ( LPCTSTR szScenarioName,
BOOL bValidateOnly )

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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]bValidateOnly(Required) A switch to run X13 program in verify-mode or full-scale.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_SCEN_CLEAUP()

int __stdcall NDK_X13AS_SCEN_CLEAUP ( LPCTSTR szScenarioName)

Finalize the given scenario/model and free allocated resources.

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_SCEN_ERROR_STATUS()

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

Parse the error file in a given scenario for errors.

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[out]szStatus(Required) A pointer to a buffer that will hold the status message.
[in,out]nLen(Required) A pointer to a variable that holds the size of buffer in szMsg. Upon return, the variable will holds the number of characters copied to szMsg.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_SCEN_INIT()

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

Initialize the required files for the given scenario/model

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]X13Options(Required) A Json data structure with all X13 model options.
[in,out]ulModelHash(Required) A pointer to a variable that holds the current CRC hash of the models's spc file.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_SCEN_PATH()

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

Returns the filesystem path for the scenario's different files

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szOutBuffer(Required) A pointer to a buffer to hold the path of the spc file.
[in,out]pLen(Required) A pointer to a variable that holds size of buffer referenced by szOutBuffer. Upon return, the variable will holds the number of characters copied.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_SCEN_REFRESH()

int __stdcall NDK_X13AS_SCEN_REFRESH ( LPCTSTR szScenarioName)

reconstruct the different (input/intermediate/output) files.

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_SCEN_SPEC()

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

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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szOutBuffer(Required) A pointer to a buffer to hold the JSON data structure of the spc file.
[in,out]pLen(Required) A pointer to a variable that holds size of buffer referenced by szOutBuffer.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_SET_METADATA()

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

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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szkey(Required) the key name (in a tree structure).
[out]szValue(Required) the new value to associate the key with.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_SET_PROP()

int __stdcall NDK_X13AS_SET_PROP ( LPCTSTR szScenarioName,
LPCTSTR szProperty,
LPCTSTR argValue )

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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szProperty(Required) the property name (in a tree structure).
[in]argValue(Required) the new value to associate with the property.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_WRITE_DATA_FILE()

int __stdcall NDK_X13AS_WRITE_DATA_FILE ( LPCTSTR szScenarioName,
LPCTSTR szOutputFileName,
double * pData,
size_t nLen,
WORD freq,
LONG startDate,
WORD fileType,
size_t * ulDataHash )

Write the given data into an X13as formatted data file.

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szOutputFileName(Required) The filename to write the data to.
[in]pData(Required) A univariate time series data (a one dimensional array).
[in]nLen(Required) The number of observations in pData.
[in]freq(Required) The sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[in]startDate(Required) the serial date number of the 1st observation in the series.
[in]fileType(Required) A reserved argument for future releases. must be set to 1
[out]ulDataHash(Optional) A pointer to a variable that holds the current CRC hash of the data file (tab delimated).
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_WRITE_FACTORS_FILE()

int __stdcall NDK_X13AS_WRITE_FACTORS_FILE ( LPCTSTR szScenarioName,
LPCTSTR szOutputFile,
double ** pData,
size_t nLen,
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

Parameters
[in]szScenarioName(Required) The scenario name or the model unique identifier.
[in]szOutputFile(Required) The filename to write the data to.
[in]pData(Required) the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nLen(Required) the number of observations (rows) in pData.
[in]nXVars(Required) Tthe number of independent (explanatory) variables (columns) in pData.
[in]mask(Required) A boolean array to choose the explanatory variables in the model. If missing, all variables in pData are included.
[in]nMaskLen(Required) the number of elements in the mask.
[in]freq(Required) The sampling frequency per year (12=monthly, 4=Quarterly, 2=semi-annual, and 1=annual).
[in]startDate(Required) the serial date number of the 1st observation in the series.
[in]reserved(Required) A reserved argument for future releases. must be set to 1
[in,out]ulDataHash(Optional) A pointer to a variable that holds the current CRC hash of the data file (tab delimated).
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also

◆ NDK_X13AS_WRITE_SPC_FILE()

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

Write an SPC file from a JSON formatted string

Parameters
[in]szSPCFilename(Required) A full path of an X13AS specification (.spc) file.
[in]szOptions(Required) A Json data structure with all X13 model options.
[in,out]ulModelHash(Required) A pointer to a variable that holds the current CRC hash of the models's spc file.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LOW_LICENSE_ARG_LIMITfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The underlying model is described here.
  2. This function removes temporary files and folders used by the X12 models during its runtime.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
SFLUC.dll
SFLOG.dll
Since
v1.67
See also