[陳旭昇] 台灣景氣衰退機率預測 (最近一次更新: 2024 年 3 月)


依據國發會 2023.3.20 所發布之「台灣第 15 次景氣循環高峰認定」報告, 最近一次高峰認定為 2022 年 1 月, 目前共認定 15 次循環。由於國發會景氣領先指標之資料起始期間為 1982 年 1 月, 故迴歸分析時, 模型估計之資料期間使用 1982 年 1 月至 2022 年 1 月。

預測變數為國發會所編製之台灣領先指標不含趨勢指數。國發會景氣領先指標資料更新到 2023 年 12 月。

景氣衰退機率 (陰影部分為國發會所認定之景氣衰退期間) 如下:

 





 註: 預測為學術研究結果, 僅供參考。請進一步參閱 TWNRecProb.pdf

資料檔: twndata.xlsx

EViews 程式如下



'==============================================

%path = @runpath
cd %path
wfopen "twndata.xlsx" range=Sheet1 colhead=1 na="#N/A" @freq M @id @date(date) @smpl @all

%start = "1982m01"
%end = "2023m12"
%fend = "2024m12"


'============
!plot = 0 ' 0 for predictive estimates, 1 for plotting recession prob
'============

freeze(LI_plot) LI.line
LI_plot.save(t=png, c, box, port, w=5000, h = 2795, u=pixels, d=96, trans) li_plot.png




genr pred = LI

!k_lag = 12



sample SR 1982m01 2022m01

smpl SR ' 峰谷資料只到 2022m01 (in-sample)

'== Lag Selection

matrix(12,2) lagsecl
for !k = 1 to 12
equation LItest_{!k}.binary(d=n) twnrec li(-!k) c
lagsecl(!k,1) = LItest_{!k}.@aic
lagsecl(!k,2) = LItest_{!k}.@sc
next
delete LItest*





equation LI_{!k_lag}.binary(d=n) twnrec pred(-!k_lag) c


smpl @all
pagestruct(end={%end}+!k_lag)  ' 2022m02--2024m12 (out-of-sample)
LI_{!k_lag}.fit twnrecf
LI_{!k_lag}.fit yhat

sample s1 {%start}+!k_lag  {%end}+!k_lag

group g1 pred(-!k_lag) c
stom(g1,x1)
matrix m1 = x1*LI_{!k_lag}.@coefcov*@t(x1)
vector v1 = @getmaindiagonal(m1)
genr yhat2 = (@DNORM(yhat))^2
stom(yhat2,m2)
matrix m3 = @emult(v1, m2)
mtos(m3, v, s1)
genr se = @sqrt(v(1))

genr upper = twnrecf + 1.96*se
genr lower = twnrecf - 1.96*se
genr lower = lower*(lower>0)


%group = "twnrecf lower upper"
svector cname
cname = @wsplit(%group)

matrix(4,3) rpred
for !j= 1 to 3
%name =  cname(!j)
rpred(1,!j) = @elem({%name}, "2024:3")
rpred(2,!j) = @elem({%name}, "2024:6")
rpred(3,!j) = @elem({%name}, "2024:9")
rpred(4,!j) = @elem({%name}, "2024:12")
next

''====  Plot of Recession Probability  ======================


if !plot = 1 then
freeze(RecProb_plot) twnrecf.line
RecProb_plot.draw(line, bottom, @rgb(198,0,0), pattern(2), linewidth(0.75)) 2022M01
pagestruct(end="2022m01")
RecProb_plot.draw(shade, bottom, @rgb(234,234,234)) if twnrec = 1
RecProb_plot.delete text
RecProb_plot.addtext(3.63,0.05,font(Calibri,14,-b,-i,-u,-s)) In-Sample 1982:1--2022:1
RecProb_plot.save(t=png, c, box, port, w=5000, h = 2795, u=pixels, d=96, trans) li_{!k_lag}_plot.png
endif