Freequency Conversion

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

Papari
Posts: 10
Joined: Thu Dec 15, 2011 11:35 am

Freequency Conversion

Postby Papari » Thu Dec 15, 2011 11:40 am

Hello,


I work on a dataset of intraday stock prices at random time intervals. Is there any technique to convert observations at a regular time freequency ( i.e
5-min, 3-min, 60-min etc) ?


Many thanks in advance,


Panos

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

Re: Freequency Conversion

Postby EViews Gareth » Thu Dec 15, 2011 11:47 am

Could you be a bit more explicit in what you're trying to do?

Papari
Posts: 10
Joined: Thu Dec 15, 2011 11:35 am

Re: Freequency Conversion

Postby Papari » Thu Dec 15, 2011 11:54 am

I use time series of intraday stock prices at random price intervals, like:

time(HHMMSSmS) Price
10403015 10.50
10403110 10.52
10410101 10.80
.
.
.
.
11501021 09.80




I want to create a regularly spaced (in terms of time) data series, such as (suppose 5-min):

time(HHMMSSmS) Price
10403015 10.50
10453015 ?
10503015 ?


with the new price derived, will probably depending of the interpolation method.

any hint?


Thanks again

Panos

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

Re: Freequency Conversion

Postby EViews Gareth » Thu Dec 15, 2011 11:56 am

The question is - what do you want to do with the prices that aren't on a 5 minutely interval?

Papari
Posts: 10
Joined: Thu Dec 15, 2011 11:35 am

Re: Freequency Conversion

Postby Papari » Thu Dec 15, 2011 11:59 am

Nothing. Just keep the last price at the 5-min interval ( or probably an average of them).

Is there any other option?


Thanks again

Panos

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

Re: Freequency Conversion

Postby EViews Gareth » Thu Dec 15, 2011 12:15 pm

Create a new page that has the 5 minute interval structure you want, then copy from the irregular page to the new page.

Papari
Posts: 10
Joined: Thu Dec 15, 2011 11:35 am

Re: Freequency Conversion

Postby Papari » Thu Dec 15, 2011 3:22 pm

Many many thanks indeed.


What if I want to keep the days when my observations are interpolated. My dataset is like:


Day time(HHMMSSmS) Price
01/06/2009 10403015 10.50
01/06/2009 10403110 10.52
01/06/2009 10410101 10.80
.
.
.
.
02/06/20009 11501021 09.80


When I actually do with copy paste it creates a time-series of 5-min prices by fewer days ( since a new column of days it's created by default), so I cannot match my real observations with their actual days.

Is there any way to construct this 5-min time series but with price observations still match their actual day.


Thanks sincerely


Panos

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

Re: Freequency Conversion

Postby EViews Gareth » Thu Dec 15, 2011 3:42 pm

I'm lost.

Perhaps you could provide the workfile, and an explanation of the steps you have taken, and an explanation of what is going wrong?

Papari
Posts: 10
Joined: Thu Dec 15, 2011 11:35 am

Re: Freequency Conversion

Postby Papari » Thu Dec 15, 2011 4:01 pm

The data set starts on 01/06/2009 and ends on 31/05/2010




The steps are as follows:


1. Create new workfile 'Ave'
2. Open new page
3. Specify freequency/range .Set: - Freequency: Intraday
5-Minute
- Start Date : 06/09/2009 / End Date: 31/05/2010
- Days: 1.Monday - 5. Friday (only working days)
- Time: from 10:30:00 to 15:30:00

4. Paste created series


The workfile is attached. series04 is the price column and stops at 10/09/2009



Thanks again


Panos

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

Re: Freequency Conversion

Postby EViews Gareth » Thu Dec 15, 2011 4:02 pm

No attachment.

Papari
Posts: 10
Joined: Thu Dec 15, 2011 11:35 am

Re: Freequency Conversion

Postby Papari » Thu Dec 15, 2011 4:06 pm

sorry I cannot upload the file

I pres"Add the file'' and the file disappears


How can I do that?

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

Re: Freequency Conversion

Postby EViews Gareth » Thu Dec 15, 2011 4:18 pm

just email it to support@eviews.com

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

Re: Freequency Conversion

Postby EViews Gareth » Thu Dec 15, 2011 4:41 pm

File received.

The problem is that your first page is not structured as a dated page. Further, you can't structure it as a dated page because you have duplicate date/time pairs.

I can't help further without knowing what your intentions are with regards to the conversion from irregular/duplicates to a regular time frame. Again, what are you going to do if an observation isn't on the 5 minute mark, and what are you going to do if there are more than one observations on a 5 minute mark?

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

Re: Freequency Conversion

Postby EViews Gareth » Thu Dec 15, 2011 4:46 pm

For what it is worth, I created a single date/time series in your first page with the following: (Might not be the most efficient way, but it worked!)

Code: Select all

series time = @dateval(@left(@str(series03), 6) + "." + @right(@str(series03), 2), "HHMISS.SS") alpha datetimestr = @datestr(series02, "YYYY/MM/DD") + " " + @datestr(time, "HH:MI:SS.SSS") series datetime = @dateval(datetimestr, "YYYY/MM/DD HH:MI:SS.SSS") datetime.setformat "YYYY/MM/DD HH:MI:SS.SSS" show datetime
(the last two lines aren't necessary, but I included so that you can see the result nicely)

johny_kos
Posts: 1
Joined: Fri Dec 16, 2011 7:14 am

Re: Freequency Conversion

Postby johny_kos » Fri Dec 16, 2011 7:19 am

Hi guys,
i wanted to answer how i can to convert my (time series )data from 5-years observations to annual observations. I had downloaded a database which is like that:
1960: 7.2
1965:7.8
1970:8.4
..........
.........
and i want to convert them to annual data in eviews.
Thank you in advance.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest