l1trend: wrapper function for fitting L1 trend estimator l1tf from...

Description Usage Arguments Details Value Examples

View source: R/fit-extract-L1trend.R

Description

l1trend returns an object of class l1tf_obj

Usage

1
l1trend(y.v, prop, sens = 100, max.length = 5, max.prop.na = 0.2)

Arguments

y.v

A numeric vector

prop

A scalar showing the proportion of NAs that are allowable in y.v

sens

A sensitivity parameter that is involved in identifying break-points, defaults to 100

max.length

the maximum allowable segment length, defaults to 5

max.prop.na

the maximum allowable proportion of NAs within the input vector

Details

This is a wrapper function for l1tf from the l1tf package. The l1tf function fits an L1 regularised piecewise linear function to a time series data set. The wrapper function processes the vector returned by l1tf and returns an S4 object with three slots, these being: summary.df, series.df and prop.na. summary.df provides a summary of the linear functions and change-points. series.df provides an output of the time-series with imputed NA values and piecewise linear trend. prop.na provides the number of NAs as a proportion of the series length. There is an associated summary and plot method fo rthe l1tf_obj class.

Value

An l1tf_obj with slots summary.df, series.df and prop.na

Examples

1
2
3
4
5
6
7
## Not run: data(somestocks)
data.sub <- somestocks[,1]
trend.est <- l1trend(y.v = data.sub,prop=0.2,sens=100,max.length=5,max.prop.na=0.2)
summary(trend.est)
plot(trend.est)

## End(Not run)

roywilsonLinc/l1tfplus documentation built on May 27, 2019, 11:51 p.m.