Learn R Programming

litteR (version 1.0.0)

theil_sen: Theil Sen Slope Estimator

Description

Theil Sen Slope Estimator

Usage

theil_sen(x, y, ...)

# S3 method for theil_sen slope(x, ...)

# S3 method for theil_sen intercept(x, ...)

Value

object of class Theil_Sen.

Arguments

x

time vector (numeric, or Date).

y

numeric value.

...

further arguments passed to or from other methods.

Methods (by generic)

  • slope(theil_sen): Extract slope.

  • intercept(theil_sen): Extract intercept.

References

https://en.wikipedia.org/wiki/Theil-Sen_estimator

Examples

Run this code

# create theil_sen object
ts <- theil_sen(1:5, c(1, 2, 3, 5, 9))

# get slope
slope(ts)

# get intercept
intercept(ts)

Run the code above in your browser using DataLab