library(dplyr)
# ACF, PACF, & CCF in 1 Data Frame
# - Get ACF & PACF for target (adjusted)
# - Get CCF between adjusted and volume and close
FANG %>%
filter(symbol == "FB") %>%
tk_acf_diagnostics(date, adjusted, # ACF & PACF
.ccf_vars = c(volume, close), # CCFs
.lags = 500)
# Scale with groups using group_by()
FANG %>%
group_by(symbol) %>%
tk_acf_diagnostics(date, adjusted,
.ccf_vars = c(volume, close),
.lags = "3 months")
# Apply Transformations
FANG %>%
group_by(symbol) %>%
tk_acf_diagnostics(
date, diff_vec(adjusted), # Apply differencing transformation
.lags = 0:500
)
Run the code above in your browser using DataLab