Learn R Programming

autostsm (version 3.1.4)

stsm_prior: Return a naive model prior decomposition

Description

Return a naive model prior decomposition

Usage

stsm_prior(y, freq, decomp = "", seasons = NULL, cycle = NULL)

Value

data table containing a naive decomposition using STL

Arguments

y

an object created from stsm_detect_frequency

freq

Frequency of the data

decomp

decomposition string

seasons

The seasonal periods to split the seasonality into

cycle

The cycle periods

Examples

Run this code
if (FALSE) {
#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", ]
prior = stsm_prior(y = NA000334Q$y, freq = 4)
}

Run the code above in your browser using DataLab