圖1: 景氣衰退機率 (2022:2 後為預測值) |
依據國發會 2023.3.20 所發布之「台灣第 15 次景氣循環高峰認定」報告, 最近一次高峰認定為 2022 年 1 月, 目前共認定 15 次循環。由於國發會景氣領先指標之資料起始期間為 1982 年 1 月, 故迴歸分析時, 模型估計之資料期間使用 1982 年 1 月至 2022 年 1 月。
預測變數為國發會所編製之台灣領先指標不含趨勢指數。國發會景氣領先指標資料更新到 2024 年 4 月。
景氣衰退機率 (陰影部分為國發會所認定之景氣衰退期間) 如圖 1所示。預測為學術研究結果, 僅供參考。
資料檔: twndata.xls
EViews 程式如下
%path = @runpath
cd %path
wfcreate(wf=recession) m 1982:1 2025:3
read(c3) twndata.xls _
twnrec LI
%start = "1982m01"
%end = "2024m3"
%fend = "2025m3"
'============
!plot = 1 ' 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--2025m3 (out-of-sample)
LI_{!k_lag}.fit twnrecf
genr yhat = twnrecf
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(3,3) rpred
for !j= 1 to 3
%name = cname(!j)
rpred(1,!j) = @elem({%name}, "2024:9")
rpred(2,!j) = @elem({%name}, "2024:12")
rpred(3,!j) = @elem({%name}, "2025:3")
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