NDK_STDEVTEST

int __stdcall NDK_STDEVTEST ( double *  X,
size_t  N,
double  target,
double  alpha,
WORD  method,
WORD  retType,
double *  retVal 
)

Calculates the p-value of the statistical test for the population standard deviation.

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] target is the assumed standard deviation value. If missing, a default of one is assumed
[in] alpha is the statistical significance level. If missing, a 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
  1. The data sample may include missing values (NaN).
  2. The test hypothesis for the population standard deviation: \[H_{o}: \sigma =\sigma_o\] \[H_{1}: \sigma \neq \sigma_o\] Where:
    • \(H_{o}\) is the null hypothesis.
    • \(H_{1}\) is the alternate hypothesis.
    • \(\sigma_o\) is the assumed population standard deviation.
    • \(\sigma\) is the actual (real) population standard deviation.
  3. For the case in which the underlying population distribution is normal, the sample standard deviation has a Chi-square sampling distribution: \[ \hat \sigma^2 \sim \chi_{\nu=T-1}^2 \] Where:
    • \(\hat \sigma^2 \) is the sample variance.
    • \(\chi_{\nu}^2()\) is the Chi-square probability distribution function.
    • \(\nu\) is the degrees of freedom for the Chi-square distribution.
    • \(T\) is the number of non-missing values in the sample data.
  4. Using a given data sample, the sample data standard deviation is computed as: \[ \hat \sigma(x) = \sqrt{\frac{\sum_{t=1}^T(x_t-\bar x)^2}{T-1}}\] Where:
    • \(\hat \sigma(x)\) is the sample standard deviation.
    • \(\bar x\) is the sample average.
    • \(T\) is the number of non-missing values in the data sample.
  5. The underlying population distribution is assumed normal (Gaussian).
  6. 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
Namespace:  NumXLAPI
Class:  SFSDK
Scope:  Public
Lifetime:  Static
int NDK_STDEVTEST ( double[]  pData,
UIntPtr  nSize,
double  target,
double  alpha,
UInt16  argMethod,
UInt16  retType,
out double  retVal 
)

Calculates the p-value of the statistical test for the population standard deviation.

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] target is the assumed standard deviation value. If missing, a default of one is assumed
[in] alpha is the statistical significance level. If missing, a 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
  1. The data sample may include missing values (NaN).
  2. The test hypothesis for the population standard deviation: \[H_{o}: \sigma =\sigma_o\] \[H_{1}: \sigma \neq \sigma_o\] Where:
    • \(H_{o}\) is the null hypothesis.
    • \(H_{1}\) is the alternate hypothesis.
    • \(\sigma_o\) is the assumed population standard deviation.
    • \(\sigma\) is the actual (real) population standard deviation.
  3. For the case in which the underlying population distribution is normal, the sample standard deviation has a Chi-square sampling distribution: \[ \hat \sigma^2 \sim \chi_{\nu=T-1}^2 \] Where:
    • \(\hat \sigma^2 \) is the sample variance.
    • \(\chi_{\nu}^2()\) is the Chi-square probability distribution function.
    • \(\nu\) is the degrees of freedom for the Chi-square distribution.
    • \(T\) is the number of non-missing values in the sample data.
  4. Using a given data sample, the sample data standard deviation is computed as: \[ \hat \sigma(x) = \sqrt{\frac{\sum_{t=1}^T(x_t-\bar x)^2}{T-1}}\] Where:
    • \(\hat \sigma(x)\) is the sample standard deviation.
    • \(\bar x\) is the sample average.
    • \(T\) is the number of non-missing values in the data sample.
  5. The underlying population distribution is assumed normal (Gaussian).
  6. 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