Learn R Programming

FeedbackTS (version 1.2)

feedback.stats: Computation of feedback and change-in-feedback statistics

Description

Computation of temporal averages of after-before differences around key days calculated from a time series and computation of the difference in the temporal averages around a turning point in time.

Usage

feedback.stats(object, operator, turning.year = NULL)

Arguments

operator
a character string specifying the transformation of the raw values, must be one of "dmv" or "dmpiv".
turning.year
an optional numeric vector of years used to specify turning points in the data series.

Value

  • If turning.year = NULL, a numeric equal to the temporal average of after-before differences around key days calculated from the whole time series.

    If turning.year is a numeric vector, a numeric vector providing:

    [object Object],[object Object]

Details

The function computes the following temporal averages of after-before differences around key days calculated from a time series: $$\bar D(I)=\frac{1}{n(I)}\sum_{i\in I} D_i$$ where $I$ is a set of key days, $n(I)$ is the number of key days in $I$, and $D_i$ is an after-before difference computed for each key day $i$ (see below and in after.minus.before function).

If operator = "dmv" (difference of mean values), the raw values $y_{i-K},\ldots,y_{i+K}$ of the time series are used to compute the difference: $$D_i=\left(\frac{1}{K}\sum_{k=1}^K y_{i+k}\right) - \left(\frac{1}{K}\sum_{k=1}^K y_{i-k}\right)=\frac{1}{K}\sum_{k=1}^K (y_{i+k}-y_{i-k}),$$ where $i$ is the date of the key day, $K$ is the number of days considered around the key day (specified when data is provided). If operator = "dmpiv" (difference of means of positive indicator values), the raw values $y_{i-K},\ldots,y_{i+K}$ are used to compute the difference: $$D_i=\left(\frac{1}{K}\sum_{k=1}^K 1(y_{i+k}>0)\right) - \left(\frac{1}{K}\sum_{k=1}^K 1(y_{i-k}>0)\right)=\frac{1}{K}\sum_{k=1}^K {1(y_{i+k}>0)-1(y_{i-k}>0)},$$ where $1(\cdot)$ is the indicator function. If turning.year = NULL, the function computes $\bar D(I)$ where $I$ is the set of all key days in the whole time series.

If turning.year is a numeric vector, for each value $t$ in turning.year the function computes $\bar D(I)$ with $I$ equal to the set of key days in the whole time series, in the time series before $t$ and in the time series after $t$. The function also computes, for each value $t$, the difference between the temporal averages of after-before differences after $t$ and before $t$.

References

Soubeyrand, S., Morris, C. E. and Bigg, E. K. (in press). Analysis of fragmented time directionality in time series to elucidate feedbacks in climate data. Environmental Modelling and Software.

See Also

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

Examples

Run this code
#### 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)
	
#### main feedback statistic
feedback.stats(KDD, "dmv")

#### main and auxiliary feedback statistics
feedback.stats(KDD, "dmv", turning.year=c(1960,1980))

Run the code above in your browser using DataLab