# Is there a Julia package that can decompose a time series data into trend, seasonality and random?

**URL:** <https://discourse.julialang.org/t/is-there-a-julia-package-that-can-decompose-a-time-series-data-into-trend-seasonality-and-random/9518>\
**Category:** Statistics\
**Tags:** first-steps, time-series\
**Created:** [March 5, 2018, 8:29pm UTC](https://discourse.julialang.org/t/is-there-a-julia-package-that-can-decompose-a-time-series-data-into-trend-seasonality-and-random/9518 "2018-03-05T20:29:00Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![julianjohs](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@julianjohs](https://discourse.julialang.org/u/julianjohs)\
**Post date:** [October 5, 2020, 9:25pm UTC](https://discourse.julialang.org/t/is-there-a-julia-package-that-can-decompose-a-time-series-data-into-trend-seasonality-and-random/9518/21 "2020-10-05T21:25:47Z")

</div>

Hey all,

I wrapped the x12 R package in [https://github.com/julianjohs/X13](https://github.com/julianjohs/X13)! It is still in a very early stage of development and I’m working on a proper documentation. Anyway, as of now, X13 provides the basic features of the wrapped R package, i.e. the X13-ARIMA-SEATS decomposition/seasonal adjustment. I hope people reading this thread later will find this useful!

---

<div class="post-metadata">

**Author:** ![joshday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshday/32/368_2.png) [@joshday](https://discourse.julialang.org/u/joshday)\
**Post date:** [October 6, 2020, 1:36pm UTC](https://discourse.julialang.org/t/is-there-a-julia-package-that-can-decompose-a-time-series-data-into-trend-seasonality-and-random/9518/22 "2020-10-06T13:36:57Z")

</div>

As a big side note, I interviewed/gave a talk on Julia at the Census Bureau a few years ago and they were entertaining the idea of porting X13 to Julia. I think the situation was that X13 is written mostly by one guy who was about to retire and they wanted to make sure they could hire people to maintain it.

---

<div class="post-metadata">

**Author:** ![viraltux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viraltux/32/15236_2.png) [@viraltux](https://discourse.julialang.org/u/viraltux)\
**Post date:** [December 25, 2020, 2:06pm UTC](https://discourse.julialang.org/t/is-there-a-julia-package-that-can-decompose-a-time-series-data-into-trend-seasonality-and-random/9518/23 "2020-12-25T14:06:29Z")

</div>

I was also looking for one way to decompose time series in Julia so I implemented **STL** here:

> **[GitHub - viraltux/Forecast.jl: Julia package containing utilities intended...](https://github.com/viraltux/Forecast.jl)**
>
> Julia package containing utilities intended for Time Series analysis. - GitHub - viraltux/Forecast.jl: Julia package containing utilities intended for Time Series analysis.

The package also has a plot recipe that mimics the R output when plotting STL objects, however there are some differences to make it closer to the choices made in the original paper for the representation.

![co2](https://global.discourse-cdn.com/julialang/original/3X/1/0/10f30c3b720f7ccf43c104f7e67450e8c7c5472d.png).

Merry Xmas!

---

<div class="post-metadata">

**Author:** ![mthelm85](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mthelm85/32/224164_2.png) [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Post date:** [December 25, 2020, 3:52pm UTC](https://discourse.julialang.org/t/is-there-a-julia-package-that-can-decompose-a-time-series-data-into-trend-seasonality-and-random/9518/24 "2020-12-25T15:52:17Z")

</div>

[StateSpaceModels.jl](https://github.com/LAMPSPUC/StateSpaceModels.jl) is a really nice option too.

---

<div class="post-metadata">

**Author:** ![guilhermebodin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guilhermebodin/32/6982_2.png) [@guilhermebodin](https://discourse.julialang.org/u/guilhermebodin)\
**Post date:** [June 8, 2021, 3:57pm UTC](https://discourse.julialang.org/t/is-there-a-julia-package-that-can-decompose-a-time-series-data-into-trend-seasonality-and-random/9518/25 "2021-06-08T15:57:22Z")

</div>

I was thinking of creating an artifact with the original FORTRAN code, does anybody know the steps to do that?

---

<div class="post-metadata">

**Author:** ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Post date:** [June 8, 2021, 6:18pm UTC](https://discourse.julialang.org/t/is-there-a-julia-package-that-can-decompose-a-time-series-data-into-trend-seasonality-and-random/9518/26 "2021-06-08T18:18:32Z")

</div>

Maybe take a look at [Home · BinaryBuilder.jl](https://docs.binarybuilder.org/dev/) Also here [Calling C and Fortran Code · The Julia Language](https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/) for some ideas on how to do it.

[Previous page](https://discourse.julialang.org/t/is-there-a-julia-package-that-can-decompose-a-time-series-data-into-trend-seasonality-and-random/9518.md?page=1)
