hanaml.CPD {hana.ml.r}R Documentation

Change-point Detection

Description

hanaml.CPD is a R wrapper for PAL change-point detection algorithm.

Usage

hanaml.CPD(conn.context,
           data,
           key,
           features = NULL,
           cost = NULL,
           penalty = NULL,
           custom.pen = NULL,
           solver = NULL,
           lambda = NULL,
           min.size = NULL,
           min.sep = NULL,
           max.k = NULL,
           dispersion = NULL,
           lambda.range = NULL,
           max.iter = NULL)

Arguments

conn.context

ConnectionContext
The connection to the SAP HANA system.

data

DataFrame
Input data for change-point detection.

key

character, optional
Column name for time-stamp of the input time-series data.

features

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

cost

c("normal.mse", "normal.rbf", "normal.mhlb", "normal.mv", "linear", "gamma", "poisson", "exponential", "normal.m", "negbinomial"), optional
The cost function for change-point detection.
Defaults to 'normal_mse'.

penalty

c("aic", "bic", "mbic", "oracle", "custom"), optional
The penalty function for change-point detection. Defaults to

  • (1)"aic" if "solver" is "pruneddp", "pelt" or "opt",

  • (2)"custom" if "solver " is "adppelt".

custom.pen

numeric, optional
Specified the customized penalty value.
Valid and mandatory only when penalty is explicitly set to "custom".

solver

c("pelt", "opt", "adpelt", "pruneddp"), optional
Method for finding change-points of given data, cost and penalty. Each solver supports different cost and penalty functions.

  • 1 For cost functions, "pelt", "opt" and "adpelt" support the following eight:
    "normal_mse", "normal_rbf", "normal_mhlb", "normal_mv",
    "linear", "gamma", "poisson", "exponential";
    while "pruneddp" supports the following four cost functions:
    "poisson", "exponential", "normal_m", "negbinomial".

  • 2 For penalty functions, "pruneddp" supports all penalties, "pelt", "opt" and "adppelt" support the following three:
    "aic","bic","custom", while "adppelt" only supports "custom" penalty.

Defaults to "pelt".

lambda

double, optional
Assigned weight of the penalty w.r.t. the cost function, i.e. penalizaion factor.
It can be seen as trade-off between speed and accuracy of running the detection algorithm.
A small values (usually less than 0.1) will dramatically improve the efficiency.
Defaults to 0.02, and valid only when "solver" is "pelt" or "adppelt".

min.size

integer, optional
The minimal length from the very begining within which change would not happen.
Defaults to 2, valid only when "solver" is "opt", "pelt" or "adppelt".

min.sep

integer, optional
The minimal length of speration between consecutive change-points.
Defaults to 1, valid only when "solver" is "opt", "pelt" or "adppelt".

max.k

integer, optional
The maximum number of change-points to be detected. If the given value is less than 1, this number would be determined automatically from the input data.
Defaults to 0, vaild only when "solver" is "pruneddp".

dispersion

double, optional
Dispersion coefficient for Gamma and negative binomial distribution.
Defaults to 1.0, valid only when "cost" is "gamma" or "negbinomial".

lambda.range

two numerical values, optional
Specifies the range for the weight of penalty functions, e.g.

lambda.range <- c(0.01, 0.1) means the range of [0.01, 0.1]. Only valid when "solver" is "adppelt".

max.iter

integer, optional
Maximum number of iterations for searching the best penalty. Valid only when "solver" is "adppelt".
Defaults to 40.

Format

R6Class object.

Details

Change-point detection (CPDetection) methods aim at detecting multiple abrupt changes such as change in mean, variance or distribution in an observed time-series data.

Value

List of two DataFrames.
DataFrame 1: Detected change-points of the input time-series.
DataFrame 2: Statistics for running change-point detection on the input data.

Examples

## Not run: 
  >res <- hanaml.CPD(conn.context,solver="pelt",cost="normal.mse",penalty = "aic",lambda = 0.02)

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]