diff --git a/dev/LICENSE.html b/dev/LICENSE.html index ce2cc69f..c13dff71 100644 --- a/dev/LICENSE.html +++ b/dev/LICENSE.html @@ -17,7 +17,7 @@
diff --git a/dev/articles/fable.html b/dev/articles/fable.html index bd1757cd..b0250677 100644 --- a/dev/articles/fable.html +++ b/dev/articles/fable.html @@ -39,7 +39,7 @@ diff --git a/dev/articles/index.html b/dev/articles/index.html index 374d30a2..a0c0ec41 100644 --- a/dev/articles/index.html +++ b/dev/articles/index.html @@ -17,7 +17,7 @@ diff --git a/dev/articles/transformations.html b/dev/articles/transformations.html index c9607f58..7fc51451 100644 --- a/dev/articles/transformations.html +++ b/dev/articles/transformations.html @@ -39,7 +39,7 @@ diff --git a/dev/authors.html b/dev/authors.html index 22a5b37c..733dd5c0 100644 --- a/dev/authors.html +++ b/dev/authors.html @@ -17,7 +17,7 @@ @@ -103,13 +103,13 @@O'Hara-Wild M, Hyndman R, Wang E (2024). fable: Forecasting Models for Tidy Time Series. -R package version 0.3.4.9000, https://github.com/tidyverts/fable, https://fable.tidyverts.org. +R package version 0.4.0.9000, https://github.com/tidyverts/fable, https://fable.tidyverts.org.
@Manual{, title = {fable: Forecasting Models for Tidy Time Series}, author = {Mitchell O'Hara-Wild and Rob Hyndman and Earo Wang}, year = {2024}, - note = {R package version 0.3.4.9000, https://github.com/tidyverts/fable}, + note = {R package version 0.4.0.9000, https://github.com/tidyverts/fable}, url = {https://fable.tidyverts.org}, }diff --git a/dev/index.html b/dev/index.html index 158add01..b24b1bed 100644 --- a/dev/index.html +++ b/dev/index.html @@ -41,7 +41,7 @@ @@ -198,8 +198,8 @@
VECM()
model.generate()
method for VECM()
models producing array errors.generate()
and IRF()
methods for VAR models.IRF()
method for ARIMA models.VECM()
and VARIMA()
models.library(tsibbledata)
aus_production %>%
- autoplot(vars(Beer, Tobacco, Bricks))
-#> Warning: Removed 20 rows containing missing values or values outside the scale range
-#> (`geom_line()`).
+ autoplot(vars(Beer, Cement))
-fit <- aus_production[complete.cases(aus_production),] %>%
- model(VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4,1,1), identification = "none"))
+fit <- aus_production %>%
+ model(VARIMA(vars(Beer, Cement) ~ pdq(4,1,1), identification = "none"))
#> Warning: NaNs produced
fit
#> # A mable: 1 x 1
-#> `VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), identification = "none")`
-#> <model>
-#> 1 <VARIMA(4,1,1) w/ mean>
+#> `VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identification = "none")`
+#> <model>
+#> 1 <VARIMA(4,1,1) w/ mean>
fit %>%
forecast(h = 50) %>%
autoplot(tail(aus_production, 100))
-#> Warning: Removed 20 rows containing missing values or values outside the scale range
-#> (`geom_line()`).
fitted(fit)
-#> # A tsibble: 194 x 5 [1Q]
+#> # A tsibble: 218 x 4 [1Q]
#> # Key: .model [1]
-#> .model Quarter Beer Bricks Cement
-#> <chr> <qtr> <dbl> <dbl> <dbl>
-#> 1 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1956 Q1 NA NA NA
-#> 2 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1956 Q2 NA NA NA
-#> 3 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1956 Q3 NA NA NA
-#> 4 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1956 Q4 NA NA NA
-#> 5 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1957 Q1 NA NA NA
-#> 6 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1957 Q2 231. 211. 582.
-#> 7 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1957 Q3 257. 235. 615.
-#> 8 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1957 Q4 323. 220. 624.
-#> 9 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1958 Q1 262. 186. 572.
-#> 10 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1… 1958 Q2 229. 215. 646.
-#> # ℹ 184 more rows
+#> .model Quarter Beer Cement
+#> <chr> <qtr> <dbl> <dbl>
+#> 1 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1956 Q1 NA NA
+#> 2 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1956 Q2 NA NA
+#> 3 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1956 Q3 NA NA
+#> 4 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1956 Q4 NA NA
+#> 5 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1957 Q1 NA NA
+#> 6 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1957 Q2 219. 586.
+#> 7 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1957 Q3 229. 637.
+#> 8 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1957 Q4 302. 649.
+#> 9 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1958 Q1 246. 561.
+#> 10 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1958 Q2 205. 629.
+#> # ℹ 208 more rows
residuals(fit)
-#> # A tsibble: 194 x 5 [1Q]
+#> # A tsibble: 218 x 4 [1Q]
#> # Key: .model [1]
-#> .model Quarter Beer Bricks Cement
-#> <chr> <qtr> <dbl> <dbl> <dbl>
-#> 1 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1956 Q1 NA NA NA
-#> 2 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1956 Q2 NA NA NA
-#> 3 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1956 Q3 NA NA NA
-#> 4 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1956 Q4 NA NA NA
-#> 5 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1957 Q1 NA NA NA
-#> 6 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1957 Q2 -3.00 2.74 21.8
-#> 7 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1957 Q3 -17.9 -10.4 -34.2
-#> 8 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1957 Q4 18.0 10.1 -30.1
-#> 9 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1958 Q1 12.8 10.2 24.0
-#> 10 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, … 1958 Q2 -5.77 1.40 -7.26
-#> # ℹ 184 more rows
+#> .model Quarter Beer Cement
+#> <chr> <qtr> <dbl> <dbl>
+#> 1 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1956 Q1 NA NA
+#> 2 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1956 Q2 NA NA
+#> 3 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1956 Q3 NA NA
+#> 4 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1956 Q4 NA NA
+#> 5 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1957 Q1 NA NA
+#> 6 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1957 Q2 9.42 17.6
+#> 7 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1957 Q3 -2.72 -51.3
+#> 8 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1957 Q4 11.6 -33.3
+#> 9 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1958 Q1 7.42 60.3
+#> 10 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identificati… 1958 Q2 1.85 -1.86
+#> # ℹ 208 more rows
tidy(fit)
-#> # A tibble: 48 × 4
+#> # A tibble: 22 × 4
#> .model term .response estimate
#> <chr> <chr> <chr> <dbl>
-#> 1 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … cons… Beer 2.55
-#> 2 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … lag(… Beer -1.02
-#> 3 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … lag(… Beer 0.0757
-#> 4 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … lag(… Beer 0.185
-#> 5 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … lag(… Beer 0.185
-#> 6 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … lag(… Beer 0.0757
-#> 7 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … lag(… Beer 0.185
-#> 8 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … lag(… Beer 0.185
-#> 9 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … lag(… Beer -0.516
-#> 10 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, 1, 1), … lag(… Beer 0.185
-#> # ℹ 38 more rows
+#> 1 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… cons… Beer 1.42
+#> 2 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… lag(… Beer -0.688
+#> 3 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… lag(… Beer -0.695
+#> 4 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… lag(… Beer 0.0678
+#> 5 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… lag(… Beer 0.0105
+#> 6 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… lag(… Beer -0.695
+#> 7 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… lag(… Beer -0.585
+#> 8 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… lag(… Beer 0.0105
+#> 9 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… lag(… Beer 0.0228
+#> 10 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… lag(… Beer 0.228
+#> # ℹ 12 more rows
glance(fit)
#> # A tibble: 1 × 5
#> .model sigma2 kronecker_indices AIC BIC
#> <chr> <list> <list> <dbl> <dbl>
-#> 1 "VARIMA(vars(Beer, Bricks, Cement) ~ p… <dbl[…]> <NULL> 20.4 21.2
+#> 1 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1,… <dbl[…]> <NULL> 14.9 15.3
report(fit)
-#> Series: Beer, Bricks, Cement
+#> Series: Beer, Cement
#> Model: VARIMA(4,1,1) w/ mean
#>
#> Coefficients for Beer:
#> constant lag(Beer,1) lag(Beer,2) lag(Beer,3) lag(Beer,4)
-#> Est. 2.5463 -1.0182 0.0757 0.1846 0.1846
-#> lag(Bricks,1) lag(Bricks,2) lag(Bricks,3) lag(Bricks,4) lag(Cement,1)
-#> Est. 0.0757 0.1846 0.1846 -0.5161 0.1846
-#> lag(Cement,2) lag(Cement,3) lag(Cement,4) lag(e_Beer,1)
-#> Est. 0.1846 -0.5161 0.0665 -0.0318
-#> lag(e_Bricks,1) lag(e_Cement,1)
-#> Est. -0.8122 0.0767
-#>
-#> Coefficients for Bricks:
-#> constant lag(Beer,1) lag(Beer,2) lag(Beer,3) lag(Beer,4)
-#> Est. 0.8533 -0.1126 -0.118 0.1031 0.1031
-#> lag(Bricks,1) lag(Bricks,2) lag(Bricks,3) lag(Bricks,4) lag(Cement,1)
-#> Est. -0.118 0.1031 0.1031 0.3723 0.1031
-#> lag(Cement,2) lag(Cement,3) lag(Cement,4) lag(e_Beer,1)
-#> Est. 0.1031 0.3723 -0.0347 0.2659
-#> lag(e_Bricks,1) lag(e_Cement,1)
-#> Est. -0.062 -0.189
+#> Est. 1.4186 -0.6881 -0.6952 0.0678 0.0105
+#> lag(Cement,1) lag(Cement,2) lag(Cement,3) lag(Cement,4) lag(e_Beer,1)
+#> Est. -0.6952 -0.5852 0.0105 0.0228 0.2283
+#> lag(e_Cement,1)
+#> Est. 0.0303
#>
#> Coefficients for Cement:
#> constant lag(Beer,1) lag(Beer,2) lag(Beer,3) lag(Beer,4)
-#> Est. 16.8306 -1.4869 -0.7411 0.9391 0.9391
-#> lag(Bricks,1) lag(Bricks,2) lag(Bricks,3) lag(Bricks,4) lag(Cement,1)
-#> Est. -0.7411 0.9391 0.9391 -0.6556 0.9391
-#> lag(Cement,2) lag(Cement,3) lag(Cement,4) lag(e_Beer,1)
-#> Est. 0.9391 -0.6556 -0.2145 -1.3557
-#> lag(e_Bricks,1) lag(e_Cement,1)
-#> Est. 1.1801 -0.2689
+#> Est. 12.6111 -2.2695 -1.4415 -0.0744 0.0142
+#> lag(Cement,1) lag(Cement,2) lag(Cement,3) lag(Cement,4) lag(e_Beer,1)
+#> Est. -1.4415 -1.2072 0.0142 0.3621 -1.4886
+#> lag(e_Cement,1)
+#> Est. 0.0916
#>
#> Residual covariance matrix:
-#> Beer Bricks Cement
-#> Beer 239.6616 19.7358 106.3942
-#> Bricks 19.7358 405.9554 493.7381
-#> Cement 106.3942 493.7381 5033.4689
+#> Beer Cement
+#> Beer 318.8404 102.5564
+#> Cement 102.5564 7693.1460
#>
-#> AIC = 20.37 BIC = 21.18
+#> AIC = 14.91 BIC = 15.25
generate(fit, h = 10)
-#> # A tsibble: 10 x 7 [1Q]
+#> # A tsibble: 10 x 6 [1Q]
#> # Key: .model, .rep [1]
-#> .model .rep Quarter .innov[,"Beer"] Beer Bricks Cement
-#> <chr> <chr> <qtr> <dbl> <dbl> <dbl> <dbl>
-#> 1 "VARIMA(vars(Beer, Bricks,… 1 2004 Q3 -21.6 405. 474. 2244.
-#> 2 "VARIMA(vars(Beer, Bricks,… 1 2004 Q4 -0.879 489. 466. 2211.
-#> 3 "VARIMA(vars(Beer, Bricks,… 1 2005 Q1 -14.4 430. 427. 2048.
-#> 4 "VARIMA(vars(Beer, Bricks,… 1 2005 Q2 -12.1 383. 478. 2126.
-#> 5 "VARIMA(vars(Beer, Bricks,… 1 2005 Q3 3.56 415. 482. 2192.
-#> 6 "VARIMA(vars(Beer, Bricks,… 1 2005 Q4 20.8 507. 443. 2072.
-#> 7 "VARIMA(vars(Beer, Bricks,… 1 2006 Q1 -1.34 438. 390. 1901.
-#> 8 "VARIMA(vars(Beer, Bricks,… 1 2006 Q2 -32.9 357. 458. 1956.
-#> 9 "VARIMA(vars(Beer, Bricks,… 1 2006 Q3 -1.42 415. 490. 2076.
-#> 10 "VARIMA(vars(Beer, Bricks,… 1 2006 Q4 -33.5 464. 447. 2037.
-#> # ℹ 1 more variable: .innov[2:3] <dbl>
+#> .model .rep Quarter .innov[,"Beer"] Beer Cement
+#> <chr> <chr> <qtr> <dbl> <dbl> <dbl>
+#> 1 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2010 Q3 -24.2 389. 2527.
+#> 2 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2010 Q4 -0.0200 502. 2433.
+#> 3 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2011 Q1 8.00 432. 2193.
+#> 4 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2011 Q2 -15.3 365. 2443.
+#> 5 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2011 Q3 -22.0 376. 2469.
+#> 6 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2011 Q4 25.2 530. 2358.
+#> 7 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2012 Q1 4.70 436. 2106.
+#> 8 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2012 Q2 -9.36 353. 2469.
+#> 9 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2012 Q3 1.28 385. 2389.
+#> 10 "VARIMA(vars(Beer, Cement) ~ pdq(… 1 2012 Q4 -0.390 532. 2347.
+#> # ℹ 1 more variable: .innov[2] <dbl>
IRF(fit, h = 10, impulse = "Beer")
-#> # A tsibble: 10 x 5 [1Q]
+#> # A tsibble: 10 x 4 [1Q]
#> # Key: .model [1]
-#> .model Quarter Beer Bricks Cement
-#> <chr> <qtr> <dbl> <dbl> <dbl>
-#> 1 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2004 Q3 1 0 0
-#> 2 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2004 Q4 0.0136 -0.378 -0.131
-#> 3 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2005 Q1 0.227 -0.0757 0.0261
-#> 4 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2005 Q2 0.247 0.0367 -0.138
-#> 5 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2005 Q3 0.662 -0.149 0.128
-#> 6 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2005 Q4 0.129 -0.257 -0.637
-#> 7 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2006 Q1 0.246 0.00538 0.196
-#> 8 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2006 Q2 0.243 -0.0572 0.0492
-#> 9 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2006 Q3 0.621 -0.140 0.0103
-#> 10 "VARIMA(vars(Beer, Bricks, Cement) ~ pdq(4, … 2006 Q4 0.182 -0.229 -0.623
+#> .model Quarter Beer Cement
+#> <chr> <qtr> <dbl> <dbl>
+#> 1 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2010 Q3 1 0
+#> 2 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2010 Q4 0.0836 -0.781
+#> 3 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2011 Q1 -0.00975 0.0600
+#> 4 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2011 Q2 0.0844 0.225
+#> 5 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2011 Q3 0.909 0.0902
+#> 6 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2011 Q4 0.114 -1.09
+#> 7 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2012 Q1 -0.0210 0.130
+#> 8 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2012 Q2 0.131 0.317
+#> 9 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2012 Q3 0.853 0.0579
+#> 10 "VARIMA(vars(Beer, Cement) ~ pdq(4, 1, 1), identifi… 2012 Q4 0.133 -1.16