Frequency Conversion
Posted: Sun Feb 20, 2011 3:17 pm
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
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