Learn R Programming

bdrc (version 1.1.0)

predict.plm0: Predict method for discharge rating curves

Description

Predict the discharge for given stage values based on a discharge rating curve model object.

Usage

# S3 method for plm0
predict(object, ..., newdata = NULL, wide = FALSE)

# S3 method for plm predict(object, ..., newdata = NULL, wide = FALSE)

# S3 method for gplm0 predict(object, ..., newdata = NULL, wide = FALSE)

# S3 method for gplm predict(object, ..., newdata = NULL, wide = FALSE)

Value

an object of class "data.frame" with four columns, h (stage), lower (2.5% posterior predictive quantile), median (50% posterior predictive quantile), upper (97.5% posterior predictive quantile). If wide=TRUE, a matrix as described above (see wide parameter) is returned.

Arguments

object

an object of class "plm0", "plm", "gplm0" or "gplm".

...

not used in this function

newdata

a numeric vector of stage values for which to predict. If omitted, the stage values in the data are used.

wide

a logical value denoting whether to produce a wide prediction output.If TRUE, then the output is a table with median prediction values for an equally spaced grid of stages with 1 cm increments, each row containing predictions in a decimeter range of stages.

Functions

  • predict(plm0): Predict method for plm0

  • predict(plm): Predict method for plm

  • predict(gplm0): Predict method for gplm0

  • predict(gplm): Predict method for gplm

See Also

plm0, plm, gplm0 and gplm for fitting a discharge rating curve and summary.plm0, summary.plm, summary.gplm0 and summary.gplm for summaries. It is also useful to look at plot.plm0, plot.plm, plot.gplm0 and plot.gplm to help visualize all aspects of the fitted discharge rating curve. Additionally, spread_draws and spread_draws help working directly with the MCMC samples.

Examples

Run this code
# \donttest{
data(krokfors)
set.seed(1)
plm0.fit <- plm0(formula=Q~W,data=krokfors,h_max=10,num_cores=2)
#predict rating curve on a equally 10 cm spaced grid from 9 to 10 meters
predict(plm0.fit,newdata=seq(9,10,by=0.1))
# }

Run the code above in your browser using DataLab