-
Notifications
You must be signed in to change notification settings - Fork 167
/
week8.R
39 lines (31 loc) · 814 Bytes
/
week8.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
library(fpp3)
## EGYPTIAN EXPORTS
global_economy |>
filter(Code == "EGY") |>
autoplot(Exports) +
labs(y = "% of GDP", title = "Egyptian Exports")
fit <- global_economy |>
filter(Code == "EGY") |>
model(ARIMA(Exports, stepwise = FALSE, approximation = FALSE,
order_constraint = p + q <= 10))
report(fit)
gg_tsresiduals(fit)
fit |>
forecast(h = 50) |>
autoplot(global_economy) +
labs(y = "% of GDP", title = "Egyptian Exports")
global_economy |>
filter(Code == "EGY") |>
ACF(Exports) |>
autoplot()
global_economy |>
filter(Code == "EGY") |>
PACF(Exports) |>
autoplot()
global_economy |>
filter(Code == "EGY") |>
gg_tsdisplay(Exports, plot_type = "partial")
fit1 <- global_economy |>
filter(Code == "EGY") |>
model(ARIMA(Exports ~ pdq(4, 0, 0)))
report(fit1)