• No results found

Parallelising Multivariate Methods

In document Detecting abrupt changes in big data (Page 131-137)

5.3 Dynamic Programming Algorithms

6.1.3 Parallelising Multivariate Methods

Parallelisation would lend itself nicely to improve the computational costs of mul- tivariate changepoints detection, particularly when considering subset multivariate

changepoints; a changepoint occurs only in a subset of the variables. Pickering (2015) proposes a method, SMOP, which first considers costs for a multivariate time-series using the notion ofchangepoint vectors. If we letcjt be the location of the most recent changepoint in variablejup to and including time-pointtthen the changepoint vector at timet is the vector of all the most recent changepoints across all of the variables.

The multivariate cost can then be defined as follows. If we let Dj(·) be a generic

additive cost function, such as the negative log-likelihood, for each variablej = 1, ..., p, and letqτK =Ppj=11(τKj =τK) denote the number of dimensions affected by a change,

then the multivariate penalised cost is

m+1 X k=1 " p X j=1 n 1(cjτk =τk)Dj(y(cj τk−1+1):c j τk) j +αg(qτk) o # +βf(m). (6.6)

Hereαg(qτk) is a penalty to avoid over-fitting the number of variables affected by the

kth changepoint, and βf(m) is the penalty term to avoid over-fitting the number of changepoints.

To find the optimal location of the changepoints, Pickering (2015) then used a dy- namic programming algorithm similar to the univariate Optimal Partitioning method (Jackson et al., 2005). If p is the number of dimensions and n is the length of the data this has a computational costO(pn2p). Unlike in the univariate setting, Pickering

(2015) shows that pruning methods such as PELT (Killick et al., 2012) are not prac- tically viable in the multivariate case due to the additional storage and calculations required.

SMOP is computationally expensive even for relatively small values of n. In or- der to improve the speed Pickering (2015) suggests a couple of approximations in their alternative algorithm, A-SMOP, to reduce the number of potential changepoint locations and variables affect which SMOP considers. The first approximation runs univariate PELT on each variable to get a candidate set of locations from each variable to use in SMOP. The second approximation uses two window arguments to reduce

CHAPTER 6. CONCLUSIONS AND FUTURE DIRECTIONS 119

the number of affected variables for each changepoint.

It should be possible to parallelise this changepoint detection method. Summaries of each variable can be calculated beforehand and then used to calculate the cor- responding D(·) costs similar to the univariate case as shown in Section 5.3.1. In Chapter 5 we proposed two split and merge approaches for parallelising changepoint algorithms. SM1 is where the data is split in chunks over the cores with the first l points going to the first core, the nextlgoing to the second core etc. SM2 is there the data is split such that the first data-point goes to the first core, the second data-point goes to the second core etc. I believe it should be possible to use SM2 in this scenario without too much divergence from the univariate set-up. SM1 will be more difficult, but not impossible, to implement due to the boundary values. If we take 50 points either side of the boundary, Figure 6.1a shows the changepoint vectors that would be considered had we looked at a fully multivariate scenario in an example with 3 dimen- sions and 2 cores. This example is simple since we are allowing changepoints to occur in all variables. The subset multivariate scenario is much more challenging. It may be easier to use an adaptive boundary in this scenario. Figure 6.1b shows an example of the changepoint vectors we would consider using the changepoints detected in each variable before and after the boundary.

Figure 6.2 shows the challenges of using a fixed boundary. Since we are allowing changes to not occur simultaneously over all variables then it is not as easy as just looking at the points either side of the boundary in all variables. The pink shaded region shows the changepoints in one dimension that would be considered when we have a boundary length of 50 either side of the boundary. The grey shaded regions show the changepoint vectors we would have to consider in each case. Here we are assuming all changepoints in the other dimensions (grey region) can only appear before or at the same location of changepoints of the dimension we are interested in (pink region). The main challenge of this approach will be keeping track of all of the possible changepoint vectors at each time step.

0 3 6 9 0 3 6 9 0 3 6 9 1 2 3 0 250 500 750 1000 Index Data (a) 0 3 6 9 0 3 6 9 0 3 6 9 1 2 3 0 250 500 750 1000 Index Data (b)

Figure 6.1: The shaded regions show the changepoint vectors that will be consid- ered around the boundary. (a) Is the fully multivariate case and (b) is the subset multivariate case using an adaptive boundary.

It would be very interesting in the future to look into whether using multi-cores allows SMOP to become a viable method for subset multivariate method without the need to approximate it.

CHAPTER 6. CONCLUSIONS AND FUTURE DIRECTIONS 121 0 3 6 9 0 3 6 9 0 3 6 9 1 2 3 0 250 500 750 1000 Index Data 0 3 6 9 0 3 6 9 0 3 6 9 1 2 3 0 250 500 750 1000 Index Data 0 3 6 9 0 3 6 9 0 3 6 9 1 2 3 0 250 500 750 1000 Index Data

Supplementary Material for

Chapter 3

A.1

Pseudo-code for PELT

Algorithm 2: PELT

input : A data-set of the form y1:n= (y1, y2, ..., yn);

A cost function C(·) dependent on the data;

A penalty constantβ, and a constant K that satisfies the condition for PELT for all s < t < T.

output: Details of the optimal segmentation of y1:t fort = 1, . . . , n.

Let cp(0) = 0, rescp(0) = 0, F(0) = 0, m(0) = 0 and R1 ={0};

for t ∈ {1, ..., n} do

1. CalculateF(t) = mins∈Rt[F(s) +C(y(s+1):t) +β];

2. Let cp(t) = arg mins∈Rt{[F(s) +C(y(s+1):t) +β]};

3. Let m(t) = m(cp(t)) + 1;

4. Set rescp(t) = [rescp(cp(t)), cp(t)].;

5. Set Rt+1={s∈Rt:F(s) +C(y(s+1):t)< F(t)}.

end

return: rescp(n): the changepoints in the optimal segmentation ofy1:n;

and for t= 1, . . . , n;

cp(t): the most recent changepoint in the optimal segmentation ofy1:t;

m(t): the number of changepoints in the optimal segmentation ofy1:t;

F(t): the optimal cost value of the optimal segmentation of y1:t.

APPENDIX A. SUPPLEMENTARY MATERIAL FOR CHAPTER 3 123

In document Detecting abrupt changes in big data (Page 131-137)

Related documents