Summaries of relationships between and within time series.
vic_2014 <- vic_elec %>%
filter(year(Time) == 2014)
vic_2014 %>%
pivot_longer(Demand:Temperature) %>%
ggplot(aes(x = Time, y = value)) +
geom_line() +
facet_wrap(~ name, scales = "free_y")
A scatterplot clarifies that, while electricity demand generally goes up in the cooler months, the very highest demand happens during high heat days.
ggplot(vic_2014, aes(x = Temperature, y = Demand)) +
geom_point(alpha = 0.6, size = 0.7)
lagged <- vic_2014[c(2:nrow(vic_2014), 2), ] %>%
setNames(str_c("lagged_", colnames(vic_2014)))
ggplot(bind_cols(vic_2014, lagged), aes(x = Temperature, y = Demand)) +
geom_point(alpha = 0.6, size = 0.7) +
geom_segment(
aes(xend = lagged_Temperature, yend = lagged_Demand),
size = .4, alpha = 0.5
)
cor(vic_2014$Temperature, vic_2014$Demand)
[1] 0.2797854
recent_production <- aus_production %>%
filter(year(Quarter) > 2000)
gg_lag(recent_production, Beer, geom = "point")
Indeed, we can confirm this by looking at the original data.
ggplot(as_tsibble(a10), aes(x = time(index), y = value)) +
geom_line()
acf_data <- ACF(as_tsibble(a10), lag_max = 100)
autoplot(acf_data)
For attribution, please cite this work as
Sankaran (2024, Jan. 7). STAT 436 (Spring 2024): Cross and Auto-Correlation. Retrieved from https://krisrs1128.github.io/stat436_s24/website/stat436_s24/posts/2024-12-27-week06-04/
BibTeX citation
@misc{sankaran2024cross, author = {Sankaran, Kris}, title = {STAT 436 (Spring 2024): Cross and Auto-Correlation}, url = {https://krisrs1128.github.io/stat436_s24/website/stat436_s24/posts/2024-12-27-week06-04/}, year = {2024} }