The function finds the seasonal signal in the first of two time periods within the data series. This signal is used to calculate residual flows in the first time period and "historical residuals", the residuals when the second period is compared to the signal in the first period.
The output of the function gives event information for all residual events greater than σ as calculated from the functions sigmaHighFlows and sigmaLowFlows.
compare.periods(p1, p2, x, plot=T)## S3 method for class 'compflows' plot(x,...)
Arguments
p1: Character vector specifying start and end date of the first period. "YYYY-MM-DD" format.
p2: Character vector specifying start and end date of the second period. "YYYY-MM-DD" format.
x: Matrix with first column specifying dates and second column specifying raw discharge data.
plot: Logical; defaults to TRUE. If TRUE, the seasonal signal for both periods will be plotted.
...: Other parameters.
Returns
Object of S3 ckass compflows with the following items: - sigma.low: Estimate of σ−lf from period 1
sigma.high: Estimate of σ−hf from period 1
p1.levents: Matrix of low flow events for period 1
p1.hevents: Matrix of high flow events for period 1
p2.levents: Matrix of low flow events for period 2
p2.hevents: Matrix of high flow events for period 2
Examples
# load datadata("sycamore")# compare for periods from 1960 to 1979 and 1980 to 1999compare.periods(c("1960-01-01","1979-12-31"),c("1980-01-01","1999-12-31"), sycamore)