holidays in a time series

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

pmann
Posts: 17
Joined: Wed Nov 16, 2011 9:22 am

holidays in a time series

Postby pmann » Thu Nov 24, 2011 1:59 pm

hey eviews forum!
My problem is the following:
I've got a time series of daily returns of the german stock index for about 40years (regular 5 day week). here an example:
date:..............return:
12/22/1988.....0.003462753060434306
12/23/1988.....0.005256070350794826
12/26/1988.....0
12/27/1988.....0.002643305595927076
12/28/1988.....-0.002584652419474264
12/29/1988.....-0.001357235556623144
12/30/1988.....0
1/02/1989 ......0.004417088025980047

Now i want to create a dummy variable that equals 1 for the trading day directly before and after a holiday! (a holiday is a non-trading day and the return is always 0)
the problem is that in germany some holidays are't always on the same date (e.g. easter) and some are always on the same date (e.g. christmas: 25.12. and 26.12.)
so how can i create this dummy variable?
my idea is: due to that fact that the return of a holiday is always zero and i think there are no other trading days that have a zero return except holidays i would use something like an if condition like: if the return of a trading day equals zero then the trading day before and after that day should be 1 and 0 if it doesn't equals zero.
unfortunately i don't know how to program such a dummy on eviews and maybe there is even a better solution (because it could be possible that the return of a non-holiday equals zero but it is very unlikely)?!
i would be very nice if you could help me!

pmann
Posts: 17
Joined: Wed Nov 16, 2011 9:22 am

Re: holidays in a time series

Postby pmann » Fri Nov 25, 2011 7:25 am

is there no one who can help me? or is it too complicated?

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: holidays in a time series

Postby startz » Fri Nov 25, 2011 8:16 am

If you just want to identify holidays by the zeros.

Code: Select all

series dayAfter = return(-1)=0 series dayBefore = return(1)=0

pmann
Posts: 17
Joined: Wed Nov 16, 2011 9:22 am

Re: holidays in a time series

Postby pmann » Fri Nov 25, 2011 8:25 am

thanks for the reply!
and what can i do if i don't want to indentify the returns by the zero?
unfortunately i've seen that there a several zeros in my series that are no holidays...

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

holidays in a time series

Postby EViews Gareth » Fri Nov 25, 2011 8:31 am

Well, you need some way to identify them.

pmann
Posts: 17
Joined: Wed Nov 16, 2011 9:22 am

Re: holidays in a time series

Postby pmann » Fri Nov 25, 2011 8:40 am

yes and that's the problem, in germany there a fixed holidays like 1/1/.., 12/25/.. and 12/26/.. but there are also a few holidays like the easter holidays that go according the first full moon in spring (so these holidays could be between 03/22/.. and 04/25/..)
so how can i deal with this?

pmann
Posts: 17
Joined: Wed Nov 16, 2011 9:22 am

Re: holidays in a time series

Postby pmann » Fri Nov 25, 2011 11:33 am

so is there any possibilitiy on eviews to program a dummy for these holidays which dates vary each year? or is it too complex?

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: holidays in a time series

Postby startz » Fri Nov 25, 2011 11:37 am

so is there any possibilitiy on eviews to program a dummy for these holidays which dates vary each year? or is it too complex?
If you know the dates of the holidays you can program them in

Code: Select all

series holiday = 0 smpl 12/25/2010 12/25/2010 holiday = 1 smpl 12/25/2011 12/25/2011 holiday = 1
But EViews won't know the dates of the holidays without your telling it.

pmann
Posts: 17
Joined: Wed Nov 16, 2011 9:22 am

Re: holidays in a time series

Postby pmann » Fri Nov 25, 2011 11:50 am

ok, but how can i tell eviews: take the monday (for the holiday easter monday) after the first weekend after the first full moon in spring for each year?

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: holidays in a time series

Postby startz » Fri Nov 25, 2011 12:45 pm

EViews doesn't know anything about the phases of the moon. Realistically, you're going to have to find a list of holiday dates and enter it yourself.

pmann
Posts: 17
Joined: Wed Nov 16, 2011 9:22 am

Re: holidays in a time series

Postby pmann » Fri Nov 25, 2011 1:26 pm

yes, i haven't expected that eviews knows about the phases of the moon. my idea was to simulate the phases of the moon. for example take the first date of easter monday of my series and then program something like: go 12 times 29days12h43min (duration of one moon phase) forward.or something like this...
would have been too nice if that had been possible ;)

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

holidays in a time series

Postby startz » Fri Nov 25, 2011 2:15 pm

Probably possible, but probably harder than typing in the holiday dates.

browneye
Posts: 1
Joined: Mon May 27, 2013 9:06 am

Re: holidays in a time series

Postby browneye » Mon May 27, 2013 9:11 am

Hello,

I have also a problem concerning german holidays.
I'm a total beginner and I want to import a german stock time series.
Unfortunately Evies doesn't recognize german holidays. So the last days of my time series are valued with N/A because the whole series shiftet.
I imported the data as 5 day- data. Should I import them as irregular data? Or is there a more elgant way?
And how is the syntax for the batch file?

Thank you very much in advance


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests