Gneralized Linear Model (GLM) More...
Enumerations | |
enum | GLM_LINK_FUNC { GLM_LVK_IDENTITY =1 , GLM_LVK_LOG =2 , GLM_LVK_LOGIT =3 , GLM_LVK_PROBIT =4 , GLM_LVK_CLOGLOG =5 } |
Functions | |
int __stdcall | NDK_GLM_VALIDATE (double *betas, size_t nBetas, double phi, WORD Lvk) |
Examines the model's parameters for constraints (e.g., positive variance, etc.) | |
int __stdcall | NDK_GLM_GOF (double *Y, size_t nSize, double **X, size_t nVars, double *betas, size_t nBetas, double phi, WORD Lvk, WORD retType, double *retVal) |
Calculates a measure for the goodness of fit (e.g., LLF, AIC, BIC, SBIC). | |
int __stdcall | NDK_GLM_RESID (double *Y, size_t nSize, double **X, size_t nVars, double *betas, size_t nBetas, double phi, WORD Lvk, WORD retType) |
Returns the standardized residuals/errors of a given GLM. | |
int __stdcall | NDK_GLM_PARAM (double *Y, size_t nSize, double **X, size_t nVars, double *betas, size_t nBetas, double *phi, WORD Lvk, WORD retType, size_t maxIter) |
Returns an array of cells for the initial (non-optimal), optimal or standard errors of the model's parameters | |
int __stdcall | NDK_GLM_FORE (double *X, size_t nVars, double *betas, size_t nBetas, double phi, WORD Lvk, WORD retType, double alpha, double *retval) |
Returns an array of cells for the initial (non-optimal), optimal or standard errors of the model's parameters | |
int __stdcall | NDK_GLM_FITTED (double *Y, size_t nSize, double **X, size_t nVars, double *betas, size_t nBetas, double phi, WORD Lvk, WORD retType) |
Returns an array of values for the fitted values of the conditional mean, volatility or residuals. | |
The generalized linear model (GLM) is a flexible generalization of ordinary least squares regression. The GLM generalizes linear regression by allowing the linear model to be related to the response variable (i.e., \( Y \)) via a link function (i.e., \( g(.) \))and by allowing the magnitude of the variance of each measurement to be a function of its predicted value.
enum GLM_LINK_FUNC |
int __stdcall NDK_GLM_FITTED | ( | double * | Y, |
size_t | nSize, | ||
double ** | X, | ||
size_t | nVars, | ||
double * | betas, | ||
size_t | nBetas, | ||
double | phi, | ||
WORD | Lvk, | ||
WORD | retType ) |
Returns an array of values for the fitted values of the conditional mean, volatility or residuals.
[in,out] | Y | (Required) is the response or the dependent variable data array (one dimensional array). | ||||||||||||
[in] | nSize | (Required) is the number of observations. | ||||||||||||
[in] | X | (Required) is the independent variables data matrix, such that each column represents one variable. | ||||||||||||
[in] | nVars | (Required) is the number of independent variables (or columns in X). | ||||||||||||
[in] | betas | (Required) are the coefficients of the GLM model (a one dimensional array). | ||||||||||||
[in,out] | nBetas | (Required) is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1. | ||||||||||||
[in] | phi | (Required) is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
| ||||||||||||
[in] | Lvk | (Required) is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
| ||||||||||||
[in] | retType | (Required) is a switch to select a output type ( see FIT_RETVAL_FUNC)
|
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_GLM_FORE | ( | double * | X, |
size_t | nVars, | ||
double * | betas, | ||
size_t | nBetas, | ||
double | phi, | ||
WORD | Lvk, | ||
WORD | retType, | ||
double | alpha, | ||
double * | retval ) |
Calculates the expected response (e.g., mean, std. errors) value, given the GLM model and the values of the explanatory variables.
[in] | X | (Required) is the independent variables data matrix, such that each column represents one variable. | ||||||||||||
[in] | nVars | (Required) is the number of independent variables (or columns in X). | ||||||||||||
[in] | betas | (Required) are the coefficients of the GLM model (a one dimensional array). | ||||||||||||
[in,out] | nBetas | (Required) is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1. | ||||||||||||
[in] | phi | (Required) is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
| ||||||||||||
[in] | Lvk | (Required) is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
| ||||||||||||
[in] | retType | (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] | alpha | (Required) is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed. | ||||||||||||
[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_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_GLM_GOF | ( | double * | Y, |
size_t | nSize, | ||
double ** | X, | ||
size_t | nVars, | ||
double * | betas, | ||
size_t | nBetas, | ||
double | phi, | ||
WORD | Lvk, | ||
WORD | retType, | ||
double * | retVal ) |
Calculates a measure for the goodness of fit (e.g., LLF, AIC, BIC, SBIC).
[in] | Y | (Required) is the response or the dependent variable data array (one dimensional array). | ||||||||||||||
[in] | nSize | (Required) is the number of observations. | ||||||||||||||
[in] | X | (Required) is the independent variables data matrix, such that each column represents one variable. | ||||||||||||||
[in] | nVars | (Required) is the number of independent variables (or columns in X). | ||||||||||||||
[in] | betas | (Required) are the coefficients of the GLM model (a one dimensional array). | ||||||||||||||
[in] | nBetas | (Required) is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1. | ||||||||||||||
[in] | phi | (Required) is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
| ||||||||||||||
[in] | Lvk | (Required) is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
| ||||||||||||||
[in] | retType | (Required) a switch to select a fitness measure ( see GOODNESS_OF_FIT_FUNC).
| ||||||||||||||
[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_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_GLM_PARAM | ( | double * | Y, |
size_t | nSize, | ||
double ** | X, | ||
size_t | nVars, | ||
double * | betas, | ||
size_t | nBetas, | ||
double * | phi, | ||
WORD | Lvk, | ||
WORD | retType, | ||
size_t | maxIter ) |
Returns an array of cells for the initial (non-optimal), optimal or standard errors of the model's parameters
[in,out] | Y | (Required) is the response or the dependent variable data array (one dimensional array). | ||||||||||||
[in] | nSize | (Required) is the number of observations. | ||||||||||||
[in] | X | (Required) is the independent variables data matrix, such that each column represents one variable. | ||||||||||||
[in] | nVars | (Required) is the number of independent variables (or columns in X). | ||||||||||||
[in] | betas | (Required) are the coefficients of the GLM model (a one dimensional array). | ||||||||||||
[in,out] | nBetas | (Required) is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1. | ||||||||||||
[in] | phi | (Required) is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
| ||||||||||||
[in] | Lvk | (Required) is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
| ||||||||||||
[in] | retType | (Required) is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see MODEL_RETVAL_FUNC).
| ||||||||||||
[in] | maxIter | (Required) is the maximum number of iterations used to calibrate the model. If none (i.e., 0), the default maximum of 100 is assumed. |
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_GLM_RESID | ( | double * | Y, |
size_t | nSize, | ||
double ** | X, | ||
size_t | nVars, | ||
double * | betas, | ||
size_t | nBetas, | ||
double | phi, | ||
WORD | Lvk, | ||
WORD | retType ) |
Returns the standardized residuals/errors of a given GLM.
[in,out] | Y | (Required) is the response or the dependent variable data array (one dimensional array). | ||||||||||||
[in] | nSize | (Required) is the number of observations. | ||||||||||||
[in] | X | (Required) is the independent variables data matrix, such that each column represents one variable. | ||||||||||||
[in] | nVars | (Required) is the number of independent variables (or columns in X). | ||||||||||||
[in] | betas | (Required) are the coefficients of the GLM model (a one dimensional array). | ||||||||||||
[in] | nBetas | (Required) is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1. | ||||||||||||
[in] | phi | (Required) is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
| ||||||||||||
[in] | Lvk | (Required) is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
| ||||||||||||
[in] | retType | (Required) is a switch to select a residuals-type:raw or standardized. see RESID_RETVAL_FUNC.
|
NDK_SUCCESS | success |
NDK_INVALID_ARG | failed (see remarks) |
NDK_LOW_LICENSE_ARG_LIMIT | failed (see remarks) |
NDK_FAILED | failed |
Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |
int __stdcall NDK_GLM_VALIDATE | ( | double * | betas, |
size_t | nBetas, | ||
double | phi, | ||
WORD | Lvk ) |
Examines the model's parameters for constraints (e.g., positive variance, etc.)
[in] | betas | (Required) are the coefficients of the GLM model (a one dimensional array) | ||||||||||||
[in] | nBetas | (Required) is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1 | ||||||||||||
[in] | phi | (Required) is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance).
| ||||||||||||
[in] | Lvk | (Required) is the link function that describes how the mean depends on the linear predictor (see GLM_LINK_FUNC).
|
NDK_TRUE | GLM model is valid |
NDK_FALSE | GLM model in invalid. |
NDK_INVALID_ARG | failed (see remarks) |
NDK_FAILED | failed |
Requirement | Value |
---|---|
Target Platform | Windows |
Header | SFSDK.h (include Windows.h) |
Library | SFSDK.lib |
DLL | SFSDK.dll |