I am doing time series analysis using R. I have to decompose my data into trend, seasonal and random component. I have weekly data for 3 years. I have found two functions in R —

`stl()`

and`decompose()`

. I have read that`stl()`

is not good for multiplicative decomposition. Can anybody tell me in what scenario these functions can be used?

**Answer**

I would say `STL`

. STL does trend and seasonal see: http://www.wessa.net/download/stl.pdf

Decompose only does seasonal see the documentation here: http://stat.ethz.ch/R-manual/R-devel/library/stats/html/decompose.html

When you work with them be sure to include your trend type (multiplicative, additive) and season type (multiplicative, additive). Trends can also sometimes have a damping factor too.

By multiplicative decomposition I assume you mean in the case for trend. You are not likely to use multiplicative decomposition unless you are decomposing a exponential growth function.

**Attribution***Source : Link , Question Author : Arushi , Answer Author : sfjac*