NDK_XCFTEST
Last Modified on 04/20/2016 1:39 pm CDT
int __stdcall NDK_XCFTEST
(
double *
X,
double *
Y,
size_t
N,
int
K,
double
target,
double
alpha,
WORD
method,
WORD
retType,
double *
retVal
)
Calculates the test stats, p-value or critical value of the correlation test.
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 first univariate time series data (a one dimensional array).
[in]
Y
is the second univariate time series data (a one dimensional array).
[in]
N
is the number of observations in X (or Y).
[in]
K
is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]
target
is the assumed correlation value. If missing, a default of zero is assumed.
[in]
alpha
is the statistical significance level. If missing, a default of 5% is assumed.
[in]
method
is the desired correlation coefficient (1=Pearson (default), 2=Spearman, 3=Kendall). If missing, a Pearson coefficient is assumed.
[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.
Requirements
Header
SFSDK.H
Library
SFSDK.LIB
DLL
SFSDK.DLL
Examples
Namespace:
NumXLAPI
Class:
SFSDK
Scope:
Public
Lifetime:
Static
int NDK_XCFTEST
(
double[]
pData1,
double[]
pData2,
UInPtr
nSize,
int
nLag,
double
target,
double
alpha,
UInt16
method,
UInt16
retType,
out double
retVal
)
Calculates the test stats, p-value or critical value of the correlation test.
Returns
status code of the operation
Return values
NDK_SUCCESS
Operation successful
NDK_FAILED
Operation unsuccessful. See Macros for full list.
Parameters
[in]
pData1
is the first univariate time series data (a one dimensional array).
[in]
pData2
is the second univariate time series data (a one dimensional array).
[in]
nSize
is the number of observations in X (or Y).
[in]
nLag
is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).
[in]
target
is the assumed correlation value. If missing, a default of zero is assumed.
[in]
alpha
is the statistical significance level. If missing, a default of 5% is assumed.
[in]
method
is the desired correlation coefficient (1=Pearson (default), 2=Spearman, 3=Kendall). If missing, a Pearson coefficient is assumed.
[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.
Examples
References
Hull, John C.; Options, Futures and Other DerivativesFinancial Times / Prentice Hall (2011), ISBN 978-0132777421
Hans-Peter Deutsch; , Derivatives and Internal Models, Palgrave Macmillan (2002), ISBN 0333977068
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 * 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
Was this article helpful?
Thank you for your feedback!