# Simulates an example time series and estimates its trend and evolutionary wavelet spectrum.
# Then plots both estimates.
spec <- matrix(0, nrow = 9, ncol = 512)
spec[1, ] <- 4 + 4 * sin(seq(from = 0, to = 2 * pi, length = 512))^2
trend <- seq(from = 0, to = 10, length = 512) + 2 * sin(seq(from = 0, to = 2 * pi, length = 512))
set.seed(1)
x <- TLSWsim(trend = trend, spec = spec)
x.TLSW <- TLSW(x)
plot(x.TLSW, trend.plot.args = list(
ylab = "Simulated Data", T.col = 4,
T.lwd = 2, T.lty = 2
))
Run the code above in your browser using DataLab