Closed andreranza closed 7 months ago
library(cbar.sa)
library(seasonal)
#>
#> Attaching package: 'seasonal'
#> The following object is masked from 'package:cbar.sa':
#>
#> cpi
plot(budg_exp)
plot(decompose(budg_exp))
monthplot(budg_exp)
m0 <- seas(
x = budg_exp,
regression.variables = c("const", "ao2017.4"),
arima.model = "(2 0 0)(0 1 0)",
regression.aictest = NULL,
outlier = NULL,
transform.function = "none"
)
#> Model used in SEATS is different: (1 0 1)(0 1 0)
summary(m0)
#>
#> Call:
#> seas(x = budg_exp, transform.function = "none", regression.aictest = NULL,
#> outlier = NULL, regression.variables = c("const", "ao2017.4"),
#> arima.model = "(2 0 0)(0 1 0)")
#>
#> Coefficients:
#> Estimate Std. Error z value Pr(>|z|)
#> Constant 387.7303 132.6318 2.923 0.00346 **
#> AO2017.4 -2167.5414 471.7620 -4.595 4.34e-06 ***
#> AR-Nonseasonal-01 0.1612 0.1291 1.248 0.21192
#> AR-Nonseasonal-02 0.1691 0.1301 1.300 0.19373
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> SEATS adj. ARIMA: (2 0 0)(0 1 0) Obs.: 62 Transform: none
#> AICc: 933.3, BIC: 942.4 QS (no seasonality in final): 0
#> Box-Ljung (no autocorr.): 26.16 Shapiro (normality): 0.9913
#> Messages generated by X-13:
#> Notes:
#> - Model used for SEATS decomposition is different from the model
#> estimated in the regARIMA modeling module of X-13ARIMA-SEATS.
m1 <- seas(
x = budg_exp,
regression.variables = c("const", "td", "ao2017.4"),
arima.model = "(2 0 0)(0 1 0)",
regression.aictest = NULL,
outlier = NULL,
transform.function = "none"
)
summary(m1)
#>
#> Call:
#> seas(x = budg_exp, transform.function = "none", regression.aictest = NULL,
#> outlier = NULL, regression.variables = c("const", "td", "ao2017.4"),
#> arima.model = "(2 0 0)(0 1 0)")
#>
#> Coefficients:
#> Estimate Std. Error z value Pr(>|z|)
#> Constant 350.3435 149.1736 2.349 0.01885 *
#> Mon -250.0954 124.1819 -2.014 0.04402 *
#> Tue -21.8921 149.7580 -0.146 0.88378
#> Wed -312.1866 123.9575 -2.518 0.01179 *
#> Thu -258.8729 120.8140 -2.143 0.03213 *
#> Fri 337.1366 123.3984 2.732 0.00629 **
#> Sat 207.2222 140.6061 1.474 0.14054
#> Leap Year -601.6833 195.6765 -3.075 0.00211 **
#> AO2017.4 -2519.8592 442.7452 -5.691 1.26e-08 ***
#> AR-Nonseasonal-01 0.2886 0.1271 2.270 0.02322 *
#> AR-Nonseasonal-02 0.2529 0.1276 1.982 0.04745 *
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> SEATS adj. ARIMA: (2 0 0)(0 1 0) Obs.: 62 Transform: none
#> AICc: 924.6, BIC: 942.4 QS (no seasonality in final): 0
#> Box-Ljung (no autocorr.): 13.98 Shapiro (normality): 0.983
m2 <- seas(
x = budg_exp,
regression.variables = c("const", "td1coef", "ao2017.4"),
arima.model = "(2 0 0)(0 1 0)",
regression.aictest = NULL,
outlier = NULL,
transform.function = "none"
)
summary(m2)
#>
#> Call:
#> seas(x = budg_exp, transform.function = "none", regression.aictest = NULL,
#> outlier = NULL, regression.variables = c("const", "td1coef",
#> "ao2017.4"), arima.model = "(2 0 0)(0 1 0)")
#>
#> Coefficients:
#> Estimate Std. Error z value Pr(>|z|)
#> Constant 367.7669 140.4775 2.618 0.00885 **
#> Weekday -63.0671 46.7028 -1.350 0.17689
#> Leap Year -700.6442 228.7871 -3.062 0.00220 **
#> AO2017.4 -2252.1083 430.7000 -5.229 1.7e-07 ***
#> AR-Nonseasonal-01 0.2288 0.1290 1.773 0.07627 .
#> AR-Nonseasonal-02 0.1973 0.1305 1.512 0.13061
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> SEATS adj. ARIMA: (2 0 0)(0 1 0) Obs.: 62 Transform: none
#> AICc: 927.7, BIC: 939.9 QS (no seasonality in final): 0
#> Box-Ljung (no autocorr.): 16.3 Shapiro (normality): 0.9698
Created on 2024-01-18 with reprex v2.0.2
Merging this
Currently, using
cpi_const
andtd1coef
happens to be significant. I'll continue the search, so this is still WIP, and see whether I can find something where the effect is even more relevant. I'll make sure to comment later when I finish the search. However, @christophsax, since there's not much time this morning, you might be already happy with this to elaborate something on so I am putting this out early.Created on 2024-01-18 with reprex v2.0.2