selBestWave: Select the "Best" Seasonal Wave

View source: R/selBestWave.R

selBestWaveR Documentation

Select the "Best" Seasonal Wave

Description

Selects the "best" parameters for a seasonal wave fit.

Usage

selBestWave(formula, data, dec.time, wave.list, exhaustive = FALSE,
  Regression = lm, Test = AIC, ...)

Arguments

formula

the formula describing the model without a seasonalWave term.

data

the data.frame that contians the veriable specified in the formula.

dec.time

a character string of the name of the column in data in decimal time format.

wave.list

an object of class "seasonalPeak" (confirmed) describing the timing of the peak and potential candidate models.

exhaustive

logical; if TRUE, then do a fairly complete search for the timing of the peak, otherwise accept the timing specified in wave.list.

Regression

the regression function.

Test

the function to perform the comparison test among all of the candidate models.

...

any additional arguments to Regression.

Details

For logistic regression, use Regression=glm, Test=deviance, family=binomial(link="logit").

Value

A 4- or 7-column matrix of the "best" models. The columns are the timing of the peak (Cmax), the primary peak loading (Loading), the half life (Hlife), and the test score (Test). If the model is a two-peak model, then additional columns (la, lo, and w) describeing the second peak are included.

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.

Examples

## See the SeasonalWave demo

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