Skip to content

Commit

Permalink
Change STL function arguments
Browse files Browse the repository at this point in the history
- Use 11 years to estimate seasonal component instead of infinity.
  • Loading branch information
Damian-Oswald committed Jul 2, 2024
1 parent fa2422e commit 7a23a53
Show file tree
Hide file tree
Showing 3 changed files with 345 additions and 345 deletions.
2 changes: 1 addition & 1 deletion main.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ data$producerShare <- 100 * data$producerPrice / data$consumerPrice
for (i in c("consumerPrice","producerPrice","producerShare")) {
data[,paste0(i,"Smoothed")] <- data[,i] |>
ts(start = 2001, frequency = 12) |>
stl(s.window = "periodic") |>
stl(s.window = 11) |> # s.window is the window size used to estimate the seasonal component. If it's not "periodic", the seasonal component is allowed to change over time
getElement("time.series") |>
as.data.frame() |>
subset(select = "trend")
Expand Down
Loading

0 comments on commit 7a23a53

Please sign in to comment.