Simulate a water quality time series with an estimated error structure and simulated discharge effect
lnres_sim(dat_in, lnQ_coef = NULL)
input data.frame
that must include estimated error and simulated discharge time series, see lnres_err
and lnQ_sim
respectively
numeric vector of coefficients of the same length of the time series in dat_in
that is multiplied by the discharge vector, see details
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
).
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).