From ed0b18f1fc04da292b321d068189bc5644086510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0brahim=20=C3=87a=C4=9Fda=C5=9F=20=C3=96zdemir?= <51981341+ibrahimcagdasozdemir@users.noreply.github.com> Date: Fri, 8 Jan 2021 16:33:38 +0300 Subject: [PATCH] lmkpss.e new MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Name: İbrahim Çağdaş Özdemir. --- lmkpss.e new | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 lmkpss.e new diff --git a/lmkpss.e new b/lmkpss.e new new file mode 100644 index 0000000..eef2cff --- /dev/null +++ b/lmkpss.e new @@ -0,0 +1,84 @@ +new; +cls; +library tspdlib; + +// Load date file +y = loadd(__FILE_DIR $+ "TSe.dat"); +t = rows(y); + +// bandwidth lag +bwl = round(4 * (T/100)^(2/9)); + +format /m1 /rd 8,4; + +// Set model type +// 1 = Constant +// 2 = Constant and trend +model = 2; + +// Set long-run variance computation type +// 1 iid. +// 2 Bartlett. +// 3 Quadratic Spectral (QS). +// 4 SPC with Bartlett /see (Sul, Phillips & Choi, 2005) +// 5 SPC with QS +// 6 Kurozumi with Bartlett +// 7 Kurozumi with QS +varm = 7; +for i(1, 7, 1); + varm = i; + + print "LR Variance estimation method"; + if varm == 1; + print "iid"; + endif; + if varm == 2; + print "Bartlett"; + endif; + if varm == 3; + print "Quadratic Spectral (QS)"; + endif; + if varm == 4; + print "SPC with Bartlett /see (Sul, Phillips & Choi, 2005)"; + endif; + if varm == 5; + print "SPC with QS"; + endif; + if varm == 6; + print "Kurozumi with Bartlett"; + endif; + if varm == 7; + print "Kurozumi with QS"; + endif; + + "KPSS test (Kwiatkowski, D., Phillips, P. C., Schmidt, P., & Shin, Y. (1992).)"; + + /* + ** 1=Model : Constant + ** 2=Model : Constant and trend + */ + model = 1; + + if model == 1; "--------Constant----------------------"; endif; + if model == 2; "--------Constant & trend--------------"; endif; + + + { kpss, cvKPSS } = lmkpss(y, model, bwl, varm); + "kpss ";;kpss; + "cvKPSS ";;cvKPSS; + + /* + ** 1=Model : Constant + ** 2=Model : Constant and trend + */ + model = 2; + + if model == 1; "--------Constant----------------------"; endif; + if model == 2; "--------Constant & trend--------------"; endif; + + + { kpss, cvKPSS } = lmkpss(y, model, bwl, varm); + "kpss ";;kpss; + "cvKPSS ";;cvKPSS; + ""; +endfor;