# NOT RUN {
set.seed(42)
n <- 600
t <- seq_len(n)
p1 <- 30
p2 <- 240
xy <- (1 + 0.6 * sin(t*2*pi/p2)) * sin(t*2*pi/p1) + 2 * sin(t*2*pi/p2) +
rnorm(n, sd = 0.5) + t * 0.01
inter_dt <- round(runif(length(xy), min = 0.5, max = 1.5),1)
dt <- cumsum(inter_dt)
dec <- extricate(xy, dt, nimf = 7, repl = 10, comb = 10, factor_noise = 10,
speak = TRUE)
# }
# NOT RUN {
plot_emd(dec, dir = tempdir())
# }
# NOT RUN {
integrity(xy, dec)
parsimony(dec)
ht <- inst.pulse(dec, plot = FALSE)
opar <- par('mfrow')
par(mfrow = c(2,1))
plot_hist(x = 1/ht$f, breaks = 500,
xlog = TRUE, xlab = "Period")
plot_hist(x = 1/ht$f, breaks = 500, id = ht$mode,
xlog = TRUE, text = TRUE, add = TRUE, line = TRUE, pile = FALSE)
abline(v = c(p1, p2), col = "red", lwd = 2, lty = 5)
plot_hist(x = 1/ht$f, breaks = 500, id = ht$mode,
xlog = TRUE, text = TRUE, xlab = "Period")
abline(v = c(p1, p2), col = "red", lwd = 2, lty = 5)
par(mfrow = opar)
# }
Run the code above in your browser using DataLab