mixr: Transfer of net rainfall to ungauged catchments

View source: R/mixr.R

mixrR Documentation

Transfer of net rainfall to ungauged catchments


Combine the net rainfall of gauged catchments to simulate the net rainfall of an ungauged catchment.


  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



"transfR" object of the gauged catchments


"transfR" object of the ungauged catchments


the distance matrix between gauged and ungauged catchments as computed by the function hdist


the method to use for computing distance matrix if mdist is not provided. Possible values are "ghosh", "rghosh", "points", "centroids", "combined" as available in the function hdist


resolution of spatial discretisation (number of points by km²) for Ghosh distance (see the function hdist)


weight given to the distance between outlets if distance is "combined" (see the function hdist)


weight given to the distance between centroids if distance is "combined" (see the function hdist)


logical indicating if the computation should be parallelised


the number of cores to use for parallel execution if parallel is TRUE. If not specified, the number of cores is set to the value of parallel::detectCores()


exponent applied in the inverse distance weighting strategy as defined by the function weightr


maximum number of catchments to be used to simulate discharge of an ungauged catchment as defined by the function weightr


vector of catchments id from which donors are selected. If empty, the ndonors closest catchments are used


maximum distance between a gauged and an ungauged catchment to allow the net rainfall to be transfered. This threshold is applied on the mdist distance matrix. If no units is provided, maxdist is assumed to be in [m].


boolean indicating if the donor catchments can change during the simulation period according to the availability of discharge observations. See weightr for more details


boolean indicating if cross validation evaluation should be done. If true, it will estimate the net rainfall of every gauged catchments (obs) as if they were ungauged (leave-one-out evaluation)


boolean indicating if the net rainfall of each of the ndonors catchments should be stored in the sim object for further analysis. If true, it is adding three new space-time attributes in the sim object called "RnDonor", "Idonor" and "Wdonor" describing the net rainfall, the id and the weight of the donor catchments respectively


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 =Σ_{j=1}^{ndonors} R_n^j \cdot λ_j

where λ_j are defined by an inverse distance weighting function (see weightr).


The sim object incremented by the new computed attributes.

See Also

hdist, weightr


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"))

transfR documentation built on Jan. 23, 2023, 5:36 p.m.