Principal Component Analysis (PCA) More...
Functions | |
int __stdcall | NDK_PCA_COMP (double **pXData, size_t nXSize, size_t nXVars, LPBYTE varMask, size_t nMaskLen, WORD standardize, WORD nCompIndex, WORD retType, double *retVal, size_t nOutSize) |
Returns statistics and fitted values for the i-th principal component. | |
int __stdcall | NDK_PCA_VAR (double **pXData, size_t nXSize, size_t nXVars, LPBYTE varMask, size_t nMaskLen, WORD standardize, WORD nVarIndex, WORD wMaxPC, WORD retType, double *retVal, size_t nOutSize) |
Returns stats or fitted values for the i-th variable using a subset of the principal components. | |
int __stdcall | NDK_PCR_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 regression coefficient values for a given input variable. | |
int __stdcall | NDK_PCR_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 model's estimated values, standard errors, and related statistics. | |
int __stdcall | NDK_PCR_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 the fitted values of the conditional mean, residuals or leverage measures. | |
int __stdcall | NDK_PCR_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 (of principal components) analysis of variance (ANOVA) values. | |
int __stdcall | NDK_PCR_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 square, adjusted R square, MSRE, LLF, AIC, etc.). | |
int __stdcall | NDK_PCR_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 for PCR (used for testing the inclusion/exclusion variables). | |
int __stdcall | NDK_PCR_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. | |
Principal component analysis (PCA) is a mathematical procedure that uses an orthogonal linear transformation to convert a set of observations of possibly correlated variables into values of linearly uncorrelated variables called principal components.
int __stdcall NDK_PCA_COMP | ( | double ** | pXData, |
size_t | nXSize, | ||
size_t | nXVars, | ||
LPBYTE | varMask, | ||
size_t | nMaskLen, | ||
WORD | standardize, | ||
WORD | nCompIndex, | ||
WORD | retType, | ||
double * | retVal, | ||
size_t | nOutSize ) |
Returns statistics and fitted values for the i-th principal component.
[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] | varMask | (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 varMask . | ||||||||||||
[in] | standardize | (Required) is a flag or switch to standardize the input variables prior to the analysis:
| ||||||||||||
[in] | nCompIndex | (Required) is the component number to return. | ||||||||||||
[in] | retType | (Required) is a switch to select the return output (1 = proportion of variance (default), 2 = variance, 3 = eigenvalue, 4 = loadings, 5 = PC data).
| ||||||||||||
[out] | retVal | (Required) is a pointer to a variable to hold the calculated test statistics. | ||||||||||||
[in] | nOutSize | (Required) is the size of the retVal . |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_EMPTY_TIME_SERIES | (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.pData
argument is NULL, the function will fails and return NDK_INVALID_ARG.nSixe
argument with the number of non-missing values in the array. Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_PCA_VAR | ( | double ** | pXData, |
size_t | nXSize, | ||
size_t | nXVars, | ||
LPBYTE | varMask, | ||
size_t | nMaskLen, | ||
WORD | standardize, | ||
WORD | nVarIndex, | ||
WORD | wMaxPC, | ||
WORD | retType, | ||
double * | retVal, | ||
size_t | nOutSize ) |
Returns stats or fitted values for the i-th variable using a subset of the principal components.
[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] | varMask | (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 varMask . | ||||||||||
[in] | standardize | (Required) is a flag or switch to standardize the input variables prior to the analysis:
| ||||||||||
[in] | nVarIndex | (Required) is the input variable number. | ||||||||||
[in] | wMaxPC | (Required) is the number of principal components (PC) to include. | ||||||||||
[in] | retType | (Required) is a switch to select the return output (1 = Final communality (default), 2 = Loading/weights, 3 = Fitted values, 4 = Residuals).
| ||||||||||
[out] | retVal | (Required) is a pointer to buffer (e.g., variable or array) to hold the calculated values. | ||||||||||
[in] | nOutSize | (Required) is the size of the buffer pointed to by retVal . |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_EMPTY_TIME_SERIES | (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.pData
argument is NULL, the function will fails and return NDK_INVALID_ARG.nSixe
argument with the number of non-missing values in the array. Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_PCR_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 (of principal components) analysis of variance (ANOVA) values.
[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 varMask . | ||||||||||||||||
[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)).
| ||||||||||||||||
[out] | retVal | (Required) is a pointer to a variable to hold the value of the calculated ANOVA statistics. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_EMPTY_TIME_SERIES | (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.pData
argument is NULL, the function will fails and return NDK_INVALID_ARG.nSixe
argument with the number of non-missing values in the array. Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_PCR_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 i-th principal component (or residuals).
[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 varMask . | ||||||||||||
[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)).
|
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_EMPTY_TIME_SERIES | (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.pData
argument is NULL, the function will fails and return NDK_INVALID_ARG.nSixe
argument with the number of non-missing values in the array. Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_PCR_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 model's estimated values, std. errors and related statistics.
[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 varMask . | ||||||||||
[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 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).
| ||||||||||
[out] | retVal | (Required) is a pointer to a variable to hold the calculated value or statistics. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_EMPTY_TIME_SERIES | (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.pData
argument is NULL, the function will fails and return NDK_INVALID_ARG.nSixe
argument with the number of non-missing values in the array. Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_PCR_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 square, adjusted R square, MSRE, LLF, AIC, etc.).
[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 varMask . | ||||||||||||||
[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 = R-Square (default), 2 = Adj. R-Square, 3 = RMSE, 4 = LLF, 5 = AIC, 6 = SIC/BIC)..
| ||||||||||||||
[out] | retVal | (Required) is a pointer to a variable to hold the value of the calculated GOF statistics. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_EMPTY_TIME_SERIES | (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.pData
argument is NULL, the function will fails and return NDK_INVALID_ARG.nSixe
argument with the number of non-missing values in the array. Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_PCR_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 regression coefficients values for a given input variable.
[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 varMask . | ||||||||||||||
[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).
| ||||||||||||||
[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. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_EMPTY_TIME_SERIES | (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.pData
argument is NULL, the function will fails and return NDK_INVALID_ARG.nSixe
argument with the number of non-missing values in the array. Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_PCR_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 for PCR (used for testing the inclusion/exclusion variables).
[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 the model. If missing, all variables in X are included. | ||||||||
[in] | nMaskLen1 | (Required) is the number of elements in the varMask . | ||||||||
[in] | mask2 | (Required) is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. | ||||||||
[in] | nMaskLen2 | (Required) is the number of elements in the varMask . | ||||||||
[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).
| ||||||||
[out] | retVal | (Required) is a pointer to a variable to hold the calculated test statistics. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_EMPTY_TIME_SERIES | (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.pData
argument is NULL, the function will fails and return NDK_INVALID_ARG.nSixe
argument with the number of non-missing values in the array. Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_PCR_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.
[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 varMask . | ||||||||
[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).
|
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_EMPTY_TIME_SERIES | (see remarks) |
NDK_FAILED | failed |
nSize
is zero, the function will fail and return NDK_INVALID_ARG.pData
argument is NULL, the function will fails and return NDK_INVALID_ARG.nSixe
argument with the number of non-missing values in the array. Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |