hanaml.BCPD is a R wrapper for SAP HANA PAL Bayesian change-point detection algorithm.

hanaml.BCPD(
  data,
  key = NULL,
  endog = NULL,
  features = NULL,
  max.tcp = 3,
  max.scp = 3,
  trend.order = NULL,
  max.harmonic.order = NULL,
  min.period = NULL,
  max.period = NULL,
  random.seed = NULL,
  max.iter = NULL,
  interval.ratio = NULL
)

Arguments

data

DataFrame
DataFrame containting the data.

key

character, optional
Name of the ID column.
Defaults to the first column if not provided.

endog

character, optional
The endogenous variable, i.e. time series.
Defaults to the first non-ID column.

features

Deprecated, character, optional
Column name(s) for the value(s) of the input time-series data. **Deprecated parameter**.

max.tcp

integer, optional
Maximum number of trend change points to be detected.
Defaults to 3.

max.scp

integer, optional
Maximum number of season change points to be detected.
Defaults to 3.

trend.order

integer, optional
Order of trend segments that used for decomposation.
Defaults to 1.

max.harmonic.order

integer, optional
Maximum order of harmonic waves within seasonal segments while decomposition.
Defaults to 0.

min.period

integer, optional
Minimum possible period within seasonal segments while decomposition. Cannot be larger than max.period
Defaults to 1.

max.period

integer, optional
Maximum possible period within seasonal segments while decomposition. Cannot be larger than the length of data
Defaults to half of the data length.

random.seed

integer, optional
Indicates the seed used to initialize the random number generator:

  • 0 Uses the system time.

  • Not 0 Uses the provided value.

Defaults to 0.

max.iter

integer, optional
BCPD is iterative, the more iterations, the more precise will the result be rendered.
Defaults to 5000.

interval.ratio

double, optional
Regulates the interval between change points, which should be larger than the corresponding portion of total length.
Defaults to 0.1.

Value

Returns a list of 4 DataFrames:

  • DataFrame 1
    The detected trend change-points of the input time-series data.

  • DataFrame 2
    The detected season change-points of the input time-series data.

  • DataFrame 3
    The detected period within each season segment of the input time-series data.

  • DataFrame 4
    The decomposed components.

Details

Bayesian change-point detection (BCPD) methods aim at detecting abrupt changes in the time series. It, to some extent, can been assumed as an enhanced version of seasonality test in additive mode.

Examples

Call the function:


> res <- hanaml.BCPD(data = df,
                     key = "ID",
                     endog = "SERIES",
                     max.tcp = 5,
                     max.scp = 5)
  print(res[[1]]$Collect())