predictSolute.loadInterp: Make flux or concentration predictions from a loadInterp...

Description Usage Arguments Details Value See Also

Description

Makes instantaneous predictions (at the temporal resolution of newdata) from a fitted loadInterp model. See predictSolute for details.

Usage

1
2
3
4
5
6
7
## S3 method for class 'loadInterp'
predictSolute(load.model, flux.or.conc, newdata,
  interval = c("none", "confidence", "prediction"), level = 0.95,
  lin.or.log = c("linear", "log"), se.fit = FALSE, se.pred = FALSE,
  date = FALSE, attach.units = FALSE, agg.by = c("unit", "day", "month",
  "water year", "calendar year", "total", "mean water year",
  "mean calendar year", "[custom]"), ...)

Arguments

load.model

A loadInterp object.

flux.or.conc

character. Should the predictions be reported as flux rates or concentrations?

newdata

data.frame, optional. Predictor data. Because loadInterp models interpolate in time among the observations to which they have been "fitted", newdata is usually simply a one-column data.frame of dates or date-times. Column names should match those given in the loadInterp metadata. If newdata is not supplied, the original fitting data will be used.

interval

character. The type of interval desired. Confidence intervals are not currently available for loadInterp models.

level

numeric. Fraction of density distribution to include within confidence or prediction interval

lin.or.log

character. Either "linear" or "log" to say whether the predictions should be converted to log space or not. If converted to log space, a bias correction will be applied, see linToLog.

se.fit

logical, but should be FALSE because se.fit is not currently available for loadInterp models.

se.pred

logical. If TRUE, the output data.frame will include a column named "se.pred" describing the standard error of the prediction for each row of predictors. The values in the se.pred column will be larger than those in the se.fit column, because the se.pred values are standard errors of prediction (SEPs) and take into account not only the parameter uncertainty associated with the model coefficients (also covered by se.fit), but also the random error associated with any given observation (the epsilon term in a typical regression model).

date

logical. If TRUE, the output data.frame will include a column named "date" containing the dates of the predictions.

attach.units

logical. Should the units be attached to columns in the resulting data.frame?

agg.by

character Time period to aggregate results by.

...

Additional arguments passed to class-specific implementations of the predictSolute generic function.

Details

loadInterps are currently assumed to have normally distributed residuals. An unwitting user might violate this assumption without being caught by the code, so be careful! This assumption is mainly relevant to the calculation of confidence or prediction intervals. Also, where other models such as loadReg and loadLm will retransform predictions back into linear space, loadInterps will not.

Value

A vector of data.frame of predictions, as for the generic predictSolute.

See Also

Other predictSolute: predictSolute.loadComp, predictSolute.loadLm, predictSolute.loadModel, predictSolute.loadReg2, predictSolute


McDowellLab/loadflex documentation built on May 8, 2019, 9:48 a.m.