adjVarTd coalesces modelled flow peaks to observed flow peaks for each event
separately. nseVarTd calculates Nash-Sutcliffe efficiency on the result
using nseStat
. Depending on the quality of the coalescing,
this better indicate performance ignoring timing error.
nseVarTd(obs, mod, event, ...)
observed data vector
model-predicted data vector corresponding to obs
.
zoo object of events, as returned by eventseq
Additional arguments to nseStat
and
estimateDelay
.
For nseVarTd, a single numeric value. For adjVarTd, a zoo object with the original modelled and observed data, the adjusted model output and the lag estimated for each event.
The success of this method in minimising the effect of timing error depends on how well modelled and observed peaks can be coalesced. This depends on:
event
- The separation into events - too short events
result in spurious cross-correlations, too long events may not adequately
capture the variability in lag. Other settings of eventseq
may
also have an effect.
lag.max
- How long a lag is considered.
Too long may result in correlations between peaks, too short will fail to
consider the true peak. Instead of passing it as an argument, consider
setting max.delay using link{hydromad.options}
Other settings
of estimateDelay
may also have an effect.
The function
currently considers both positive and negative lag up to lag.max
.
This can not be overridden.
Also note that large numbers of events will run slower.
data(Murrindindi)
x <- Murrindindi[1:100]
x <- merge(x, X = lag(x$Q, 2))
event <- eventseq(x$P, thresh = 5, inthresh = 3.5, indur = 7, continue = TRUE)
nseStat(x$Q, x$X)
#> [1] 0.2610415
nseVarTd(x$Q, x$X, event, lag.max = 3)
#> [1] 0.03441884
## Avoiding passing lag.max
hydromad.getOption("max.delay") ## Current setting - default is 10
#> [1] 10
hydromad.options(max.delay = 3)
nseVarTd(x$Q, x$X, event)
#> [1] 0.03441884
hmadstat("r.sq.vartd")(x$Q, x$X, event = event)
#> [1] 0.03441884