Hands on forecasting the time series with limited cycles

甩锅大招

It's kind of a tricky problem on forecasting the time series without a couple of complete cycles because we can not confidently infer the trend and seasonality only using a few data. However, this situation might happen quite often especially when the object to be forecasted is at an early stage and just begin generating data. For example, the shop only starts their business for 14th months, and your job is to predict the revenue of the 15th months. Therefore, the question pops up: how can I include the trend and seasonality in our model?
We believe that the key to this problem is to blend both qualitative and quantitative approach, which utilize the expert knowledge and historical data to fix the trends for the specific month. With this notion, we try out a few of methods to deal with this issue.

Semi-automatically learn the seasonality: Rolling and Copying

Moving forward the existing data to the future, in other words, we just copy the data of a whole year to the future which hasn't happened yet. Also, you can manually multiply a factor to adjust the trends. By doing this, we can successfully include the real month number as a feature without impairing the performance of the model.
However, this method can be problematic. Say the revenue forecasting, if we rolling forward the revenue of a shop, chances are the revenue may be far from the truth, because we simply assume that the trend goes linearly year by year, while the revenue may not follow the linearity assumption. Still, the further we predict the riskier we are.
Another problem is the multi-factors issue. Some shops may show a different pattern at the early stage, if we simply apply the rolling and copying strategy on each shop, we just replicate the initial data which may be totally wrong. Actually, we can remove the initial stage by setting a threshold, but the question is how to find that threshold? What's more, such a pattern may affect the revenue all the time. So, currently, there is no fix to this problem.

Manually pick the ratio of the next month

Instead of learning the seasonality, we may reduce the complexity of our problem, that is to say, we do not guess the whole trend, we carefully make our decision for the revenue of the next month. This could be much reasonable, because expert only looks at one month at a time, more importantly, the next month is highly correlated with the current month, and we also have a lot of information to help us make a more robust guessing.

So, how can we involve the ratio?

The most straightforward answer is to directly multiply the factor, however, in most cases, the dist. of the value do not follow the uniform assumption. Therefore, we'd better use the quantile to estimate the trend. More specifically, we use the quantile regression giving the best quantile prediction of my current month, then the expert manually tunes the factor on the quantile. Say the revenue case, if we want to predict the Jan. revenue, so we take our Dec. as the validation set to train a regressor and a quantile. The expert may know that the Dec. has much lower revenue compared to that in Nov., so the first quantile may be low, while the revenue in Jan. usually will be sky-rocketing owing to the coming spring festival. So, if we increase the quantile, we are more likely getting close to the truth. Comparing with the linear multiplication way, this method will be much safer, because it considers the dist.

Next question is how to quantify the ratio?

Usually, we can refer to the historical data. We can use the historical ratio which is the number of the median revenue of Jan. divided by that in Dec. , as our anchor, then we tune a little bit according to the expert's personal experience. The underlying intuition is that the median of Dec. may shift according to the ratio which meanly controlled by the joint efforts of the seasonality and the market trend.

Is this method reasonable?

It's hard to say. When digging into this method, we may be hard to prove it is totally right, because we cannot adjust the quantile for every shop only by the median of the last month. Some shops' revenue may change violently, while some may be the opposite.

Can we improve it?

Though it does make sense of adjusting the quantile instead of linearly multiplication, we still take a step further to this question in a fine-grained manner, which is to cluster those shops by their features (comparing with the clustering results by only using revenue which can be seen as the ground truth), then calculate the ratio accordingly. Also, we can even consider building different models for different clusters, such as high income, median income and low income. We believe these methods would be more reasonable, and it also minimizes the risks when making the decision of picking the ratio.

Conclusion

We've discussed two methods on fitting models to short time series. Both of them include guided statistical analysis that incorporates human judgement. As a result, it reduces judgement bias underlying in the data. The second one may be promising according to our practice because it does make sense in simplifying the problem and trying to model in a small granularity. But it should be noted that this method would suffer from overfitting owing to the limited size of the cluster. So, there is a trade-off here, and it required a lot of experiments to find the best choice of the number of clusters.

Reference

[1]. https://www.datascience.com/blog/how-to-forecast-with-limited-historical-data/

[2]. http://www.statsoft.com/Textbook/Time-Series-Analysis

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,686评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,668评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 158,160评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,736评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,847评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,043评论 1 291
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,129评论 3 410
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,872评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,318评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,645评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,777评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,470评论 4 333
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,126评论 3 317
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,861评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,095评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,589评论 2 362
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,687评论 2 351

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,312评论 0 10
  • 2017新年伊始,开启我的一年读书300本计划。用一小时时间速读,用一生时间精读,向往那种阅读无数后升华而得的快乐...
    郦无悔阅读 329评论 1 1
  • 践行 教你如何接近事实的真相 今天听了古典老师的教你如何接近事实的真相,发现人脑真的是很容易被忽悠的,自古深情留不...
    刘你你阅读 463评论 0 3