routing {hydroroute}R Documentation

Estimate Models and Make Predictions

Description

Performs the “routing” procedure, i.e., based on associated events, it uses (linear) models to describe translation and retention processes between neighboring hydrographs.

Usage

routing(
  real_AE,
  initials,
  relation,
  formula = y ~ x,
  model = stats::lm,
  FKM_MAX = 65,
  ...
)

Arguments

real_AE

Data frame that contains real AEs of two neighboring hydrographs estimated with estimate_AE().

initials

Data frame that contains initial values for predictions (see vignette).

relation

Data frame that contains the relation between upstream and downstream hydrograph. Must only contain two rows (one for each hydrograph) in order of their location in downstream direction. See the appended example data relation.csv or vignette for details on the structure. See get_lag() for further information about the relation and the lag between the hydrographs.

formula

An object of class stats::formula() to fit models.

model

Function which specifies the method used for fitting models (default: stats::lm()). The model class must have a stats::predict() function.

FKM_MAX

Numeric value that specifies the maximum fkm (see relation file) for which predictions seem valid.

...

Additional arguments to be passed to the function specified in argument model.

Value

A nested list containing a grid of scatterplots ('gtable' object) for neighboring hydrographs with a regression line for each metric, a data frame of results of the model fitting where each row contains the corresponding stations and metric, the model type (default: "lm"), formula, coefficients, number of observations and R^2, and a plot of predicted values based on the “initial values”.


[Package hydroroute version 0.1.2 Index]