Description Usage Arguments Details Value Author(s) Examples
View source: R/GetSeasonalMult.R
This function determines the seasonal fraction of the long-term mean value.
1 | GetSeasonalMult(x, reduction, d.in.mv.ave, fixed.dates)
|
x |
data.frame. Time series data (observations) with components of class Date and numeric. |
reduction |
numeric. Signal amplitude reduction, a dimensionless quantity. Its magnitude should be greater than or equal to 1; where a value of 1 indicates no reduction in the signal amplitude. |
d.in.mv.ave |
numeric. Number of days in the moving average subset. |
fixed.dates |
Date. Vector of equally spaced dates, these are the fixed locations where the moving average is calculated. The final date is neglected. |
A simple moving average is first calculated at dates specified in fixed.dates
using past observational data in x
(such as the previous 9-months of stage data recorded at a streamgage).
The seasonal average of the moving average is then passed through a signal amplitude reduction algorithm.
The reduced values are then divided by the mean of the seasonal reduced data to give
the seasonal fraction of the mean (also known as the seasonal scaling index).
Returns an object of class data.frame with the following variables:
names(x)[1]
start date for each season in fixed.dates
.
seasonal scaling index
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
A.H. Wylie and J. Sukow, Idaho Department of Water Resources
1 2 3 4 5 6 7 8 | obs <- dataRetrieval::readNWISdata(sites = "13139510", parameterCd = "00060",
startDate = "1992-01-01", endDate = "2011-01-01")
obs <- obs[, c("dateTime", "X_00060_00003")]
obs[, 1] <- as.Date(obs[, 1])
fixed.dates <- seq(as.Date("1995-01-01"), as.Date("2011-01-01"), "1 month")
d <- GetSeasonalMult(obs, 2, 273.932, fixed.dates)
str(d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.