Typical initial model used in Data-Based Mechanistic modelling. Rainfall is scaled by corresponding streamflow values raised to a power. This SMA uses streamflow data, so can not be used for prediction.
dbm.sim(DATA, power, qlag = 0, scale = 1, return_state = FALSE)
time-series-like object with columns P
(precipitation)
and Q
(streamflow).
power to apply to streamflow values.
number of time steps to lag the streamflow (relative to rainfall) before multiplication.
constant multiplier of the result, for mass balance. If this
parameter is set to NA
(as it is by default) in
hydromad
it will be set by mass balance calculation.
ignored.
the simulated effective rainfall, a time series of the same length as the input series.
hydromad(sma = "dbm")
to work with models as objects
(recommended).
## view default parameter ranges:
str(hydromad.options("dbm"))
#> List of 1
#> $ dbm:List of 3
#> ..$ power: num [1:2] 0 0.9
#> ..$ qlag : num [1:2] -1 2
#> ..$ scale: num NA
data(HydroTestData)
mod0 <- hydromad(HydroTestData, sma = "dbm", routing = "expuh")
mod0
#>
#> Hydromad model with "dbm" SMA and "expuh" routing:
#> Start = 2000-01-01, End = 2000-03-31
#>
#> SMA Parameters:
#> lower upper
#> power 0 0.9
#> qlag -1 2.0
#> scale NA NA
#> Routing Parameters:
#> NULL
## simulate with some arbitrary parameter values
mod1 <- update(mod0, power = 0.5, qlag = 0, tau_s = 10)
xyplot(cbind(HydroTestData, dbm.Q = predict(mod1)))
## show effect of increase/decrease in each parameter
parRanges <- list(power = c(0.01, 0.9), qlag = c(-1, 2))
parsims <- mapply(
val = parRanges, nm = names(parRanges),
FUN = function(val, nm) {
lopar <- min(val)
hipar <- max(val)
names(lopar) <- names(hipar) <- nm
fitted(runlist(
decrease = update(mod1, newpars = lopar),
increase = update(mod1, newpars = hipar)
))
}, SIMPLIFY = FALSE
)
xyplot.list(parsims,
superpose = TRUE, layout = c(1, NA),
main = "Simple parameter perturbation example"
) +
latticeExtra::layer(panel.lines(fitted(mod1), col = "grey", lwd = 2))