*Bounty: 50*

*Bounty: 50*

I’m working on a project which aims at analyzing the dataset U.S. Imports of Goods by Customs Basis from China (IMPCH). The main point is to make some prediction but we also want to do a little inference from the data.

As far as I know, the first step is to decompose the time series. There are at least five decomposition methods and the residual (remainder) of all of them passes the unit root tests, indicating the results are stationary, which is desired. However, now I have to pick one of them to proceed, but all seem good.

Which one should I choose, `decompose`

, `HoltWinters`

, `forecast::ets`

, `stl`

, or `seasonal::seas`

?

```
# dataset
# https://fred.stlouisfed.org/series/IMPCH
IMPCH <- read.csv("IMPCH.csv")
imp <- IMPCH$IMPCH
imp.ts <- ts(imp, frequency = 12, start = 1985)
log.imp.ts <- log(imp.ts)
ts.plot(log.imp.ts)
```

```
## Decomposition
library(tseries)
# Stock decompose
log.imp.ts.dcps <- decompose(log.imp.ts)
plot(log.imp.ts.dcps)
log.imp.ts.dcps.remainder <- na.remove(log.imp.ts.dcps$random)
adf.test(log.imp.ts.dcps.remainder)
pp.test(log.imp.ts.dcps.remainder)
kpss.test(log.imp.ts.dcps.remainder)
```

```
# Holt-Winters Filtering
log.imp.ts.hw <- HoltWinters(log.imp.ts)
plot(log.imp.ts.hw)
log.imp.ts.hw.remainder <- resid(log.imp.ts.hw)
adf.test(log.imp.ts.hw.remainder)
pp.test(log.imp.ts.hw.remainder)
kpss.test(log.imp.ts.hw.remainder)
```

```
# ETS
library(forecast)
log.imp.ts.ets <- ets(log.imp.ts)
plot(log.imp.ts.ets)
log.imp.ts.ets.remainder <- resid(log.imp.ts.ets)
adf.test(log.imp.ts.ets.remainder)
pp.test(log.imp.ts.ets.remainder)
kpss.test(log.imp.ts.ets.remainder)
```

```
# STL
log.imp.ts.stl <- stl(log.imp.ts, s.window = "periodic", robust = TRUE)
plot(log.imp.ts.stl)
log.imp.ts.stl.remainder <- log.imp.ts.stl$time.series[, "remainder"]
adf.test(log.imp.ts.stl.remainder)
pp.test(log.imp.ts.stl.remainder)
kpss.test(log.imp.ts.stl.remainder)
```

```
# X-13ARIMA-SEATS
library(seasonal)
log.imp.ts.seas <- seas(log.imp.ts)
plot(log.imp.ts.seas)
log.imp.ts.seas.remainder <- resid(log.imp.ts.seas)
adf.test(log.imp.ts.seas.remainder)
pp.test(log.imp.ts.seas.remainder)
kpss.test(log.imp.ts.seas.remainder)
```