Q_reps: Stochastic streamflow replicates

Description Usage Arguments Details Value

View source: R/generator.R

Description

Generate stochastic replicates of monthly streamflow time series.

Usage

1
2
3
Q_reps(Q.obs, method, order, X.obs = NULL, X.reps = NULL,
  X.name = NULL, X.lag = 0, years = NULL, num.reps = 100,
  trim = 2, Q.trans = "log-std", X.trans = "std")

Arguments

Q.obs

A data frame of observed streamflow with three columns (year, month, Q). By default, the replicates will have the same years as Q.obs, unless years is provided.

method

Either 'arima' or 'arimax'. 'parma' will be included soon.

order

A vector of ARIMA model order. See forecast::Arima for details.

X.obs

Observed exogeneous input, a data frame with 3 columns (year, month, X). If there are more than 3 columns, the desirable column name to be used as exogenous input should be given in X.name; otherwise the function will take the 3th column by default.

X.reps

Replicates of X. See ONI_reps.

X.name

String, the name of the column used to represent the exogenous input.

X.lag

Integer, time lag of X for model fitting

years

If provided, the replicates will be indexed by these years.

num.reps

Number of replicates to be generated. Default is 100.

trim

Used to cut off values that are too high or too low. Values that are more than trim * max(abs(obs)) will be set to max(abs(obs)). Default is 2. Supply trim = NULL if you don't want trimming.

Q.trans

The pre-processing transformation that will be applied to Q.obs before fitting.

log

Log-transformation.

std

Standardization: substracting monthly mean and dividing by monthly standard deviation.

log-std

First take log-transform, then do standardization.

X.trans

Same as Q.trans but applied on X.obs and X.reps.

Details

First, an ARMA or ARMAX model will be fitted using the overlapping period of Q.obs and X.obs. Then, an ARMA model will be fitted using forecast::Arima. Finally, stochastic time series will be generated using stats::simulate.

Value

A data.table with the following collumns: year, month, X (if method == 'armax') and Q.


ntthung/shy documentation built on May 7, 2019, 4:42 p.m.