mixr | R Documentation |
Combine the net rainfall of gauged catchments to simulate the net rainfall of an ungauged catchment.
mixr(
obs,
sim,
mdist,
msim = NULL,
distance = "rghosh",
gres = 5,
weightO = 0.8,
weightC = 0.2,
similarity,
similarity_obs,
mdist_obs,
FUN = "invKGE",
symmetrize = mean,
parallel = FALSE,
cores = NULL,
power = c(1, 0.5),
ndonors = 5,
donors = NULL,
maxdist = 50000,
min_ndonors = 3,
flexible_donor = TRUE,
two_steps = FALSE,
cv = FALSE,
save_donor = FALSE,
save_model = FALSE,
verbose = TRUE,
...
)
obs |
"transfR" object of the gauged catchments |
sim |
"transfR" object of the ungauged catchments |
mdist |
the geographical distance matrix between gauged and ungauged catchments, as computed by the function hdist, used for donor selection |
msim |
the similarity matrix of net rainfall time series for gauged catchments, as computed
by rsimilarity. It serves as the target variable in a multivariate model that predicts this
similarity at ungauged locations using several predictors (see the |
distance |
the method to use for computing distance matrix if |
gres |
resolution of spatial discretisation (number of points by km |
weightO |
weight given to the distance between outlets if |
weightC |
weight given to the distance between centroids if |
similarity |
a hydrological similarity matrix between gauged and ungauged catchments
used for donor weighting ( |
similarity_obs |
list of square matrices of hydrological similarity predictors between
gauged catchments in order to train a multivariate model for predicting similarity ( |
mdist_obs |
the geographical distance matrix among gauged catchments, computed by the function hdist, used for training a first model of hydrological similarity |
FUN |
either a function or a character string specifying the name of a predifined function to quantify the similarity of two net rainfall time series. See rsimilarity for more details |
symmetrize |
a function to combine |
parallel |
logical indicating if the computation should be parallelised |
cores |
the number of cores to use for parallel execution if |
power |
exponents. The first vector value is used in the inverse distance weighting strategy (as defined by the function weightr) and the second vector value is used during computation of Rn similarities (as defined by the function rsimilarity_model) |
ndonors |
maximum number of catchments to be used to simulate discharge of an ungauged catchment as defined by the function weightr |
donors |
list of vectors indicating the catchment IDs from which donors are selected for each ungauged catchments.
If empty, the |
maxdist |
maximum distance between a gauged and an ungauged catchment to allow the net rainfall
to be transferred. This threshold is applied on the |
min_ndonors |
minimum number of gauged catchments to start using rsimilarity_model to build a similarity model
of Rn time series for the weighting strategy. So this argument is only used when |
flexible_donor |
boolean indicating if the donor catchments can change during the simulation period according to the availability of discharge observations. See weightr for more details |
two_steps |
boolean indicating if a first model of hydrological similarity should be built first
on geographical distances. Residuals of this first model will be predicted from predictors provided by
|
cv |
boolean indicating if cross validation evaluation should be done. If true, it will estimate
the net rainfall of every gauged catchments ( |
save_donor |
boolean indicating if the net rainfall of each of the |
save_model |
boolean indicating whether additional results of the local similarity model should be saved. If true, then a list of data frames of observed and simulated similarities among gauged catchments neighbouring each ungauged catchment will be available in the "model_training" attribute of the output |
verbose |
boolean indicating if information messages should be written to the console |
... |
other arguments to be passed to rsimilarity_model if |
This function is a wrapper function for hdist and weightr to directly estimate
the net rainfall on a set of ungauged catchments (sim
) from a set of gauged catchments (obs
).
It returns the simulated net rainfall as a new space-time attribute in the sim
object called "RnSim".
The simulated net rainfall of a given ungauged catchment i
is a weighted average of the net rainfalls
of ndonors
gauged catchments j
:
R_n^i =\Sigma_{j=1}^{ndonors} R_n^j \cdot \lambda_j
where \lambda_j
are defined by an inverse distance weighting function (see weightr).
If similarity
is a list of predictors of hydrological similarity, then \lambda_j
are provided by rsimilarity_model.
The sim
object incremented by the new computed attributes.
hdist, weightr, rsimilarity_model, rsimilarity
data(Oudon)
object <- as_transfr(st = Oudon$obs, hl = Oudon$hl)
object <- velocity(object)
object <- uh(object)
object <- lagtime(object)
object <- rapriori(object)
object <- inversion(object, parallel = TRUE, cores = 2)
mdist <- hdist(x = object, y = object, method = "rghosh")
object <- mixr(obs = object, mdist = mdist, parallel = TRUE, cores=2,
cv = TRUE, flexible_donor = TRUE, save_donor = FALSE)
object <- convolution(object, save_donor = FALSE)
plot(object, i = 1, attribute = c("Qobs", "Qsim"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.