NDK_MLR_PARAM

 int __stdcall NDK_MLR_PARAM ( double ** X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double * Y, size_t nYSize, double intercept, double alpha, WORD nRetType, WORD nParamIndex, double * retVal )

Calculates the OLS regression coefficients values.

Returns
status code of the operation
Return values
 NDK_SUCCESS Operation successful NDK_FAILED Operation unsuccessful. See Macros for full list.
Parameters
 [in] X is the independent (explanatory) variables data matrix, such that each column represents one variable. [in] nXSize is the number of observations (rows) in X. [in] nXVars is the number of independent (explanatory) variables (columns) in X. [in] mask is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included. [in] nMaskLen is the number of elements in the "mask." [in] Y is the response or the dependent variable data array (one dimensional array of cells). [in] nYSize is the number of observations in Y. [in] intercept is the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally. [in] alpha is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed. [in] nRetType is a switch to select the return output (1=value (default), 2=std. error, 3=t-stat, 4=P-value, 5=upper limit (CI), 6=lower limit (CI)): Value (mean) Std error Test score P-value Upper limit of the confidence interval Lower limit of the confidence interval [in] nParamIndex is a switch to designate the target parameter (0=intercept (default), 1=first variable, 2=2nd variable, etc.). [out] retVal is the computed statistics of the regression coefficient.
Remarks
1. $\mathbf{y} = \mathbf{X}\boldsymbol\beta + \boldsymbol\varepsilon$ $\hat{\boldsymbol\beta} = (\mathbf{X}^{\rm T}\mathbf{X})^{-1} \mathbf{X}^{\rm T}\mathbf{y} = \big(\, \tfrac{1}{n}{\textstyle\sum} \mathbf{x}_i \mathbf{x}^{\rm T}_i \,\big)^{-1} \big(\, \tfrac{1}{n}{\textstyle\sum} \mathbf{x}_i y_i \,\big)$ Where:
• $$\hat{\boldsymbol\beta}$$ is the estimated regression coefficients.
2. The sample data may include missing values.
3. Each column in the input matrix corresponds to a separate variable.
4. Each row in the input matrix corresponds to an observation.
5. Observations (i.e. row) with missing values in X or Y are removed.
6. The number of rows of the response variable (Y) must be equal to the number of rows of the explanatory variables (X).
7. The MLR_PARAM function is available starting with version 1.60 APACHE.
Requirements
 Namespace: NumXLAPI Class: SFSDK Scope: Public Lifetime: Static
 int NDK_MLR_PARAM ( double[] pXData, double[] nXSize, UIntPtr nXVars, byte[] mask, UIntPtr nMaskLen, double[] pYData, UIntPtr nYSize, double intercept, double alpha, short nRetType, short ParamIndex, ref double retVal )

Calculates the OLS regression coefficients values.

Return Value

a value from NDK_RETCODE enumeration for the status of the call.

 NDK_SUCCESS operation successful Error Error Code
Parameters
 [in] pXData is the independent (explanatory) variables data matrix, such that each column represents one variable. [in] nXSize is the number of observations (rows) in pXData. [in] nXVars is the number of independent (explanatory) variables (columns) in pXData. [in] mask is the boolean array to choose the explanatory variables in the model. If missing, all variables in pXData are included. [in] nMaskLen is the number of elements in the "mask." [in] pYData is the response or the dependent variable data array (one dimensional array of cells). [in] nYSize is the number of observations in pYData. [in] intercept is the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally. [in] alpha is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed. [in] nRetType is a switch to select the return output (1=value (default), 2=std. error, 3=t-stat, 4=P-value, 5=upper limit (CI), 6=lower limit (CI)): Value (mean) Std error Test score P-value Upper limit of the confidence interval Lower limit of the confidence interval [in] nParamIndex is a switch to designate the target parameter (0=intercept (default), 1=first variable, 2=2nd variable, etc.). [out] retVal is the computed statistics of the regression coefficient.
Remarks
1. $\mathbf{y} = \mathbf{X}\boldsymbol\beta + \boldsymbol\varepsilon$ $\hat{\boldsymbol\beta} = (\mathbf{X}^{\rm T}\mathbf{X})^{-1} \mathbf{X}^{\rm T}\mathbf{y} = \big(\, \tfrac{1}{n}{\textstyle\sum} \mathbf{x}_i \mathbf{x}^{\rm T}_i \,\big)^{-1} \big(\, \tfrac{1}{n}{\textstyle\sum} \mathbf{x}_i y_i \,\big)$ Where:
• $$\hat{\boldsymbol\beta}$$ is the estimated regression coefficients.
2. The sample data may include missing values.
3. Each column in the input matrix corresponds to a separate variable.
4. Each row in the input matrix corresponds to an observation.
5. Observations (i.e. row) with missing values in X or Y are removed.
6. The number of rows of the response variable (Y) must be equal to the number of rows of the explanatory variables (X).
7. The MLR_PARAM function is available starting with version 1.60 APACHE.
Exceptions
Exception Type Condition
None N/A
Requirements
Namespace NumXLAPI SFSDK Public Static NumXLAPI.DLL
Examples

References
* Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0-691-04289-6
* Tsay, Ruey S.; Analysis of Financial Time Series John Wiley & SONS. (2005), ISBN 0-471-690740
* D. S.G. Pollock; Handbook of Time Series Analysis, Signal Processing, and Dynamics; Academic Press; Har/Cdr edition(Nov 17, 1999), ISBN: 125609906
* Box, Jenkins and Reisel; Time Series Analysis: Forecasting and Control; John Wiley & SONS.; 4th edition(Jun 30, 2008), ISBN: 470272848