# Generate seasonal data with period = 2
t <- seq(0, 20, length.out = 400)
X <- matrix(sin(2 * pi * t / 2) + 0.1 * rnorm(400), nrow = 1)
fd <- fdata(X, argvals = t)
# Detect period using Autoperiod
result <- autoperiod(fd)
print(result)
# View all candidates
print(result$candidates)
Run the code above in your browser using DataLab