Learn R Programming

FeedbackTS (version 1.5)

feedback.test: Test of feedback and change-in-feedback for a single time series

Description

Randomization test to investigate the fragmented time directionality in a single time series and the temporal variation in the fragmented time directionality.

Usage

feedback.test(object, test, operator, nb.rand, plots = TRUE, turning.year = NULL)

Arguments

test

a character string specifying the type of test, must be one of "feedback" or "change.in.feedback".

operator

a character string specifying the transformation of the raw values, must be one of "dmv" or "dmpiv" (see section Details in after.minus.before).

nb.rand

a positive integer specifying the number of randomizations.

plots

a logical indicating if plots characterizing the test are produced (if plots = TRUE) or not (if plots = FALSE), default is TRUE.

turning.year

an optional numeric value specifying a temporal turning point in the data series, must be provided if operator = "change.in.feedback".

Value

A numeric value providing the p-value of the test.

Details

If plots = TRUE, two plots are produced. The first plot gives the cumulative after-before difference (CABD; red curve) and for each CABD value the quantiles of order 0.025 (bottom dotted curve), 0.25 (bottom dashed curve), 0.5 (solid black curve), 0.75 (top dashed curve) and 0.975 (top dotted curve) under the null hypothesis that is tested (either no feedback or no change-in-feedback). The second plot gives the number of exits of the CABD function from the confidence intervals (red line) and the distribution of the number of exits under the null hypothesis that is tested (histogram).

References

Soubeyrand, S., Morris, C. E. and Bigg, E. K. (2014). Analysis of fragmented time directionality in time series to elucidate feedbacks in climate data. Environmental Modelling and Software 61: 78-86.

See Also

KDD, KDD.yearly.average, kdd.from.raw.data, after.minus.before, rain.site.6008

Examples

Run this code
# NOT RUN {
#### load data for site 6008 (Callagiddy station)
data(rain.site.6008)

#### build KDD objects from raw data (site 6008: Callagiddy station)
## using a threshold value equal to 25
KDD=kdd.from.raw.data(raw.data=rain.site.6008, keyday.threshold=25, nb.days=20,
   col.series=5, col.date=c(2,3,4), na.rm=TRUE, filter=NULL)

#### test feedback and change in feedback with a single data series
## using the thresholded data series
## using difference of means of positive indicator values (i.e. rainfall occurrence)
par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1))
feedback.test(object=KDD, test="feedback", operator="dmpiv", nb.rand=10^3, plots=TRUE)
# }

Run the code above in your browser using DataLab