chart_zscore: 'chart_zscore'

Description Usage Arguments Value Author(s) Examples

View source: R/chart_zscore.R

Description

Supports analytics and display of seasonal data. Z-Score is computed on residuals conditional on their seasonal period. Beware that most seasonal charts in industry e.g. (NG Storage) is not detrended so results once you apply an STL decompostion will vary from the unajusted seasonal plot.

Usage

1
2
3
4
5
6
7
chart_zscore(
  df = df,
  title = "NG Storage Z Score",
  per = "yearweek",
  output = "zscore",
  chart = "seasons"
)

Arguments

df

Long data frame with columns series, date and value

title

Default is a blank space returning the unique value in df$series.

per

Frequency of seasonality "yearweek" (DEFAULT). "yearmonth", "yearquarter"

output

"stl" for STL decomposition chart, "stats" for STL fitted statistics. "res" for STL fitted data. "zscore" for residuals Z-score, "seasonal" for standard seasonal chart.

chart

"seasons" for feasts::gg_season() (DEFAULT) "series" for feasts::gg_subseries()

Value

Time series of STL decomposition residuals Z-Scores, or standard seasonal chart with feast package.

Author(s)

Philippe Cote

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
df <- eiaStocks %>% dplyr::filter(series == "NGLower48")
title <- "NGLower48"
chart_zscore(df = df, title = " ",per = "yearweek", output = "stl", chart = "seasons")
chart_zscore(df = df, title = " ",per = "yearweek", output = "stats", chart = "seasons")
chart_zscore(df = df, title = " ",per = "yearweek", output = "res", chart = "seasons")
chart_zscore(df = df, title = " ",per = "yearweek", output = "zscore", chart = "seasons")
chart_zscore(df = df, title = " ",per = "yearweek", output = "seasonal", chart = "seasons")

## End(Not run)

RTL documentation built on June 12, 2021, 5:06 p.m.