penCPD: Penalized change point detection

Description Usage Arguments Value Author(s) References Examples

View source: R/auxFuncs.R

Description

The implementation of penalized change point detection algorithm on a signal.

Usage

1
2
3
4
5
6
7
8
  penCPD(
    x                  ,
    plot = FALSE       ,
    threshold = 0.01   ,
    method = "enet"    ,
    criteria = "AICc"  ,
    ...
  )

Arguments

x

Vector. Vector of the data

plot

Logical flag. Set to true returns some plots

threshold

Single positive value. Threshold to filter the change points. The effect sizes below the threshold would be pushed to zero

method

Case sensitive string. Choose between 'enet' and 'alasso' for lasso and adaptive-lasso change point detection. Defaults is 'enet'.

criteria

Case sensitive string. Choose between 'Cp', 'AICc', 'BIC' and 'GCV' for the model selection criteria in penalized algorithm. The default is 'AICc'.

...

parameters that are passed to the plot() function

Value

a vector of change point indices. For example 5 means the fifth value in x

Author(s)

Hamed Haselimashhadi <hamedhaseli@gmail.com>

References

On change point detection using the fused lasso method, CR Rojas, B Wahlberg - arXiv preprint arXiv:1401.5408, 2014

Examples

1
2
3
4
5
6
  set.seed(123456)
  n   = 100
  x   = c(rnorm(n,0,.1),rnorm(n,1,.1))
  CPs = penCPD(x = x,plot = TRUE,method = 'alasso')
  plot(x)
  abline(v=CPs)

Hamedhm/SmoothWin documentation built on May 18, 2019, 10:13 a.m.