Skip to contents

Describe a nonstationary trend on one parameter of a distribution, for model_univariate(). Attaching any trend makes the model nonstationary: the trended parameter is replaced in the parameter vector by the trend's own coefficients, so a linear trend on the location turns one location parameter into an intercept and a slope.

Usage

trend(parameter, type, start_index = NULL, values = NULL)

Arguments

parameter

the distribution parameter to trend, as a name ("location") or a 1-based position (1). Names are resolved against the family's parameter names; see dist_params().

type

the trend model: one of "Constant", "Linear", "Quadratic", "Cubic", "Exponential", "Logistic", "Power", "Reciprocal", "Sinusoidal", "StepFunction", or "GeneralLinear".

start_index

optional 0-based index the trend is anchored at; the data-driven default is used when omitted.

values

optional numeric vector of trend coefficients, length matching the trend's own parameter count.

Value

An object of class corehydro_trend.

Examples

trend("location", "Linear")
#> <corehydro_trend> Linear on parameter location
trend(1, "Quadratic", values = c(100, 2.5, -0.01))
#> <corehydro_trend> Quadratic on parameter 1