I have daily data (5day week) and I wish to generate a series by introducing a lag of one calender month (not simply 30 days) into the existing series. The reason for this is that the associated interest rate is 1month Libor with day count fraction Act/360.
Can anyone suggest a way of generating this variable lag?
Thanks,
Ryan
One month lag problem..
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: One month lag problem..
What do you want the lag on 30th March to be? (and so on...)
Re: One month lag problem..
31 days (to 30th April)
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: One month lag problem..
That's not a lag, that's a lead. If you really want a lead, what do you want the lead on January 30th to be?
Re: One month lag problem..
Yes, sorry I meant lead. Ah I see what you're getting at. I'm not actually sure.
The data I have is historic 1m Libor (e.g. http://www.bloomberg.com/apps/quote?ticker=BP0001M:IND) for each country, and I'm investigating uncovered interest parity so the lead on January 30th would have to correspond to the date on which 1m Libor payment would be made if the contract were entered into on January 30th.
I realise this is now a question of financial convention and not Eviews, but if you know the answer it would still be a great help!
Thanks,
Ryan
The data I have is historic 1m Libor (e.g. http://www.bloomberg.com/apps/quote?ticker=BP0001M:IND) for each country, and I'm investigating uncovered interest parity so the lead on January 30th would have to correspond to the date on which 1m Libor payment would be made if the contract were entered into on January 30th.
I realise this is now a question of financial convention and not Eviews, but if you know the answer it would still be a great help!
Thanks,
Ryan
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: One month lag problem..
Trouble is that there is no standard on this. Once you've figured out how you want to handle the end of the month issues, we can tell you how to do it in EViews :)
Re: One month lag problem..
OK so if the date is 29th, 30th or 31st January then the lead should take us to 28th of Feb. Similarly if it's 31st of August the lead takes us to 30th of Sept. For all other dates we just add one to the month so 15th Jan becomes 15th Feb etc
-
EViews Chris
- EViews Developer
- Posts: 161
- Joined: Wed Sep 17, 2008 10:39 am
Re: One month lag problem..
There's some very ugly issues here and I'm afraid I don't know enough about the definition of Libor one month rates to know exactly how the complications should be handled.
The problem at the end of months is only one of the difficulties -- there's also the problem of what happens if the day a month from today is a Saturday or Sunday, or even a public holiday.
The following code gives you something in the general direction of what you're looking for. After running it, the series 'lead' will contain the number of observations you need to lead a series so that you have an observation that is *at least* a month ahead of the current observation. You can then apply the lead to any series using the lag operator eg. 'x(lead)'.
I'm afraid the code is fairly cryptic. Let me know if you can't figure out what is going on.
The problem at the end of months is only one of the difficulties -- there's also the problem of what happens if the day a month from today is a Saturday or Sunday, or even a public holiday.
The following code gives you something in the general direction of what you're looking for. After running it, the series 'lead' will contain the number of observations you need to lead a series so that you have an observation that is *at least* a month ahead of the current observation. You can then apply the lead to any series using the lag operator eg. 'x(lead)'.
I'm afraid the code is fairly cryptic. Let me know if you can't figure out what is going on.
Code: Select all
'create test workfile
create d5 2000 2010
'generate the lead series
smpl @all
series lead = na
for !i = 1 to @obsrange
!obsdate = @dateval(@otod(!i))
series temp = @iif( @datediff(@date, !obsdate, "month") = 1, @trend, NA)
lead(!i) = @min(temp) - (!i - 1)
next
'show the results
series t=@trend
show t t(lead)Re: One month lag problem..
Chris, that works great. Thanks for putting the effort in, you've really helped me out.
Thanks again,
Ryan
Thanks again,
Ryan
Who is online
Users browsing this forum: No registered users and 1 guest
