Statistics and Operational Research Doctoral Training Centre Lancaster University Changepoints for a Range Of PenaltieS using the changepoint R package Kaylea Haynes Supervised by: Idris Eckley, Paul Fearnhead and Ralph Mansson useR! 2015 Aalborg July 2015
28
Embed
C R O PenaltieS using the R package - ADVANCE · R package version 2.0, 2015 (To appear very soon). Twitter: @storiKaylea Slides can be downloaded from: . Title: Changepoints for
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Statistics and Operational ResearchDoctoral Training CentreLancaster University
Changepoints for a Range Of PenaltieS using thechangepoint R package
Kaylea HaynesSupervised by: Idris Eckley, Paul Fearnhead and Ralph ManssonuseR! 2015 Aalborg
July 2015
Introduction CROPS Example
Overview
I changepoint: An R package for changepoint analysisI Version: 2.0I Author: Rebecca Killick [aut, cre], Kaylea Haynes [aut], Idris Eckley
[aut] and Paul Fearnhead [ctb]
I Multiple changepoint search methodsI Binary SegmentationI Pruned Exact Linear Time (PELT)I Changepoints for a Range of Penalties (CROPS)
(Killick et al. 2014, Killick and Eckley 2014)
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Changepoint Detection
For data y1, ..., yn, a changepoint is a location τ where the statisticalproperties of y1, ..., yτ differ from those of yτ+1, ..., yn.
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Segment Costs
Common costs
m+1∑i=1
[Cy(τi−1+1):τi ] + βm
I cpt.mean(data,...)
I cpt.var(data,...)
I cpt.meanvar(data,...)
test.stat: "Normal", "Gamma", "Exponential" and
"Poisson".
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Optimal Partitioning
Recursion
F (t) = minτ∈τt
{m+1∑i=1
[C(y(τi−1+1):τi ) + β]
}= min
s∈{0,...,t−1}{F (s) + C(y(s+1):n) + β}
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Penalty
4
8
12
16
0 100 200 300
Index
Dat
a
Penalty = 2
4
8
12
16
0 100 200 300
Index
Dat
a
Penalty = 100
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Changepoints for a Range of PenaltieS(CROPS).
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Step 1: Run algorithm* for βmin and βmax
If both the segmentations have the same number of changepoints:STOP.The optimal number of changepoints decreases as β increases. So allvalues of β ∈ [βmin, βmax ] will have the same optimal segmentation.
* Optimal Partitioning (Jackson et al 2005) or PELT (Killick et al(2012)).
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Step 2: Compare the number of changepoints
If the number of changepoints differs by 1, m(βmin) = m(βmax) + 1:STOP.
5.0 5.5 6.0 6.5 7.0 7.5 8.0
510
1520
25
beta
(Pen
alis
ed)
log−
likel
ihoo
d
X
X
3
2
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Step 2: Compare the number of changepoints
Otherwise calculate the point of intercept β∗, and run CPD algorithmwith this value.
5 6 7 8 9 10
510
1520
25
beta
(Pen
alis
ed)
log−
likel
ihoo
d
X
X
3
1
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Step 3: Check if new Optimal Segmentation
If the optimal segmentation for β∗ is the same as for βmin or βmax :STOP.
5 6 7 8 9 10
510
1520
25
beta
(Pen
alis
ed)
log−
likel
ihoo
d
X
X
3
1
X3
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Step 3: Check if new Optimal Segmentation
Otherwise, treat the intervals [βmin, β∗] and [β∗, βmax ] separately and
process using Step 2.
5 6 7 8 9 10
510
1520
25
beta
(Pen
alis
ed)
log−
likel
ihoo
d
X
X
3
1
X2
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk
Introduction CROPS Example
Final Solution
10
11
12
13
14
15
16
789
775
800
825
850
6 7 8 9 10 11Beta
Co
st
Twitter: @storiKaylea Slides can be downloaded from: www.khaynes.co.uk