Statistics and time-series analytics API
Multiple Linear Regression (MLR)

Multiple Linear Regression (MLR) More...

Functions

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)
 Calculates the OLS regression coefficient values.
 
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)
 Calculates the forecast value, error, and confidence interval for a regression model.
 
int __stdcall NDK_SLR_FITTED (double *pXData, size_t nXSize, double *pYData, size_t nYSize, double intercept, WORD nRetType)
 Returns an array of cells for the conditional mean (or residuals) fitted values.
 
int __stdcall NDK_SLR_ANOVA (double *pXData, size_t nXSize, double *pYData, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 Calculates the regression model analysis of the variance (ANOVA) values.
 
int __stdcall NDK_SLR_GOF (double *pXData, size_t nXSize, double *pYData, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 Calculates a measure for the goodness of fit (e.g., LLF, R^2, etc.).
 
int __stdcall NDK_MLR_PARAM (double **pXData, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *pYData, size_t nYSize, double intercept, double alpha, WORD nRetType, WORD ParamIndex, double *retVal)
 Calculates the OLS regression coefficient values.
 
int __stdcall NDK_MLR_FORE (double **pXData, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *pYData, size_t nYSize, double intercept, double *target, double alpha, WORD nRetType, double *retVal)
 Calculates the forecast mean, error, and confidence interval.
 
int __stdcall NDK_MLR_FITTED (double **pXData, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *pYData, size_t nYSize, double intercept, WORD nRetType)
 Returns an array of cells for the fitted values of the conditional mean, residuals, or leverage measures.
 
int __stdcall NDK_MLR_ANOVA (double **pXData, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *pYData, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 Calculates the regression model analysis of variance (ANOVA) values.
 
int __stdcall NDK_MLR_GOF (double **pXData, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *pYData, size_t nYSize, double intercept, WORD nRetType, double *retVal)
 Calculates a measure for the goodness of fit (e.g., LLF, AIC, R^2, etc.).
 
int __stdcall NDK_MLR_PRFTest (double **pXData, size_t nXSize, size_t nXVars, double *pYData, 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).
 
int __stdcall NDK_MLR_STEPWISE (double **pXData, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double *pYData, size_t nYSize, double intercept, double alpha, WORD nMode)
 Returns a list of the selected variables after performing the stepwise regression.
 

Detailed Description

Given a data set \(\{y_i,\, x_{i1}, \ldots, x_{ip}\}_{i=1}^n\) of n statistical units, a linear regression model assumes that the relationship between the dependent variable yi and the p-vector of regressors xi is linear. This relationship is modeled through a disturbance term or error variable εi — an unobserved random variable that adds noise to the linear relationship between the dependent and regressors.

Function Documentation

◆ NDK_MLR_ANOVA()

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

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

Parameters
[in]pXData(Required) is the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSize(Required) is the number of observations in pXData.
[in]nXVars(Required) is the number of independent (explanatory) variables (columns) in pXData.
[in]mask(Required) is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLen(Required) is the number of elements in the mask.
[in,out]pYData(Required) is the response or the dependent variable data array (one dimensional array of cells).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) 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 typically.
[in]nRetType(Required) is a switch to select the output (1 = SSR (default), 2 = SSE, 3 = SST, 4 = MSR, 5 = MSE, 6 = F-Stat, 7 = Significance F).
Value Return
1 SSR (sum of squares of the regression)
2 SSE (sum of squares of the residuals)
3 SST (sum of squares of the dependent variable)
4 MSR (mean squares of the regression)
5 MSE (mean squares error or residuals)
6 F-Stat (test score)
7 Significance F (P-value of the test)
[out]retVal(Required) is a pointer to a variable to hold the calculated ANOVA statistics.
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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_MLR_FITTED()

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

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

Parameters
[in]pXData(Required) is the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSize(Required) is the number of observations in pXData.
[in]nXVars(Required) is the number of independent (explanatory) variables (columns) in pXData.
[in]mask(Required) is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLen(Required) is the number of elements in the mask.
[in,out]pYData(Required) is the response or the dependent variable data array (one dimensional array of cells).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) 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 typically.
[in]nRetType(Required) is a switch to select the return output (1 = fitted values (default), 2 = residuals, 3 = std. residuals, 4 = X (cleaned), 5 = Y (cleaned)).
Value Return
1 Fitted/Conditional Mean
2 Residuals
3 Standardized (aka Studentized) Residuals
4 Leverage (H)
5 Cook's Distance (D)
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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_MLR_FORE()

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

Calculates the forecast mean, error and confidence interval.

Parameters
[in]pXData(Required) is the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSize(Required) is the number of observations in pXData.
[in]nXVars(Required) is the number of independent (explanatory) variables (columns) in pXData.
[in]mask(Required) is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLen(Required) is the number of elements in the mask.
[in]pYData(Required) is the response or the dependent variable data array (one dimensional array of cells).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) 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 typically.
[in]target(Required) is the value of the explanatory variables (a one dimensional array).
[in]alpha(Required) is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nRetType(Required) is a switch to select the return output (1 = Mean Value (default), 2 = Std Error, 3 = Test Score, 4 = P-Value, 5 = Upper Value, 6 = Lower Value).
Value Return
1 Mean Value (default)
2 Standard Error.
3 Upper Limit.
4 Lower Limit.
[out]retVal(Required) is a pointer to a variable to hold the calculated forecast statistics.
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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_MLR_GOF()

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

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

