Hi Gareth,
I'm afraid I'm confused. Especially when it comes to daily->weekly conversion.
I want to acheive the following:
* pick friday-values if non-missing, otherwise pick lagged values
* Have the week represented by the friday-date.
I haven't been able to fulfill both.
I THINK my problem is due to how
a) how first/last-conversion treat a week relative to the date-representation of the week (eg. monday-date or friday-date etc)
b) how I want data to represent the week (the friday-value).
Notice: I think it's natural to think of a week starting on monday and ending on sunday. I know there are other ways to define a week, but the important thing is that a week is not an arbitrary 7-day period.
However, a week in Eviews can be represented by any date-value within the week (which is really useful if you eg need to merge on some specific day of week). If d is the date-representation for a given week, eg. the friday-date, then I THINK Eviews treat the period to pick first or last-value from the daily-file by looking at intervals like [d, d+7) (including date d, excluding date d+7).
So, if I create my week-file using the friday-date then "c=first" will give me the friday-values in my week-file whenever there are non-missing values on fridays. But, if there is a NA on a friday then "c=f" will pick a value from the following week, which is not what I want.
I could create my week-file using the monday-date, and using the "c=last". If Friday is non-missing I get that, while during e.g. Easter I will get the value of wednesday of the same week. It works nicely, but I don't have the date-labels matching the date in the daily file.
So my questin is:
Am I right in how Eviews treat a week? [d, d+7)?
If so, then I have found my solution for picking friday-values and never future-values, but lagged values, when friday is missing. But I think it would be more natural the week be defined backward, (d-7, d].
My problem would by typical for people in finance/dealing with asset prices.
Thanks,
Dagfinn
Frequency Conversion
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
dagfinnrime
- Posts: 54
- Joined: Sat Oct 11, 2008 9:37 am
- Location: Oslo
- Contact:
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Frequency Conversion
I'm not sure I follow everything you're saying. The first question I have is, what do you mean by a Friday being missing? You mean that the Friday exists in the workfile, but for a particular series has an NA value, or that it simply doesn't exist in the workfile (i.e. you have irregular data).
-
dagfinnrime
- Posts: 54
- Joined: Sat Oct 11, 2008 9:37 am
- Location: Oslo
- Contact:
Re: Frequency Conversion
Hi,
Thanks. Sorry for being unclear:
* Friday missing: I mean that some Fridays in my sample may have NA-values. The high-frequency data can be 5-day, 7-day or daily-irregular (and including some fridays).
* I want that my weekly data represent the last value observed in any given week, and in a regular week that will the value of the friday in that week.
Dagfinn
Thanks. Sorry for being unclear:
* Friday missing: I mean that some Fridays in my sample may have NA-values. The high-frequency data can be 5-day, 7-day or daily-irregular (and including some fridays).
* I want that my weekly data represent the last value observed in any given week, and in a regular week that will the value of the friday in that week.
Dagfinn
-
EViews Chris
- EViews Developer
- Posts: 161
- Joined: Wed Sep 17, 2008 10:39 am
Re: Frequency Conversion
Hi Dagfinn,
I think what is causing you problems is that EViews tends to label observations that span a time period with the first date/time within the period, rather than the last date/time in the period.
In many places you can work around this, but the observation labels used within the spreadsheet view don't have any option to change this.
I think you've already worked this out, but this means that for your frequency conversion to work properly, you're going to have to define your weeks to run from something like Saturday to Friday (there's a few other choices with 5 day data that would produce the same results). This will mean that the 'last' frequency conversion method will pick off the Friday if available, otherwise Thursday, etc. However, it will also mean that EViews will label observations in the spreadsheet view with the Saturday date.
There's a few things worth noting:
- there's a series called '@enddate' that will return the last date/time of the observation (while @date returns the beginning). so
show @enddate x
will give you an extra column containing the Friday dates next to your x values.
- there's an option in graphs called 'End of period date labels'. Choosing this will make the graph use the @enddate value for the observation labels.
I'm afraid most of this probably just confirms what you already know. Let me know if I've missed any issues.
Chris
I think what is causing you problems is that EViews tends to label observations that span a time period with the first date/time within the period, rather than the last date/time in the period.
In many places you can work around this, but the observation labels used within the spreadsheet view don't have any option to change this.
I think you've already worked this out, but this means that for your frequency conversion to work properly, you're going to have to define your weeks to run from something like Saturday to Friday (there's a few other choices with 5 day data that would produce the same results). This will mean that the 'last' frequency conversion method will pick off the Friday if available, otherwise Thursday, etc. However, it will also mean that EViews will label observations in the spreadsheet view with the Saturday date.
There's a few things worth noting:
- there's a series called '@enddate' that will return the last date/time of the observation (while @date returns the beginning). so
show @enddate x
will give you an extra column containing the Friday dates next to your x values.
- there's an option in graphs called 'End of period date labels'. Choosing this will make the graph use the @enddate value for the observation labels.
I'm afraid most of this probably just confirms what you already know. Let me know if I've missed any issues.
Chris
-
dagfinnrime
- Posts: 54
- Joined: Sat Oct 11, 2008 9:37 am
- Location: Oslo
- Contact:
Re: Frequency Conversion
Hi Chris,
Thanks for confirmation that I wasn't completely off in my understanding.
* @enddate: Thanks. That will come in handy
* "End of period labels" will definitely be useful.
How it is defined is not a big problem WHEN you know. Your documentation could be clearer that the periods are defined from first date/time within the period, i.e. [datetime, datetime+length).
Thanks,
Dagfinn
Thanks for confirmation that I wasn't completely off in my understanding.
* @enddate: Thanks. That will come in handy
* "End of period labels" will definitely be useful.
How it is defined is not a big problem WHEN you know. Your documentation could be clearer that the periods are defined from first date/time within the period, i.e. [datetime, datetime+length).
Thanks,
Dagfinn
Who is online
Users browsing this forum: No registered users and 1 guest
