get.period: get.period

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Compute power spectrum and returns period (1/frequency) at which its density is maximized.

Usage

1

Arguments

x

a numerical vector.

Value

Period (1/frequency) of maximum power density

Examples

1
2
3
4
5
6
7
# Regular motif of length 15 repeated 5 times + Linear Trend
x <- rep(1:15, 5)
x <- x + seq(0, 10, length.out = length(x))
x_period <- get.period(x)
# Use the period to perform classical decomposition
x_decomp <- classical.decomposition(ts = x, period = x_period)
plot_decomposition(x_decomp)

majpark21/TSexploreR documentation built on Oct. 16, 2019, 2:46 p.m.