【时间序列分析】序列趋势分析公式总结

  • Post author:
  • Post category:其他



Time Series Analysis

author:zoxiii


【参考文献】王燕. 应用时间序列分析-第5版[M]. 中国人民大学出版社, 2019.



1、线性拟合



(1)基本思想

当序列的时序图出现显著的线性特征时,可使用线性模型去拟合



(2)公式





x

t

=

a

+

b

t

+

I

t

x_t=a+bt+I_t







x










t




















=








a




+








b


t




+









I










t



























E

(

I

t

)

=

0

,

V

a

r

(

I

t

)

=

σ

2

E(I_t)=0,Var(I_t)=\sigma^2






E


(



I










t


















)




=








0


,




V


a


r


(



I










t


















)




=









σ










2














其中随机波动:



{

I

t

}

\{I_t\}






{




I










t


















}




消除随机波动的影响之后该序列的长期趋势:



T

t

=

a

+

b

t

T_t=a+bt







T










t




















=








a




+








b


t






2、曲线拟合



(1)基本思想

当序列的时序图出现非线性特征时,可使用曲线模型去拟合



(2)二次型拟合公式





x

t

=

a

+

b

t

+

c

t

2

+

I

t

  

  

x

t

=

a

+

c

t

2

+

I

t

x_t=a+bt+ct2+I_t~~或~~x_t=a+ct2+I_t







x










t




















=








a




+








b


t




+








c


t


2




+









I










t






























x










t




















=








a




+








c


t


2




+









I










t



























t

2

=

t

2

t2=t^2






t


2




=









t










2


















E

(

I

t

)

=

0

,

V

a

r

(

I

t

)

=

σ

2

E(I_t)=0,Var(I_t)=\sigma^2






E


(



I










t


















)




=








0


,




V


a


r


(



I










t


















)




=









σ










2














(3)指数型拟合公式





T

t

=

a

b

t

T_t=ab^t







T










t




















=








a



b










t














取对数,令





T

t

=

l

n

T

t

,

a

=

l

n

a

,

b

=

l

n

b

,

T_t’=lnT_t,a’=lna,b’=lnb,







T










t































=








l


n



T










t


















,





a
























=








l


n


a


,





b
























=








l


n


b


,







得到





T

t

=

a

+

b

t

T_t’=a’+b’t







T










t































=









a
























+









b






















t







3、移动平均法



(1)基本思想

用一定时间间隔之间的平均值作为某一期的估计值

如何确定n?

  1. 考虑n=周期长度,如4、12
  2. 考虑平滑性,n越大拟合曲线越平滑
  3. 考虑趋势近期敏感程度,n越小趋势对近期变化越敏感



(2)n期中心移动平均法:分析趋势



n为奇数





x

~

t

=

1

n

(

x

t

n

1

2

+

x

t

n

1

2

+

1

+

.

.

.

+

x

t

+

n

1

2

)

\widetilde x_t=\frac{1}{n}(x_{t-\frac{n-1}{2}}+x_{t-\frac{n-1}{2}+1}+…+x_{t+\frac{n-1}{2}})














x






















t




















=



















n














1




















(



x











t

















2
















n





1








































+









x











t

















2
















n





1





















+


1





















+








.


.


.




+









x











t


+














2
















n





1






































)







n为偶数





x

~

t

=

1

n

(

1

2

x

t

n

2

+

x

t

n

2

+

1

+

.

.

.

+

x

t

n

2

1

+

1

2

x

t

+

n

2

)

\widetilde x_t=\frac{1}{n}(\frac{1}{2}x_{t-\frac{n}{2}}+x_{t-\frac{n}{2}+1}+…+x_{t-\frac{n}{2}-1}+\frac{1}{2}x_{t+\frac{n}{2}})














x






















t




















=



















n














1




















(













2














1





















x











t

















2
















n








































+









x











t

















2
















n





















+


1





















+








.


.


.




+









x











t

















2
















n
























1





















+



















2














1





















x











t


+














2
















n






































)







(3)n期移动平均法:预测





x

~

t

=

1

n

(

x

t

+

x

t

1

+

.

.

.

+

x

t

n

+

1

)

