lnres_sim | R Documentation |
Simulate a water quality time series with an estimated error structure and simulated discharge effect
lnres_sim(dat_in, lnQ_coef = NULL)
dat_in |
input |
lnQ_coef |
numeric vector of coefficients of the same length of the time series in |
This function creates a simulated water quality time series and requires error estimates for an observed water quality dataset and a simulated discharge time series. The water quality time series is created as the additive combination of a seasonal, stationary time component (as in lnQ_sim
for discharge), a random error component from lnres_err
, and a simulated discharge time series from lnQ_sim
. The discharge time series is considered an explicit component of the water quality time series and is first centered at zero prior to adding. The optional vector of coefficients passed to lnQ_coef
can mediate the influence of discharge on the water quality time series. For example, a vector of all zeroes implies no effect, whereas a vector of all ones implies a constant effect (default).
The original data frame with additional columns for the seasonal water quality model (lnres_seas
), a flow-independent water quality time series (lnres_noQ
), and a flow-dependent time series (lnres_Q
).
daydat
for the format of an input dataset, lnQ_sim
for simulating discharge, and lnres_err
for estimating the error distribution of the water quality time series, all_sims
for completing all steps at once.
## Not run:
## example data
data(daydat)
## get simulated discharge
sims <- lnQ_sim(daydat)
## get error structure of wq time series
sims <- lnres_err(sims)
## get simulated wq time series using results from previous
lnres_sim(sims)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.