Skip to contents

Builds the trend model named by tr (a trend() object) from its own class defaults, then evaluates it at index. tr's parameter field (which distribution parameter the trend attaches to) is not used here – this verb evaluates the trend model on its own, the same way set_trend_model()'s type dispatch does before it further data-drives the parameter values from a live model's distribution and data (this verb has no such model to consult, so a tr with no explicit values predicts from the trend's own zero-valued class defaults).

Usage

trend_predict(tr, index)

trend_parameters(tr)

Arguments

tr

a corehydro_trend object from trend().

index

a 1-based numeric vector of time indices to evaluate at.

Value

a numeric vector, the same length as index.

trend_parameters() returns a named numeric vector, the trend's own model-parameter values (see model_parameter()) at their class defaults, adjusted by any explicit values on tr.

Examples

tr <- trend("location", "Linear", start_index = 0, values = c(10, 2))
trend_predict(tr, 1:5)
#> [1] 10 12 14 16 18
trend_parameters(trend("location", "Linear", values = c(10, 2)))
#> (α) (β) 
#>  10   2