\widetilde x_t=\frac{1}{n}(x_t+x_{t-1}+…+x_{t-n+1})














x






















t




















=



















n














1




















(



x










t




















+









x











t





1





















+








.


.


.




+









x











t





n


+


1



















)







(4)n期中心移动平均法—> 提取低阶趋势







x

t

=

a

+

b

t

+

ε

t

x_t=a+bt+\varepsilon_t







x










t




















=








a




+








b


t




+









ε










t





















进行



n

=

2

k

+

1

n=2k+1






n




=








2


k




+








1





期的中心移动平均





x

~

t

=

1

2

k

+

1

i

=

k

k

x

t

+

i

=

1

2

k

+

1

i

=

k

k

(

a

+

b

t

+

b

i

+

ε

t

+

i

)

=

a

+

b

t

\widetilde x_t \\ =\cfrac{1}{2k+1}\sum_{i=-k}^{k}x_{t+i} \\ =\cfrac{1}{2k+1}\sum_{i=-k}^{k}(a+bt+bi+\varepsilon_{t+i}) \\ =a+bt














x






















t


























=



















2


k




+




1














1































i


=





k



















k





















x











t


+


i



























=



















2


k




+




1














1































i


=





k



















k


















(


a




+








b


t




+








b


i




+









ε











t


+


i



















)










=








a




+








b


t











x

t

=

a

+

b

t

+

c

t

2

+

ε

t

x_t=a+bt+ct^2+\varepsilon_t







x










t




















=








a




+








b


t




+








c



t










2











+









ε










t





















进行



n

=

2

k

+

1

n=2k+1






n




=








2


k




+








1





期的中心移动平均





x

~

t

=

1

2

k

+

1

i

=

k

k

x

t

+

i

=

1

2

k

+

1

i

=

k

k

(

a

+

b

t

+

b

i

+

c

(

t

+

i

)

2

+

ε

t

+

i

)

=

a

+

b

t

+

c

t

2

+

c

k

(

k

+

1

)

3

\widetilde x_t \\ =\cfrac{1}{2k+1}\sum_{i=-k}^{k}x_{t+i} \\ =\cfrac{1}{2k+1}\sum_{i=-k}^{k}(a+bt+bi+c(t+i)^2+\varepsilon_{t+i}) \\ =a+bt+ct^2+\cfrac{ck(k+1)}{3}














x






















t


























=



















2


k




+




1














1































i


=





k



















k





















x











t


+


i



























=



















2


k




+




1














1































i


=





k



















k


















(


a




+








b


t




+








b


i




+








c


(


t




+








i



)










2











+









ε











t


+


i



















)










=








a




+








b


t




+








c



t










2











+



















3














c


k


(


k




+




1


)























  • 可以完整地提取二次趋势信息,但拟合序列和原序列会有一个截距的小偏差







x

t

=

a

+

b

t

+

c

t

2

+

ε

t

x_t=a+bt+ct^2+\varepsilon_t







x










t




















=








a




+








b


t




+








c



t










2











+









ε










t





















进行



n

=

2

k

n=2k






n




=








2


k





期的中心移动平均





x

~

t

=

1

2

k

[

i

=

k

k

x

t

+

i

1

2

(

x

t

k

+

x

t

+

k

)

]

=

1

2

k

[

i

=

k

k

(

a

+

b

t

+

b

i

+

c

(

t

+

i

)

2

+

ε

t

+

i

)

1

2

(

a

+

b

t

b

k

+

c

(

t

k

)

2

)

=

ε

t

k

+

a

+

b

t

+

b

k

+

c

(

t

+

k

)

2

+

ε

t

+

k

]

=

1

2

k

[

2

k

a

+

2

k

b

t

+

2

k

c

t

2

+

2

c

k

2

(

k

+

1

)

3

1

2

(

2

a

+

2

b

t

+

2

c

t

2

+

2

c

k

2

)

]

=

1

2

k

[

(

2

k

1

)

a

+

(

2

k

1

)

b

t

+

(

2

k

1

)

c

t

2

+

2

3

c

k

3

+

2

3

c

k

2

c

k

2

]

=

1

2

k