Parameters
[in]pXData(Required) is the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSize(Required) is the number of observations in pXData.
[in]nXVars(Required) is the number of independent (explanatory) variables (columns) in pXData.
[in]mask(Required) is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLen(Required) is the number of elements in the mask.
[in]pYData(Required) is the response or the dependent variable data array (one dimensional array of cells).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) 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 typically.
[in]nRetType(Required) is a switch to select the return output (1 = R-Square (default), 2 = Adj. R-Square, 3 = RMSE, 4 = LLF, 5 = AIC, 6 = SIC/BIC)..
Value Return
1 R-Squared
2 Adjusted R-Squared
3 Regression Error
4 log-likelihood (LLF)
5 Akaike information criterion (AIC)
6 Schwartz/Bayesian information criterion (SBIC)
[out]retVal(Required) is a pointer to a variable to hold the calculated forecast statistics.
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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_MLR_PARAM()

int __stdcall NDK_MLR_PARAM ( double ** pXData,
size_t nXSize,
size_t nXVars,
LPBYTE mask,
size_t nMaskLen,
double * pYData,
size_t nYSize,
double intercept,
double alpha,
WORD nRetType,
WORD ParamIndex,
double * retVal )

Calculates the OLS regression coefficients values.

Parameters
[in]pXData(Required) is the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSize(Required) is the number of observations in pXData.
[in]nXVars(Required) is the number of independent (explanatory) variables (columns) in pXData.
[in]mask(Required) is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLen(Required) is the number of elements in the mask.
[in]pYData(Required) is the response or the dependent variable data array (one dimensional array of cells).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) 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 typically.
[in]alpha(Required) is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nRetType(Required) is a switch to select the return output (1 = Mean Value (default), 2 = Std Error, 3 = Test Score, 4 = P-Value, 5 = Upper Value, 6 = Lower Value).
Value Return
1 Mean Value (default)
2 Standard Error.
3 T-Stat.
4 P-Value.
5 Upper Limit.
6 Lower Limit.
[in]ParamIndex(Required) is a switch to designate the target parameter (0 = intercept (default), 1 = first variable, 2 = 2nd variable, etc.).
[out]retVal(Required) is a pointer to a variable to hold the calculated 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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_MLR_PRFTest()

int __stdcall NDK_MLR_PRFTest ( double ** pXData,
size_t nXSize,
size_t nXVars,
double * pYData,
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).

Parameters
[in]pXData(Required) is the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSize(Required) is the number of observations in pXData.
[in]nXVars(Required) is the number of independent (explanatory) variables (columns) in pXData.
[in]pYData(Required) is the response or the dependent variable data array (one dimensional array of cells).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) 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 typically.
[in]mask1(Required) is the boolean array to choose the explanatory variables in model 1. If missing, all variables in X are included.
[in]nMaskLen1(Required) is the number of elements in the mask1.
[in]mask2(Required) is the boolean array to choose the explanatory variables in model 2. If missing, all variables in X are included.
[in]nMaskLen2(Required) is the number of elements in the mask2.
[in]alpha(Required) is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nRetType(Required) is a switch to select the return output (1 = Mean Value (default), 2 = Std Error, 3 = Test Score, 4 = P-Value, 5 = Upper Value, 6 = Lower Value).
Value Return
1 P-value
2 Test Statistics (e.g., Z-score).
3 Critical Value.
[out]retVal(Required) is a pointer to a variable to hold the calculated test statistics.
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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_MLR_STEPWISE()

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

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

Parameters
[in]pXData(Required) is the independent (explanatory) variables data matrix, such that each column represents one variable.
[in]nXSize(Required) is the number of observations in pXData.
[in]nXVars(Required) is the number of independent (explanatory) variables (columns) in pXData.
[in,out]mask(Required) is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.
[in]nMaskLen(Required) is the number of elements in the mask.
[in]pYData(Required) is the response or the dependent variable data array (one dimensional array of cells).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) 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 typically.
[in]alpha(Required) is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nMode(Required) is a switch to select the return output (1 = Mean Value (default), 2 = Std Error, 3 = Test Score, 4 = P-Value, 5 = Upper Value, 6 = Lower Value).
Value Method
1 Forward selection
2 Backward elimination.
3 Bi-direction elimination.
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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_SLR_ANOVA()

int __stdcall NDK_SLR_ANOVA ( double * pXData,
size_t nXSize,
double * pYData,
size_t nYSize,
double intercept,
WORD nRetType,
double * retVal )

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

Parameters
[in]pXData(Required) is the independent (aka explanatory or predictor) variable data array (a one-dimensional array).
[in]nXSize(Required) is the number of observations in pXData.
[in]pYData(Required) is the response or the dependent variable data array (a one-dimensional array).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) 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 typically.
[in]nRetType(Required) is a switch to select the output (1 = SSR (default), 2 = SSE, 3 = SST, 4 = MSR, 5 = MSE, 6 = F-Stat, 7 = Significance F).
Value Return
1 SSR (sum of squares of the regression)
2 SSE (sum of squares of the residuals)
3 SST (sum of squares of the dependent variable)
4 MSR (mean squares of the regression)
5 MSE (mean squares error or residuals)
6 F-Stat (test score)
7 Significance F (P-value of the test)
[out]retVal(Required) is a pointer to a variable to hold the calculated 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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_SLR_FITTED()

int __stdcall NDK_SLR_FITTED ( double * pXData,
size_t nXSize,
double * pYData,
size_t nYSize,
double intercept,
WORD nRetType )

Returns an array of cells for the conditional mean (or residuals) fitted values.

Parameters
[in,out]pXData(Required) is the independent (aka explanatory or predictor) variable data array (a one-dimensional array).
[in]nXSize(Required) is the number of observations in pXData.
[in]pYData(Required) is the response or the dependent variable data array (a one-dimensional array).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) is the constant or the intercept value to fix (e.g., zero). If missing, an intercept will not be fixed and is computed typically.
[in]nRetType(Required) is a switch to select the return output (1 = fitted values (default), 2 = residuals, 3 = std. residuals, 4 = X (cleaned), 5 = Y (cleaned)).
Value Return
1 Fitted/Conditional Mean
2 Residuals
3 Standardized (aka Studentized) Residuals
4 Leverage (H)
5 Cook's Distance (D)
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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_SLR_FORE()

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 )

Calculates the NDK_SLR_FORE

Parameters
[in]pXData(Required) is the independent (aka explanatory or predictor) variable data array (a one-dimensional array).
[in]nXSize(Required) is the number of observations in pXData.
[in]pYData(Required) is the response or the dependent variable data array (a one-dimensional array).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) is the constant or the intercept value to fix (e.g., zero). If missing, an intercept will not be fixed and is computed typically.
[in]target(Required) is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]alpha(Required) is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nRetType(Required) is a switch to select the return output (1 = Mean Value (default), 2 = Std Error, 3 = Test Score, 4 = P-Value, 5 = Upper Value, 6 = Lower Value).
Value Return
1 Mean Value (default)
2 Standard Error.
3 Upper Limit.
4 Lower Limit.
[out]retVal(Required) is a pointer to a variable to hold the calculated 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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_SLR_GOF()

int __stdcall NDK_SLR_GOF ( double * pXData,
size_t nXSize,
double * pYData,
size_t nYSize,
double intercept,
WORD nRetType,
double * retVal )

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

Parameters
[in]pXData(Required) is the independent (aka explanatory or predictor) variable data array (a one-dimensional array).
[in]nXSize(Required) is the number of observations in pXData.
[in]pYData(Required) is the response or the dependent variable data array (a one-dimensional array).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) 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 typically.
[in]nRetType(Required) is a switch to select the return output (1 = R-Square (default), 2 = Adj. R-Square, 3 = RMSE, 4 = LLF, 5 = AIC, 6 = SIC/BIC)..
Value Return
1 R-Squared
2 Adjusted R-Squared
3 Regression Error
4 log-likelihood (LLF)
5 Akaike information criterion (AIC)
6 Schwartz/Bayesian information criterion (SBIC)
[out]retVal(Required) is a pointer to a variable to hold the calculated 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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also

◆ NDK_SLR_PARAM()

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 )

Calculates the OLS regression coefficient values.

Parameters
[in]pXData(Required) is the independent (aka explanatory or predictor) variable data array (a one-dimensional array).
[in]nXSize(Required) is the number of observations in pXData.
[in]pYData(Required) is the response or the dependent variable data array (a one-dimensional array).
[in]nYSize(Required) is the number of observations in pYData.
[in]intercept(Required) is the constant or the intercept value to fix (e.g., zero). If missing, an intercept will not be fixed and is computed typically.
[in]alpha(Required) is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
[in]nRetType(Required) is a switch to select the return output (1 = Mean Value (default), 2 = Std Error, 3 = Test Score, 4 = P-Value, 5 = Upper Value, 6 = Lower Value).
Value Return
1 Mean Value (default)
2 Standard Error.
3 T-Stat.
4 P-Value.
5 Upper Limit.
6 Lower Limit.
[in]ParamIndex(Required) is a switch to designate the target parameter (0 = Intercept (default), 1 = Explanatory Variable).
Value Parameter Index
0 Intercept
1 Explanatory Variable.
[out]retVal(Required) is a pointer to an array-typed variable to hold the calculated 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_EMPTY_TIME_SERIES(see remarks)
NDK_FAILEDfailed
Remarks
  1. The data sample may include one or more observation with missing values (i.e., NaN).
  2. If the value of the nSize is zero, the function will fail and return NDK_INVALID_ARG.
  3. If the value of the pData argument is NULL, the function will fails and return NDK_INVALID_ARG.
  4. The function moves the missing values to the end of the array, and update the nSixe argument with the number of non-missing values in the array.
Requirements
Requirement Value
Target Platform Windows
Header SFSDK.h (include Windows.h)
Library SFSDK.lib
DLL SFSDK.dll
Since
v1.68
See also