2014-12-04 74 views
1

我有一個樣本數據預測值來了相同中的R

 
Sno  period  year_quarter country   city  sales_revenue 
1  1/1/2009  2009-Q1  Argentina  Buenos Aires  3008 
2  1/4/2009  2009-Q2  Argentina  Buenos Aires  3244 
3  1/7/2009  2009-Q3  Argentina  Buenos Aires  8000 
4  1/10/2009  2009-Q4  Argentina  Buenos Aires  8719 
5  1/1/2010  2010-Q1  Argentina  Buenos Aires  3008 
6  1/4/2010  2010-Q2  Argentina  Buenos Aires  3244 
7  1/7/2010  2010-Q3  Argentina  Buenos Aires  78 
8  1/10/2010  2010-Q4  Argentina  Buenos Aires  7379 
9  1/1/2011  2011-Q1  Argentina  Buenos Aires  3735 
10  1/4/2011  2011-Q2  Argentina  Buenos Aires  7339 
11  1/7/2011  2011-Q3  Argentina  Buenos Aires  17240 
12  1/10/2011  2011-Q4  Argentina  Buenos Aires  20465 
13  1/1/2012  2012-Q1  Argentina  Buenos Aires  13134 
14  1/4/2012  2012-Q2  Argentina  Buenos Aires  15039 


我預測三季度即2012 Q3 2012 Q4和2013 Q1與ETS(A,N,N)的幫助。代碼的預測是如下

retail_data.xts<-xts(retail_data$sales_revenue, retail_data$period); 
retail_data.ts <- as.ts(retail_data.xts); 
retail_data.ets <- ets(retail_data.ts,model="ANN"); 
retail_data.fore <- forecast(retail_data.ets, h=4); 
plot(retail_data.fore); 

計算的結果是

 
Point Forecast Lo 80 Hi 80  Lo 95 Hi 95 
15  14905.37 8925.968 20884.78 5760.6608 24050.09 
16  14905.37 7202.071 22608.68 3124.1881 26686.56 
17  14905.37 5798.868 24011.88 978.1739 28832.58 
18  14905.37 4584.713 25226.04 -878.7150 30689.46 

所有的預測值是在S AME。
是由於小數據集或我的方法不好?
需要建議。

回答

1

通過使用model = "ANN"您正在擬合具有附加誤差(A)的簡單指數平滑模型。有關可能的模型,請參見help(ets)或將模型參數留給自動模型選擇。你的模型沒有趨勢,也沒有季節性(NN)。

有關可能模型的數學詳細信息,請參閱ets的幫助頁上所述的A state space framework for automatic forecasting using exponential smoothing methods。如第441和442頁所述,系列級l_t是原始時間系列Y_t的線性函數。在沒有趨勢和季節性的模型(例如ANN)中,預測F_ {t + h}不依賴於h,F_ {t + h} = l_t。這就是爲什麼上述例子中的預測對於所有視界都是相同的,只有置信區間隨着h增加而增大。

我想在哪裏討論哪種模型是合適的,但我認爲在短時間序列中,使用指數平滑的方法是合理的。

0

此外,我發現,如果你有時間序列數值較小,那麼你會得到相同的預測。我想這是因爲這個模型無法從可用的時間序列中推導出季節性或趨勢分量。但是當我包含更多的過去數據時,我得到了更好的預測。