[

(

2

k

1

)

a

+

(

2

k

1

)

b

t

+

(

2

k

1

)

c

t

2

+

c

k

2

(

2

k

1

)

3

]

=

2

k

1

2

k

(

a

+

b

t

+

c

t

2

+

c

k

2

3

)

\widetilde x_t \\ =\cfrac{1}{2k}[\sum_{i=-k}^{k}x_{t+i}-\cfrac{1}{2}(x_{t-k}+x_{t+k})] \\ =\cfrac{1}{2k}[\sum_{i=-k}^{k}(a+bt+bi+c(t+i)^2+\varepsilon_{t+i})-\cfrac{1}{2}(a+bt-bk+c(t-k)^2)=\varepsilon_{t-k}+a+bt+bk+c(t+k)^2+\varepsilon_{t+k}] \\ =\cfrac{1}{2k}[2ka+2kbt+2kct^2+\cfrac{2ck^2(k+1)}{3}-\cfrac{1}{2}(2a+2bt+2ct^2+2ck^2)] \\ =\cfrac{1}{2k}[(2k-1)a+(2k-1)bt+(2k-1)ct^2+\cfrac{2}{3}ck^3+\cfrac{2}{3}ck^2-ck^2] \\ =\cfrac{1}{2k}[(2k-1)a+(2k-1)bt+(2k-1)ct^2+\cfrac{ck^2(2k-1)}{3}] \\ =\cfrac{2k-1}{2k}(a+bt+ct^2+\cfrac{ck^2}{3})














x






















t


























=



















2


k














1




















[











i


=





k



















k





















x











t


+


i









































2














1




















(



x











t





k





















+









x











t


+


k



















)


]










=



















2


k














1




















[











i


=





k



















k


















(


a




+








b


t




+








b


i




+








c


(


t




+








i



)










2











+









ε











t


+


i



















)
























2














1




















(


a




+








b


t













b


k




+








c


(


t













k



)










2









)




=









ε











t





k





















+








a




+








b


t




+








b


k




+








c


(


t




+








k



)










2











+









ε











t


+


k



















]










=



















2


k














1




















[


2


k


a




+








2


k


b


t




+








2


k


c



t










2











+



















3














2


c



k










2









(


k




+




1


)










































2














1




















(


2


a




+








2


b


t




+








2


c



t










2











+








2


c



k










2









)


]










=



















2


k














1




















[


(


2


k













1


)


a




+








(


2


k













1


)


b


t




+








(


2


k













1


)


c



t










2











+



















3














2




















c



k










3











+



















3














2




















c



k










2




















c



k










2









]










=



















2


k














1




















[


(


2


k













1


)


a




+








(


2


k













1


)


b


t




+








(


2


k













1


)


c



t










2











+



















3














c



k










2









(


2


k









1


)




















]










=



















2


k














2


k









1




















(


a




+








b


t




+








c



t










2











+



















3














c



k










2



























)







4、指数平滑法



(1)简单指数平滑



基本思想

适用于既无长期趋势,又无季节效应的序列



对序列修匀





x

~

t

=

α

x

t

+

α

(

1

α

)

x

t

1

+

α

(

1

α

)

2

x

t

2

+

.

.

.

\widetilde x_t=\alpha x_t+\alpha(1-\alpha)x_{t-1}+\alpha(1-\alpha)^2x_{t-2}+…














x






















t




















=








α



x










t




















+








α


(


1













α


)



x











t





1





















+








α


(


1













α



)










2










x











t





2





















+








.


.


.











x

~

t

=

α

x

t

+

(

1

α

)

x

~

t

1

\widetilde x_t=\alpha x_t+(1-\alpha)\widetilde x_{t-1}














x






















t




















=








α



x










t




















+








(


1













α


)










x























t





1
























平滑系数



0

<

α

<

1

0 < \alpha < 1






0




<








α




<








1




指定



x

~

0

=

x

1

\widetilde x_0=x_1














x






















0




















=









x










1






















未来预测

根据预测公式:





x

^

T

+

1

=

x

~

T

\hat x_{T+1}=\widetilde x_T














x






^
















T


+


1





















=
















x






















T



























x

^

T

=

x

~

T

1

