library(actR)

Build a synthetic time series with a shift in mean

The time series will have 100 time steps, with a shift in mean at time 20

The mean shift will have a magnitude of 0.5

syntheticTransition <- makeShift(length = 300, amp=0.5, start = 65)
#> timeUnits is at least partially absent in the input data
#> timeVariableName is at least partially absent in the input data
#> paleoData_units is at least partially absent in the input data
#> paleoData_variableName is at least partially absent in the input data
#> 

Detect Shift

we will test the synthetic time series with detectShift

synTrans <- detectShift(syntheticTransition,
                     time.variable.name = "year",
                     null.hypothesis.n = 50,
                     summary.bin.step = 1,
                     minimum.segment.length = 50,
                     simulate.time.uncertainty = FALSE,
                     method = "AMOC",
                     cpt.fun = changepoint::cpt.mean,
                     paleo.uncertainty = 0.1,
                     n.ens = 50)
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■

###Plot shift

Let’s plot the results


plotShift(synTrans)