# Special method for forecasting on time-series clusters in R?

I'm doing a project related to identifying sales dynamics. My database contains 26 weeks after launching the product (so 26 time-series observations equally spaced in time).

I used two methods of time-series clustering to see which patterns dominate in different groups (clustering by units_sold_that_week). The first method is based on k-medoids and the second one connected with clustering by parameters of growth models.

My next step is to make forecasts based on these clusters. Is there any special method for forecasting based on time-series clusters? In my project, I have to combine the topic of clustering and forecasting on clusters.

I am running my analyses in R, so I would be grateful for any suggestions regarding R procedures.

Please note that I am relatively new to time series analysis so any clarity you could provide, on R or any package you could recommend that would help accomplish this task efficiently, would be appreciated.

• As @GiorgioSpedicato suggests, dynamic time warping (DTW) is the way to go. There is a very nice example in the link suggested by Giorgio Spedicato that clearly explains how to cluster time series, then you could apply any forecasting method in R forecast Package. It looks like you are using weekly data, you could use stlf function in R forecast package which handles high frequency time series. – forecaster Apr 1 '14 at 22:21
• Try for PSF (researchgate.net/publication/…). The R package is available CRAN named as PSF. – Neeraj Dhanraj Jul 8 '16 at 18:38