楼主: zengsongl
1544 0

[有偿编程] 编写dating algorithm (Lunde and Timmermann2004) [推广有奖]

  • 2关注
  • 2粉丝

VIP

硕士生

77%

还不是VIP/贵宾

-

威望
0
论坛币
243 个
通用积分
28.2001
学术水平
5 点
热心指数
6 点
信用等级
1 点
经验
1046 点
帖子
58
精华
0
在线时间
327 小时
注册时间
2005-4-24
最后登录
2024-4-18

199论坛币
我现在打算写一个dating algorithm (Lunde and Timmermann(2004)),这个dating algorithm在 Components of Bull and Bear markets: bull corrections and bear rallies(J. Maheu, T. McCurdy and Yong Song; working paper) 也用到过。
The Lunde and Timmermann (2004) dating algorithm defines a binary market indicator
variable It which takes the value 1 if the stock market is in a bull state at time t
and 0 if it is in a bear state. The stock price at the end of period t is labelled Pt. Our
application of their dating algorithm can be summarized as: use a 6-month window to
locate the initial local maximum or minimum.
Suppose we have a local maximum at time t0, in which case we set Pmaxt0 = Pt0 .
1. Define stopping-time variables associated with a bull market as
τmax(Pmaxt0 , t0 | It0 = 1) = inf {t0 + τ
: Pt0+τ
Pmaxt0}

τmin(Pmaxt0 , t0 | It0 = 1) = inf {t0 + τ
: Pt0+τ
0.8Pmaxt0}

2. One of the following happen.
If τmax < τmin, bull market continues, update the new peak value Pmaxt0+τmax =
Pt0+τmax discard previous peak at time t0 and set It0+1 = · ·
·
It0+τmax = 1. Go

to 2 above.
If τmax > τmin, we find a trough at time t0 + τmin and we have been in a bear
market from t0 + 1 to t0 + τmin, It0+1 = · ·
·
= It0+τmin = 0. Record the value

Pmint0+τmin = Pt0+τmin and mark time t0 as one peak. Go to 1 below for bear
market.
On the other hand suppose t0 is a local minimum.
1. Bear market stopping times are
τmin(Pmint0 , t0 | It0 = 0) = inf{t0 + τ
: Pt0+τ
Pmint0}

τmax(Pmint0 , t0 | It0 = 0) = inf{t0 + τ
: Pt0+τ
1.2Pmint0}

2. One of the following happens.
If τmin < τmax, bear market continues, update the trough point forward,
Pmint0+τmin = Pt0+τmin discard previous trough value at time t0 and set It0+1 =
· ·
·
= It0+τmin = 0. Go to 1.

If τmin > τmax we have a peak at t0 + τmax and have been in a bull market
from t0 + 1 to t0 + τmax, It0+1 = · ·
·
= It0+τmax= 1. Record the value Pmaxt0+τmax = Pt0+τmax

and mark time t0 as a trough and go to 1 above for the
bull market.
This process is repeated until the last data point.

我把文章也附上了。我自己也在编写程序,我也会随时更新我的进展。

关键词:Algorithm Dating timmer Lunde Timm 编写 Algorithm Dating Lunde
您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-18 01:45