mixr | R Documentation |
Combine the net rainfall of gauged catchments to simulate the net rainfall of an ungauged catchment.
mixr(
obs,
sim,
mdist,
distance = "rghosh",
gres = 5,
weightO = 0.8,
weightC = 0.2,
parallel = FALSE,
cores = NULL,
power = 1,
ndonors = 5,
donors = NULL,
maxdist = 50000,
flexible_donor = TRUE,
cv = FALSE,
save_donor = FALSE,
verbose = TRUE
)
obs |
"transfR" object of the gauged catchments |
sim |
"transfR" object of the ungauged catchments |
mdist |
the distance matrix between gauged and ungauged catchments as computed by the function hdist |
distance |
the method to use for computing distance matrix if |
gres |
resolution of spatial discretisation (number of points by km²) for Ghosh distance (see the function hdist) |
weightO |
weight given to the distance between outlets if |
weightC |
weight given to the distance between centroids if |
parallel |
logical indicating if the computation should be parallelised |
cores |
the number of cores to use for parallel execution if |
power |
exponent applied in the inverse distance weighting strategy as defined by the function weightr |
ndonors |
maximum number of catchments to be used to simulate discharge of an ungauged catchment as defined by the function weightr |
donors |
vector of catchments id from which donors are selected. If empty, the |
maxdist |
maximum distance between a gauged and an ungauged catchment to allow the net rainfall
to be transfered. This threshold is applied on the |
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 |
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 |
verbose |
boolean indicating if information messages should be written to the console |
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).
The sim
object incremented by the new computed attributes.
hdist, weightr
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.