makeShift.Rmd
library(actR)
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
#>
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. ■■■…
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■…
###Plot shift
Let’s plot the results
plotShift(synTrans)
#> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
#> ℹ Please use `linewidth` instead.
#> ℹ The deprecated feature was likely used in the geoChronR package.
#> Please report the issue at <https://github.com/nickmckay/GeoChronR/issues>.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.