ChangePointSummary: Obtain summary of BCPA analysis

Description Usage Arguments Value Author(s) See Also Examples

View source: R/ChangePointSummary.R

Description

Produces a summary of change points for a "flat" analysis, identifying phases (periods between change points) with estimated parameters, clustering neighboring ones according to a kernel density of the windowsweep breaks.

Usage

1
ChangePointSummary(windowsweep, clusterwidth = 1, tau = TRUE)

Arguments

windowsweep

a windowsweep object, i.e. the output of the WindowSweep function.

clusterwidth

the temporal range within which change points are considered to be within the same cluster. Corresponds to the bandwidth of the density of the break distribution.

tau

logical, whether to estimate the characteristic time tau (preferred) or not. If FALSE, the autocorrelation parameter rho is calculated.

Value

a list containing two elements:

breaks

a data frame containing columns: middle - each change point, size - the number of windows that selected the change point, modelmode - the most frequently selected of the seven possible models (M0 - the null model - is excluded), and middle.POSIX - the mid-point as a POSIX time object.

phases

a data frame containing columns mu.hat, s.hat, rho.hat - the estimated mean, standard deviation, and time scale (or auto-correlation) within each phase (i.e. period between change points), t0 - the beginning of the phase, t1 - the end of the phase, and interval - the total duration of the phase.

Author(s)

Eliezer Gurarie

See Also

WindowSweep

Examples

1
2
3
4
5
6
7
8
9
if(!exists("Simp.VT")){
 data(Simp)
 Simp.VT <- GetVT(Simp)}
if(!exists("Simp.ws"))
 Simp.ws <- WindowSweep(Simp.VT, "V*cos(Theta)", windowsize = 50, windowstep = 1, progress=TRUE)
# too many change points:
ChangePointSummary(Simp.ws)
# about the right number of change points:
ChangePointSummary(Simp.ws, clusterwidth=3)

Example output

Loading required package: Rcpp
Loading required package: plyr

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==================================================================    |  95%
$breaks
  X1   middle size modelmode middle.POSIX
1  1  9.87800   15         1       9.9175
2  2 14.53000   14         1      14.5900
3  3 19.38167   15         1      19.4050
4  4 22.63714    7         1      22.5750
5  5 30.30694   18         4      30.1825
6  6 34.96429    7         1      34.8200
7  7 41.47625    4         2      41.5725
8  8 47.85233   30         1      47.8275
9  9 55.79000    1         1      56.1800

$phases
          t.cut    mu.hat     s.hat      rho.hat       t0       t1  interval
1  (-0.52,9.88] 116.03998 105.44199 0.3450566366 -0.52000  9.87800 10.398000
2   (9.88,14.5] 397.91067 129.36193 0.5535909882  9.87800 14.53000  4.652000
3   (14.5,19.4] 118.02280 126.09295 0.0003964683 14.53000 19.38167  4.851667
4   (19.4,22.6] 366.86122  72.51058 0.1526912352 19.38167 22.63714  3.255476
5   (22.6,30.3] 374.57428 150.23930 0.6570783399 22.63714 30.30694  7.669802
6     (30.3,35]  42.46938  67.79618 0.4247698247 30.30694 34.96429  4.657341
7     (35,41.5]  64.86908  55.45818 0.2806590169 34.96429 41.47625  6.511964
8   (41.5,47.9]  52.40733  58.19232 0.4779732432 41.47625 47.85233  6.376083
9   (47.9,55.8] 124.51409  93.22922 0.2072417443 47.85233 55.79000  7.937667
10  (55.8,59.4] 155.30708 148.63442 0.8857920516 55.79000 59.41000  3.620000

$breaks
  X1   middle size modelmode middle.POSIX
1  1 12.36111   27         1      12.2900
2  2 19.45261   23         1      19.4050
3  3 30.79111   27         4      30.5700
4  4 47.64242   33         1      47.8275

$phases
         t.cut    mu.hat     s.hat   rho.hat       t0       t1  interval
1 (-0.52,12.4] 194.48350 183.08137 1.2498942 -0.52000 12.36111 12.881111
2  (12.4,19.5] 218.06592 145.53408 0.6250432 12.36111 19.45261  7.091498
3  (19.5,30.8] 361.06136 143.07515 0.6676718 19.45261 30.79111 11.338502
4  (30.8,47.6]  55.50484  58.81393 0.3713984 30.79111 47.64242 16.851313
5  (47.6,59.4] 132.98216 109.99431 0.3827311 47.64242 59.41000 11.767576

bcpa documentation built on May 1, 2019, 10:30 p.m.