christophsax / seasonal

R interface to X-13ARIMA-SEATS
www.seasonal.website
120 stars 27 forks source link

How can I specify that I want a additive decomposition on seas function? #308

Open mathrezende opened 1 year ago

mathrezende commented 1 year ago

I am using the seas function to run a X13 Arima on a time series. But when I call the seasonal, trend and irregular component I see that the seas function is providing me a multiplicative decomposition, but I want an additive decomposition.

Reading other issues, such as https://github.com/christophsax/seasonal/issues/225 I see that when the "transform.function" argument is changed from log to none, the algorithm changes the multiplicative to the additive decomposition.

Is there a way to specify the type of decomposition I want in the seas function or it is automatic?

Thanks!

christophsax commented 5 months ago

Sorry for the delayed response. Yes, transform.function = "none" should do the trick:

library(seasonal)
m <- seas(AirPassengers, transform.function = "none")
summary(m)
#> 
#> Call:
#> seas(x = AirPassengers, transform.function = "none")
#> 
#> Coefficients:
#>                   Estimate Std. Error z value Pr(>|z|)    
#> Constant          30.62077    4.60956   6.643 3.08e-11 ***
#> Leap Year         11.32104    3.43088   3.300 0.000968 ***
#> Weekday           -0.90361    0.17787  -5.080 3.77e-07 ***
#> Easter[1]          6.89372    1.80972   3.809 0.000139 ***
#> AR-Nonseasonal-01  0.81929    0.04903  16.709  < 2e-16 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> SEATS adj.  ARIMA: (1 0 0)(0 1 0)  Obs.: 144  Transform: none
#> AICc: 993.4, BIC:  1010  QS (no seasonality in final):    0  
#> Box-Ljung (no autocorr.):  29.2   Shapiro (normality): 0.984