slope: Slope of a time series interval

Description Usage Arguments Value Examples

View source: R/util.R

Description

Calculates the ordinary least squares slope of the time series regressed against the sequence 1:M where M is the length of the interval.

Usage

1
slope(y)

Arguments

y

time series interval values (numeric vector)

Value

slope (numeric scalar)

Examples

1
2
slope(1:10) # 1
slope(runif(10000)) # ~0

FlukeAndFeather/tsrf documentation built on Dec. 17, 2021, 8:29 p.m.