seasonalPeak: Seasonal Peak Timing

View source: R/seasonalPeak.R

seasonalPeakR Documentation

Seasonal Peak Timing

Description

Computes the timing of the seasonal peak value. The timing of the seasonal peak is needed for the seasonalWave model (Vecchia and others, 2008).

Usage

seasonalPeak(x, y)

Arguments

x

a vector of decimal time representing dates and times. Missing values are permitted and are removed before analysis.

y

a vector of the data for which the peak is needed. Missing values are permitted and are removed before analysis.

Details

The timing of the peak of the data is computed by identifying the largest value produced by smoothing that data with supsmu. The remaining data in the attributes are used by using the seasonalPeak method of confirm.

Value

An object of class seasonalPeak. The unconfirmed object is a single value that represents the estimate of the timing of the peak and five additional attributes.

Data: a list of the x and y values where x is the fractional part of the original decimal time data. Missing values have been removed.
Smooth: a list of the x and y smoothed values.
Points: a list of 361 evenly spaced xout and yout values.
Extra: pointers to all the peaks in Points.
Confirmed: logical indicating that the object has not been confirmed.

Note

The generic functions print and confirm have methods for object of class seasonalPeak.

References

Vecchia, A.V., Martin, J.D., and Gilliom, R.J., 2008, Modeling variability and trends in pesticide concentrations in streams: Journal of the American Water Resources Association, v. 44, no. 5, p. 1308-1324

See Also

seasonalWave, confirm.seasonalPeak, supsmu, print.seasonalPeak

Examples

library(smwrData)
data(QW05078470)
with(QW05078470, seasonalPeak(dectime(DATES), P00665))
## Should be:
# Default value: 0.499
# Alternate values: 0.497

USGS-R/smwrStats documentation built on Oct. 11, 2022, 6:15 a.m.