is the statistical significance level. If missing, a default of 5% is assumed.
[in]
method
is the statistical test to perform (1=Jarque-Bera, 2=Shapiro-Wilk, 3=Chi-Square (Doornik and Hansen)).
[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 sample data may include missing values (e.g. a time series as a result of a lag or difference operator).
The Jarque-Bera test is more powerful the higher the number of values.
The test hypothesis for the data is from a normal distribution: \[H_{o}: x \sim N(.)\] \[H_{1}: x \neq N(.)\] Where:
\(H_{o}\) is the null hypothesis.
\(H_{1}\) is the alternate hypothesis.
\(N(.)\) is the normal probability distribution function.
The Jarque-Bera test is a goodness-of-fit measure of departure from normality based on the sample kurtosis and skewness. The test is named after Carlos M. Jarque and Anil K. Bera. The test statistic JB is defined as: \[\mathit{JB} = \frac{n}{6} \left( S^2 + \frac{K^2}{4} \right)\] Where:
\(S\) is the sample skewness.
\(K\) is the sample excess kurtosis.
\(n\) is the number of non-missing values in the data sample.
The Jarque-Bera \(\mathit{JB}\) statistic has an asymptotic chi-square distribution with two degrees of freedom and can be used to test the null hypothesis that the data is from a normal distribution. \[\mathit{JB} \sim \chi_{\nu=2}^2() \] Where:
\(\chi_{\nu}^2()\) is the Chi-square probability distribution function.
\(\nu\) is the degrees of freedom for the Chi-square distribution.
This is one-side (i.e. one-tail) test, so the computed p-value should be compared with the whole significance level (\(\alpha\)).
Requirements
Header
SFSDK.H
Library
SFSDK.LIB
DLL
SFSDK.DLL
Examples
Namespace:
NumXLAPI
Class:
SFSDK
Scope:
Public
Lifetime:
Static
int NDK_NORMALTEST
(
double[]
pData,
UIntPtr
nSize,
double
alpha,
UInt16
method,
UInt16
retType,
out double
retVal
)
Returns the p-value of the normality test (i.e. whether a data set is well-modeled by a normal distribution).
is the statistical significance level. If missing, a default of 5% is assumed.
[in]
method
is the statistical test to perform (1=Jarque-Bera, 2=Shapiro-Wilk, 3=Chi-Square (Doornik and Hansen)).
[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 sample data may include missing values (e.g. a time series as a result of a lag or difference operator).
The Jarque-Bera test is more powerful the higher the number of values.
The test hypothesis for the data is from a normal distribution: \[H_{o}: x \sim N(.)\] \[H_{1}: x \neq N(.)\] Where:
\(H_{o}\) is the null hypothesis.
\(H_{1}\) is the alternate hypothesis.
\(N(.)\) is the normal probability distribution function.
The Jarque-Bera test is a goodness-of-fit measure of departure from normality based on the sample kurtosis and skewness. The test is named after Carlos M. Jarque and Anil K. Bera. The test statistic JB is defined as: \[\mathit{JB} = \frac{n}{6} \left( S^2 + \frac{K^2}{4} \right)\] Where:
\(S\) is the sample skewness.
\(K\) is the sample excess kurtosis.
\(n\) is the number of non-missing values in the data sample.
The Jarque-Bera \(\mathit{JB}\) statistic has an asymptotic chi-square distribution with two degrees of freedom and can be used to test the null hypothesis that the data is from a normal distribution. \[\mathit{JB} \sim \chi_{\nu=2}^2() \] Where:
\(\chi_{\nu}^2()\) is the Chi-square probability distribution function.
\(\nu\) is the degrees of freedom for the Chi-square distribution.
This is one-side (i.e. one-tail) test, so the computed p-value should be compared with the whole significance level (\(\alpha\)).
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
John Y. Campbell, Andrew W. Lo, A. Craig MacKinlay, Andrew Y. Lo; The Econometrics of Financial Markets; Princeton University Press; 2nd edition(Dec 09, 1996), ISBN: 691043019