Function performs data assimilation by combining timeseries of downscaled discharge estimates against observed streamflow timeseries at all river segments with observations.

optimise_point(
  HS,
  optim_method = "CLS",
  combination = "ts",
  sampling = "random",
  train = 0.5,
  ...
)

Arguments

HS

An HS object with observation_ts and discharge_ts

optim_method

A character object giving the optimisation method to be used, or a function to be passed to optim. See details.

combination

Whether to do the forecast combination for the entire timeseries, or each month of the year individually, or for full calendar years. Accepts "timeseries", "ts", or "monthly", "mon", or "annual", "ann".

sampling

How to sample training and testing periods. "series" for training serially from beginning, or "random" for a random sample for both training and testing periods.

train

The share of timeseries used for training period.

...

parameters passed to optim, if optim_method input is a function.

Value

Returns an object of class HSoptim, which is a list of results for each observation station. Each list ielement contains

  • riverID

  • Method: Model averaging method used.

  • Weights: Vector of optimised model averaging weights.

  • Intercept: Intercept from the combination. NA, if not applicable to the method.

  • Optimised_ts: A tibble consisting of date, observation and optimised timeseries.

  • Goodness_of_fit. Goodness of fit of the forecast combination obtained using gof.

Details

Optimisation can be performed either using ordinary least squares (OLS), Constrained Least Squares (CLS; coefficients positive, add to unity), Non-negative Least Squares (NNLS; coefficients positive), Least Squares without intercept (GRA), Least squares with no intercept, and coefficients sum to unity (GRB), Bates-Granger (BG), Standard Eigenvector (EIG1), Bias-corrected Eigenvector (EIG2) or selecting the best performing ensemble member (best).

Alternatively, R's optim can be used. In that case, optim_method should be a function which optim should attempt to optimise. The function should accept three inputs: par, obs and pred. par is the vector of coefficients optim optimises, obs is the observation timeseries, and pred is a matrix of inputs to be optimised. Additional arguments passed to optim can also be defined.