The function provides the ability to do a weighted combination of runoff
and/or discharge timeseries in HS
object using user provided weights.
Function can process several input weight sets.
combine_runoff( HS, weights, intercept = 0, bias = 0, drop = FALSE, monthly = FALSE )
HS | An |
---|---|
weights | A vector of weights with the same length as the number of
runoff timeseries in |
intercept | If weights are associated with an intercept, include it here. Default intercept = 0. |
bias | Bias in percentage. Defaults to 0. |
drop | Whether to remove source timeseries and replace them with combinations, or keep source timeseries and add combination as new column. |
monthly | If provided weights are for each month, set to |
Returns the input HS
object where runoff timeseries is
replaced by the the combined timeseries'.
If a named list of weights is provided to the function, their names will be preserved in the combinations. Otherwise the combinations are named using a running number.
If intercept
is provided, it is added to the combined timeseries.
If bias
is provided, the combined timeseries is adjusted by
timeseries / (1-bias/100).
Note that if the timeseries of dates is different in each runoff timeseries in the input, the output includes only those dates which are present in every input timeseries.
The combination is only applied to columns runoff_ts
, and
discharge_ts
. Columns observation_ts
and
control_ts
are left untouched if present.