Table of Contents

Interface IPELTCostFunction

Namespace
SignalSharp.CostFunctions.Cost
Assembly
SignalSharp.dll

Defines the interface for cost functions used in the Piecewise Linear Trend Change (PELT) algorithm.

public interface IPELTCostFunction

Remarks

Implementations of this interface provide methods to fit the cost function to the data and to compute the cost of a segment of the data. These cost functions are used by the PELT algorithm to evaluate the quality of segments and detect change points.

Methods

ComputeCost(int?, int?)

Computes the cost for a segment of the data.

double ComputeCost(int? start = null, int? end = null)

Parameters

start int?

The start index of the segment. If null, defaults to the beginning of the data.

end int?

The end index of the segment. If null, defaults to the end of the data.

Returns

double

The computed cost for the segment.

Remarks

This method calculates the cost or dissimilarity of a segment of the data, which is used by the PELT algorithm to determine the optimal segmentation.

Fit(double[,])

Fits the cost function to the provided multidimensional time series data.

IPELTCostFunction Fit(double[,] signalMatrix)

Parameters

signalMatrix double[,]

The multi-dimensional time series data to fit, where each row represents a different time series.

Returns

IPELTCostFunction

The fitted IPELTCostFunction instance.

Remarks

This method initializes any internal structures or computations needed to evaluate segment costs later on. It prepares the cost function for subsequent calls to ComputeCost(int?, int?).

Fit(double[])

Fits the cost function to the provided one-dimensional time series data.

IPELTCostFunction Fit(double[] signal)

Parameters

signal double[]

The one-dimensional time series data to fit.

Returns

IPELTCostFunction

The fitted IPELTCostFunction instance.

Remarks

This method initializes any internal structures or computations needed to evaluate segment costs later on. It prepares the cost function for subsequent calls to ComputeCost(int?, int?).