stsm_detect_cycle {autostsm}R Documentation

Detect cycle from the data

Description

Detect cycle from the data

Usage

stsm_detect_cycle(
  y,
  freq,
  sig_level = 0.01,
  prior = NULL,
  interpolate = NA,
  cl = NULL,
  cores = NULL,
  show_progress = FALSE
)

Arguments

y

Univariate time series of data values.

freq

Frequency of the data (1 (yearly), 4 (quarterly), 12 (monthly), 365.25/7 (weekly), 365.25 (daily))

sig_level

Significance level to determine statistically significant seasonal frequencies

prior

A data table created by stsm_prior

interpolate

Character string giving frequency to interpolate to: i.e. "quarterly", "monthly", "weekly", "daily"

cl

a parallel cluster object

cores

Number of cores to use

show_progress

Whether to show progress bar

Value

Numeric value of cycle periodicity

Examples

## Not run: 
#GDP Not seasonally adjusted
library(autostsm)
data("NA000334Q", package = "autostsm") #From FRED
NA000334Q = data.table(NA000334Q, keep.rownames = TRUE)
colnames(NA000334Q) = c("date", "y")
NA000334Q[, "date" := as.Date(date)]
NA000334Q[, "y" := as.numeric(y)]
NA000334Q = NA000334Q[date >= "1990-01-01", ]
cycle = stsm_detect_cycle(y = NA000334Q$y, freq = 4)

## End(Not run)

[Package autostsm version 3.1.4 Index]