robjhyndman / forecast

Forecasting Functions for Time Series and Linear Models
http://pkg.robjhyndman.com/forecast
1.11k stars 341 forks source link

ggCcf not showing lag=0 #894

Closed espher1987 closed 2 years ago

espher1987 commented 2 years ago

Hi to everyone, this is my MWE:

The exact problem is with ggCff not showing lag = 0 coefficient . i don't understand why not showing this value when ccf and forecast::Ccf show this values.

library(forecast)
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
library(vars)
#> Loading required package: MASS
#> Loading required package: strucchange
#> Loading required package: zoo
#> 
#> Attaching package: 'zoo'
#> The following objects are masked from 'package:base':
#> 
#>     as.Date, as.Date.numeric
#> Loading required package: sandwich
#> Loading required package: urca
#> Loading required package: lmtest
a <- Canada[,3]
b <- Canada[,4]

ccf(x = a,y = b)

Ccf(x = a,y = b)

ggCcf(x = a,y = b)

Created on 2021-11-22 by the reprex package (v2.0.1)

Thanks for this amazing package!!!

robjhyndman commented 2 years ago

Thanks. Fixed in https://github.com/robjhyndman/forecast/commit/105223ed4b08c6a7c283862d1fc8b9b73bda859b