int __stdcall NDK_SKEWTEST | ( | double * | X, |
size_t | N, | ||
double | alpha, | ||
WORD | method, | ||
WORD | retType, | ||
double * | retVal | ||
) |
Calculates the p-value of the statistical test for the population skew (i.e. 3rd moment).
- 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 sample data (a one dimensional array). [in] N is the number of observations in X. [in] alpha is the statistical significance level. If missing, the default of 5% is assumed. [in] method is the statistical test to perform (1=parametric). [in] retType is a switch to select the return output: Method Value Description TEST_PVALUE 1 P-Value TEST_SCORE 2 Test statistics (aka score) TEST_CRITICALVALUE 3 Critical value. [out] retVal is the calculated test statistics.
- Remarks
-
- The data sample may include missing values (NaN).
- The test hypothesis for the population distribution skewness: \[H_{o}: S=0\] \[H_{1}: S\neq 0\] Where:
- \(H_{o}\) is the null hypothesis.
- \(H_{1}\) is the alternate hypothesis.
- \(S\) is the population skew.
- For the case in which the underlying population distribution is normal, the sample skew also has a normal sampling distribution: \[\hat S \sim N(0,\frac{6}{T}) \] Where:
- \(\hat S\) is the sample skew (i.e. 3rd moment).
- \(T\) is the number of non-missing values in the data sample.
- \(N(.)\) is the normal (i.e. Gaussian) probability distribution function.
- The sample data skew is calculated as: \[ \hat S(x)= \frac{\sum_{t=1}^T(x_t-\bar x)^3}{(T-1)\times \hat \sigma^3}\] Where:
- \(\hat S\) is the sample skew (i.e. 3rd moment)
- \(x_i\) is the i-th non-missing value in the data sample.
- \(T\) is the number of non-missing values in the data sample.
- \(\hat \sigma\) is the data sample standard deviation.
- In the case where the population skew is not zero, the mean is farther out than the median in the long tail. The underlying distribution is referred to as skewed, unbalanced, or lopsided.
- The underlying population distribution is assumed normal (Gaussian).
- This is a two-sides (i.e. two-tails) test, so the computed p-value should be compared with half of the significance level (\(\alpha/2\)).
- Requirements
-
Header SFSDK.H Library SFSDK.LIB DLL SFSDK.DLL
- Examples
-
Namespace: | NumXLAPI |
Class: | SFSDK |
Scope: | Public |
Lifetime: | Static |
int NDK_SKEWTEST | ( | double[] | pData, |
UIntPtr | nSize, | ||
double | alpha, | ||
UInt16 | argMethod, | ||
UInt16 | retType, | ||
out double | retVal | ||
) |
Calculates the p-value of the statistical test for the population skew (i.e. 3rd moment).
- Returns
- status code of the operation
- Return values
-
NDK_SUCCESS Operation successful NDK_FAILED Operation unsuccessful. See Macros for full list.
- Parameters
-
[in] pData is the sample data (a one dimensional array). [in] nSize is the number of observations in pData. [in] alpha is the statistical significance level. If missing, the default of 5% is assumed. [in] argMethod is the statistical test to perform (1=parametric). [in] retType is a switch to select the return output: Method Value Description TEST_PVALUE 1 P-Value TEST_SCORE 2 Test statistics (aka score) TEST_CRITICALVALUE 3 Critical value. [out] retVal is the calculated test statistics.
- Remarks
-
- The data sample may include missing values (NaN).
- The test hypothesis for the population distribution skewness: \[H_{o}: S=0\] \[H_{1}: S\neq 0\] Where:
- \(H_{o}\) is the null hypothesis.
- \(H_{1}\) is the alternate hypothesis.
- \(S\) is the population skew.
- For the case in which the underlying population distribution is normal, the sample skew also has a normal sampling distribution: \[\hat S \sim N(0,\frac{6}{T}) \] Where:
- \(\hat S\) is the sample skew (i.e. 3rd moment).
- \(T\) is the number of non-missing values in the data sample.
- \(N(.)\) is the normal (i.e. Gaussian) probability distribution function.
- The sample data skew is calculated as: \[ \hat S(x)= \frac{\sum_{t=1}^T(x_t-\bar x)^3}{(T-1)\times \hat \sigma^3}\] Where:
- \(\hat S\) is the sample skew (i.e. 3rd moment)
- \(x_i\) is the i-th non-missing value in the data sample.
- \(T\) is the number of non-missing values in the data sample.
- \(\hat \sigma\) is the data sample standard deviation.
- In the case where the population skew is not zero, the mean is farther out than the median in the long tail. The underlying distribution is referred to as skewed, unbalanced, or lopsided.
- The underlying population distribution is assumed normal (Gaussian).
- This is a two-sides (i.e. two-tails) test, so the computed p-value should be compared with half of the significance level (\(\alpha/2\)).
- Exceptions
-
Exception Type Condition None N/A
- Requirements
-
Namespace NumXLAPI Class SFSDK Scope Public Lifetime Static Package 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