\hat x_T=\widetilde x_{T-1}














x






^















T




















=
















x























T





1
























1期预测值:





x

^

T

+

1

=

x

~

T

=

α

x

T

+

α

(

1

α

)

x

T

1

+

α

(

1

α

)

2

x

T

2

+

.

.

.

=

α

x

T

+

(

1

α

)

x

^

T

\hat x_{T+1} \\ =\widetilde x_T \\ =\alpha x_T+\alpha(1-\alpha)x_{T-1}+\alpha(1-\alpha)^2x_{T-2}+… \\ =\alpha x_T+(1-\alpha)\hat x_T














x






^
















T


+


1



























=
















x






















T


























=








α



x










T




















+








α


(


1













α


)



x











T





1





















+








α


(


1













α



)










2










x











T





2





















+








.


.


.










=








α



x










T




















+








(


1













α


)










x






^















T























2期预测值:





x

^

T

+

2

=

α

x

T

+

1

+

α

(

1

α

)

x

T

+

α

(

1

α

)

2

x

T

1

+

.

.

.

=

α

x

^

T

+

1

+

(

1

α

)

x

^

T

+

1

=

x

^

T

+

1

\hat x_{T+2} \\ =\alpha x_{T+1}+\alpha(1-\alpha)x_T+\alpha(1-\alpha)^2x_{T-1}+… \\ =\alpha \hat x_{T+1}+(1-\alpha)\hat x_{T+1} \\ =\hat x_{T+1}














x






^
















T


+


2



























=








α



x











T


+


1





















+








α


(


1













α


)



x










T




















+








α


(


1













α



)










2










x











T





1





















+








.


.


.










=








α










x






^
















T


+


1





















+








(


1













α


)










x






^
















T


+


1



























=
















x






^
















T


+


1
























即未来预测的值都等于序列平滑的最后一期的值:





x

^

T

+

l

=

x

^

T

+

1

=

x

~

T

,

l

2

\hat x_{T+l}=\hat x_{T+1}=\widetilde x_T,l \ge 2














x






^
















T


+


l





















=
















x






^
















T


+


1





















=
















x






















T


















,




l













2







(2)Holt两参数指数平滑



基本思想

适用于有长期趋势,无季节效应的序列

原始数据序列



{

x

t

}

\{x_t\}






{




x










t


















}





,

趋势序列



{

r

t

}

\{r_t\}






{




r










t


















}








x

^

t

=

x

t

1

+

r

t

1

\hat x_t=x_{t-1}+r_{t-1}














x






^















t




















=









x











t





1





















+









r











t





1
























过去拟合:对原始数据序列和趋势序列修匀





x

~

t

=

α

x

t

+

(

1

α

)

(

x

~

t

1

+

r

t

1

)

\widetilde x_t=\alpha x_t+(1-\alpha)(\widetilde x_{t-1}+r_{t-1})














x






















t




















=








α



x










t




















+








(


1













α


)


(










x























t





1





















+









r











t





1



















)











r

t

=

γ

(

x

~

t

x

~

t

1

)

+

(

1

γ

)

r

t

1

r_t=\gamma(\widetilde x_t-\widetilde x_{t-1})+(1-\gamma)r_{t-1}







r










t




















=








γ


(










x






















t





































x























t





1



















)




+








(


1













γ


)



r











t





1
























平滑系数



0

<

α

,

γ

<

1

0 < \alpha,\gamma < 1






0




<








α


,




γ




<








1




指定



x

~

0

=

x

1

,

r

0

=

x

n

+

1

  

x

1

n

\widetilde x_0=x_1,r_0=\frac{x_{n+1}~~-x_1}{n}














x






















0




















=









x










1


















,





r










0




















=




















n

















x











n


+


1































x










1









































未来预测

向前



l

l






l





步的预测值为:





x

^

T

+

l

=

x

~

T

+

l

r

T

\hat x_{T+l}=\widetilde x_T+l*r_T














x






^
















T


+


l





















=
















x






















T




















+








l














r










T























(3)Holt-Winters三参数指数平滑



基本思想

适用于一定有季节效应,但长期趋势可有可无的序列



版权声明:本文为qq_41315788原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。