Hi,
I wanted to convert an annual series to quarterly using cubic spline interpolation in such a way that the average of the cubic interpolation for the year equal exactly the series at an annual basis.
lets say:
What I have currently: Data from 2010 to 2015 in annual terms. ----- (1)
I need the same data in quarterly series-- for which I do a cubic spline interpolation. Now I get data from 2010 q1 to 2015 q1. (By using Match = first) ---(2)
what I need: average of the cubic spline for each year should equal the annual series-- ie the average of data for each year in (2) should exactly equal the annual series we have in (1)
Is this possible via EViews?
Hoping to receive a reply soon
Matching the average of the cubic spline interpolation to equal the high frequency data
Moderators: EViews Gareth, EViews Moderator
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Matching the average of the cubic spline interpolation to equal the high frequency data
There is no built in way to do it, no.
Re: Matching the average of the cubic spline interpolation to equal the high frequency data
Thanks Gareth. Also, is it possible to take some text from an excel spread sheet to eviews? For instance, I want some bloomberg or haver based codes incorporated in the fetch functionality. i.e, I want to make the codes dynamic and thereby allow the user to delete or add any codes of the data series to the excel sheet instead of doing the same in E-views based programme. Is it possible?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Matching the average of the cubic spline interpolation to equal the high frequency data
You can use the importtbl command to import the Excel codes into a table, then read them from the table.
Re: Matching the average of the cubic spline interpolation to equal the high frequency data
Hi Gareth,
I think the cubicaverage would be a great function to implement in the future, much like the quadratic average. in the meantime, how difficult would it be for me to create a user script to perform the cubic average algo?
I think the cubicaverage would be a great function to implement in the future, much like the quadratic average. in the meantime, how difficult would it be for me to create a user script to perform the cubic average algo?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Matching the average of the cubic spline interpolation to equal the high frequency data
Without knowing the exact details of the calculation, hard to say. But probably not too bad
Re: Matching the average of the cubic spline interpolation to equal the high frequency data
I had something in mind as the SPATQ function in TROLL.
Format: SPATQ( series [, levelflag ] )
series = an annual numeric timeseries
levelflag = NA, FALSE or 0 (treat series as a flow: equalize
sums)
TRUE or 1 (treat series as a level: equalize
means)
Usage: Function (DO commands, programs)
Return Value: A quarterly timeseries interpolated from the annual input series using a cubic spline.
SPATQ calculates a spline function for the input series (which must have annual periodicity) and evaluates the function at quarterly intervals. The output series is quarterly and has four values for every value in the input series. By default, the input series is treated as a flow variable and, therefore, the mean of the output series is 1/4 the mean of the input series. However, if a levelflag is specified, the output series is multiplied by 4 to equalize the two means. If the levelflag is omitted, the output series is not multiplied by 4.
Format: SPATQ( series [, levelflag ] )
series = an annual numeric timeseries
levelflag = NA, FALSE or 0 (treat series as a flow: equalize
sums)
TRUE or 1 (treat series as a level: equalize
means)
Usage: Function (DO commands, programs)
Return Value: A quarterly timeseries interpolated from the annual input series using a cubic spline.
SPATQ calculates a spline function for the input series (which must have annual periodicity) and evaluates the function at quarterly intervals. The output series is quarterly and has four values for every value in the input series. By default, the input series is treated as a flow variable and, therefore, the mean of the output series is 1/4 the mean of the input series. However, if a levelflag is specified, the output series is multiplied by 4 to equalize the two means. If the levelflag is omitted, the output series is not multiplied by 4.
Return to “General Information and Tips and Tricks”
Who is online
Users browsing this forum: No registered users and 1 guest
