SurrogateTest {RHRV} | R Documentation |
Surrogate data testing
Description
Surrogate data testing
Usage
SurrogateTest(HRVData,
indexNonLinearAnalysis = length(HRVData$NonLinearAnalysis),
significance = 0.05, oneSided = FALSE, alternative = c("smaller",
"larger"), K = 1, useFunction, xlab = "Values of the statistic",
ylab = "", main = "Surrogate data testing on the RR intervals",
doPlot = TRUE, ...)
Arguments
HRVData |
Structure containing the RR time series. |
indexNonLinearAnalysis |
Reference to the data structure that will contain the nonlinear analysis |
significance |
Significance of the test. |
oneSided |
Logical value. If TRUE, the routine runs a one-side test. If FALSE, a two-side test is applied (default). |
alternative |
Specifies the concrete type of one-side test that should be performed: If the the user wants to test if the statistic from the original data is smaller (alternative="smaller") or larger (alternative="larger") than the expected value under the null hypothesis. |
K |
Integer controlling the number of surrogates to be generated (see details). |
useFunction |
The function that computes the discriminating statistic that shall be used for testing. |
xlab |
a title for the x axis. |
ylab |
a title for the y axis. |
main |
an overall title for the plot. |
doPlot |
Logical value. If TRUE, a graphical representation of the statistic value for both surrogates and original data is shown. |
... |
Additional arguments for the useFunction function. |
Details
This function tests the null hypothesis (H0) stating that the series is a gaussian linear process. The test is performed by generating several surrogate data according to H0 and comparing the values of a discriminating statistic between both original data and the surrogate data. If the value of the statistic is significantly different for the original series than for the surrogate set, the null hypothesis is rejected and nonlinearity assumed.
To test with a significance level of \alpha
if the statistic
from the original data is smaller than the expected value under the null
hypothesis (a one-side test), K/\alpha - 1
surrogates
are generated. The null hypothesis is then rejected if the statistic from
the data has one of the K smallest values. For a two-sided test,
2K/\alpha - 1
surrogates are generated. The null
hypothesis is rejected if the statistic from the data gives one of the K smallest
or largest values.
The surrogate data is generated by using a phase randomization procedure.
Value
A HRVData structure containing a SurrogateTest field storing the statistics computed for the set (surrogates.statistics field) and the RR time series (data.statistic field). The SurrogateTest list is stored under the NonLinearAnalysis structure.
References
SCHREIBER, Thomas; SCHMITZ, Andreas. Surrogate time series. Physica D: Nonlinear Phenomena, 2000, vol. 142, no 3, p. 346-382.
Examples
## Not run:
data(HRVProcessedData)
# rename for convenience
HRVData = HRVProcessedData
# Select a small window that looks stationary
HRVData = Window(HRVData,start = 0, end=800)
HRVData = CreateNonLinearAnalysis(HRVData)
HRVData = SetVerbose(HRVData,TRUE)
HRVData = SurrogateTest(HRVData, indexNonLinearAnalysis = 1,
significance = 0.05, oneSided = FALSE,
K = 5, useFunction = timeAsymmetry2)
## End(Not run)