Short, medium and long term forecasting of time series using the L-Co-R algorithm