# Unsupervised Offline Changepoint Detection Ensembles
## 2 Materials and Methods
### Ensembles of Offline Changepoint Detection Procedures
#### 2.1.4 CPD Ensemble Procedure  
Let us denote \(N\) CPD procedures as \(\Pi_{1},\Pi_{2},...,\Pi_{N}\) and an aggregation or combination function as \(\mathbf{\psi}(\cdot)\). We call \(A\) a CPD _Ensemble_ (CPDE) if the \"best partition\" \(\hat{\mathcal{T}}\) is a result of solving the problem for a fixed \(K\):  
\[\min_{|\mathcal{T}|=K}V^{\mathbf{\psi}}=\min_{|\mathcal{T}|=K}\mathbf{\psi}(V_{1},..., V_{N})=\min_{|\mathcal{T}|=K}\mathbf{\psi}(\sum_{k=0}^{K}c_{1}(y_{t_{k}..t_{k+1}}),..., \sum_{k=0}^{K}c_{N}(y_{t_{k}..t_{k+1}})) \tag{4}\]  
and for an unknown \(K\):  
\[\min_{\hat{\mathcal{T}}}\hat{\mathcal{V}}^{\mathbf{\psi}}=\min_{\hat{\mathcal{T}}} \mathbf{\psi}(\hat{\mathcal{V}}_{1},...,\hat{\mathcal{V}}_{N}) \tag{5}\]  
We propose a novel way to find changepoints by aggregating several cost functions inside the CPD procedure, as is shown in Figure 2.  
A procedure \(A\) is a particular case of an _Ensemble_ method defined by an aggregation function \(\mathbf{\psi}(\cdot)\). The proposed _Ensemble_ approach implies using several cost functions and aggregating afterward during the single CPD procedure running. The result of each cost function applied is a univariate time series. Altogether by form an \(N\times M\)-dimensional array of _scores_, \(s=\{s_{n,m}\}\), where \(n=1,...,N\), \(m=1,...,M\), \(s_{n,m}\in\mathbb{R}\), \(N\) is the number of applied cost functions, and \(M\) is a length of single cost function results. Generally, \(M\) depends on the search method. Therefore, using \(N\) cost functions results in getting a multivariate time series of _scores_ with the \(D=N\) to which the aggregation function \(\mathbf{\psi}\) applied. The search method is only applied to the aggregation result. Such an approach solves the problem of proper cost function selection and improves the robustness of the CPD procedure. The robustness is achieved by making the CPD procedure invariant to a particular statistical change considering outputs of various statistical models (cost functions). The intuition behind the aggregation of several cost functions through using base detectors score combinations is mainly related to the classification and outlier ensembles. Such an approach allows:  
* Avoiding losing useful information as it could be if the outputs of the whole CPD procedure are aggregated. Our approach works with _scores_ representing confidence and many time-related characteristics, while for the second approach, only the sets of changepoints are available for combining. * Borrowing some useful and interesting ideas from the classification and outlier ensembles where combining scores of the base detectors is the most common approach;
* Getting more opportunities when working with the multivariate time series of _scores_ by applying some classical techniques from the time series analysis;
* Constructing a framework with four main parts (cost function, scaling function, aggregation function, search method). It simplifies the experiments currently conducted or for further research and allows to improve the results by various minor changes added for the best-working methods. Figure 2: Components of a proposed CPD ensemble (CPDE) approach. Characteristics of the proposed CPDE procedure in terms of the categorization according to [12] (shown in Figure 4) are as follows:  
* _Model-centered_: these are the models that we use to create an ensemble, but we do not pick subsets of data points or data features (data-centered). * _Independent_: we calculate the ensemble components (cost function scores) before the aggregation independently from each other and not in a sequential way. * _Scaled_ (normalized): aggregation function \(\psi\) should include a scaling procedure for each argument (cost function application result), since different cost functions may generate differently scaled outputs. Scaling avoids favoring one or more cost functions.