Accessing a series from a panel wf other then the one in use

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

mamo
Posts: 122
Joined: Wed Nov 07, 2012 9:11 am

Accessing a series from a panel wf other then the one in use

Postby mamo » Fri Nov 09, 2018 4:34 am

Dear Eviews team,

I use Eviews 10+, March 2018

I detected unexpected behavior of EVIEWS when trying to access a series (named x) from an open panel file (named f2) which is different from the one in use (named f1) - both files having the same panel structure.

Code: Select all

show f2::x

does not show the series x in workfile f2 correctly - it seems to cycle through the 1st cross section.

Interestingly, showing a series from a non-active workfile page (named p2) of the same file as, for instance,

Code: Select all

show p2\x

works correctly.

The program code below documents this unexpected behavior

Best, mamo

Code: Select all

'Example program to document error when showing a series from an non-active panel file

!ncrossids=3 'number of crosssections
for %f f1 f2 'create two workfile
   wfcreate(wf={%f}) a 2000 2002 !ncrossids
   series x=(@trend+1)*10^(@crossid-1)
   if %f="f2" then
      x=x+0.9
   endif
next

wfuse f1
show x ' This shows the correct panel series x from f1
show f2::x ' This does not show the correct panel series x from f2; it seems to repeat the first crossid.
wfuse f2
show x ' This shows the correct panel series x from f2

'The above error does not happen when showing a series from an non-active page of the same work file
for %p p1 p2
   pagecreate(page=%p) a 2000 2002 !ncrossids
   series z=(@trend+1)*10^(@crossid-1)
   if %f="f2" then
      z=z+0.9
   endif
next
pageselect p1
show z 'this shows the correct panel series z from page p1
show p2\z 'this shows the correct panel series z from page p2

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

Re: Accessing a series from a panel wf other then the one in use

Postby EViews Gareth » Fri Nov 09, 2018 8:42 am

Not really a bug per se, just the results of abusing the EViews programming language :D

You are not really supposed to be able to access objects from another workfile using the show wf:: syntax. The :: syntax is only supposed to be used for databases. Luckily EViews will interpret a workfile as a database, so it does in general work. However, since databases don't support panels, when using this hack, panel information is lost.
Follow us on Twitter @IHSEViews

mamo
Posts: 122
Joined: Wed Nov 07, 2012 9:11 am

Re: Accessing a series from a panel wf other then the one in use

Postby mamo » Fri Nov 09, 2018 9:56 am

Many thanks for your answer
Luckily EViews will interpret a workfile as a database, so it does in general work. However, since databases don't support panels, when using this hack, panel information is lost

Contrary to what you say, it seems that EVIEWS databases do support panel structures. The code below provides an example.
The usage of the "show db::x" syntax in the conjunction with databases is actually encouraged in EVIEWS's own documentation (User’s Guide : EViews Fundamentals : EViews Databases : Database Auto-Series), and thus, assumedly so, would not be considered to be an "abuse of the EVIEWS language".
One implication of this behavior is that a copy of a series from a database can persist for any length of time if it is stored as a member in a group. For example, if you type:
show db1::y db2::x
this will create an untitled group in the workfile containing the expressions db1::y and db2::x.


I conclude that the interpretation of an EVIEWS workfile as a database in conjunction with the ::-syntax seems to be only imperfectly implemented (i.e., not working for panel structures) in the current version of EVIEWS.

Although you may not consider this as a bug per se, you may nevertheless consider to improve the ways an EVIEWS workfile can be approached as a database trough the ::-syntax. This would indeed be quite helpful so that users can work with series across different workfiles easily and quickly also if the series in question has a panel structure.

Best, mamo

Code: Select all

!ncrossids=3 'number of crosssections
wfcreate(wf=f1) a 2000 2002 !ncrossids
series x=(@trend+1)*10^(@crossid-1)
dbcreate mydb
copy x mydb::
show x mydb::x 'this is exactly the same series, as it should
' Doing the same by match-merge-copying x to a new wf  rather than a db does not work:
wfcreate(wf=f2) a 2000 2002 !ncrossids
copy x f2::x @src @date crossed @dets @date crossed
show x f2::x 'this does not give the same series as found before
'But the original series has of course been copied correctly into the new wf
wfuse f2
show x '!

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

Re: Accessing a series from a panel wf other then the one in use

Postby EViews Gareth » Fri Nov 09, 2018 10:49 am

No, databases don't support panels properly. Specifically, although they store the data, they do not store date/cross-section information. So when you do the "show", it ignores dates:

Code: Select all

close @wf
!ncrossids=1 'number of crosssections
wfcreate(wf=f1) a 2000 2002 !ncrossids
series x=(@trend+1)*10^(@crossid-1)
dbopen mydb
copy x mydb::

wfcreate a 1990 2010
show mydb::x


Note the change in behaviour as you switch crosssections from 1 to 3.
Follow us on Twitter @IHSEViews

mamo
Posts: 122
Joined: Wed Nov 07, 2012 9:11 am

Re: Accessing a series from a panel wf other then the one in use

Postby mamo » Mon Nov 12, 2018 3:37 am

I think, there are two issues here which should not be mixed up: first, structure-consistent references of panel data: the panel structure of the series in the targeted wf conforms with the structure of the referring wf page in use. Second structure-inconsistent copying (and reference) of panel data: the panel structure of the series in the source (which can be db or another wf) does not conform with the structure of the receiving wf page (or the referring wf page in use).

Regarding the first issue, my example programs suggest that structure-consistent wf2db-referencing works well. Therefore, it seems that some relevant pieces of information about the data structure of the series are stored in a db.

In contrast, wf2wf-referencing to panel data seems to work somehow differently: the panel structure is not properly kept, rather the show-command re-iterates though the first cross-section. This appears to be a bit odd: why is this so, in view of the fact that the necessary information about the data structure is already available in the target wf referred to?

Coming to the second issue, this is what your code provides an example for: copying a series originally structured as a panel from a db into a dated wf page which is not a panel. In this case, only the first cross-section is kept in the receiving page. (By definition, the dated receiving page does have only one crossid).

Another example of copying between inconsistent data structures would be copying an undated series from a db to a dated workfile, or vice versa. Obviously, what happens in such cases is that the series in the receiving wf page is filled with data from the source series successively, starting with the first observation in the receiving structure .

One may consider these implications of the copy (and related) command(s) as incoherent. But one would probably not conclude from such a incoherences that EVEIWS DBs do neither support undated nor dated series correctly.

Obviously, there is always an issue with structure-inconsistent copying: the allocation of the original series in the receiving structure is not clearly defined. There are basically two approaches to deal with this problem. First, one could simply inhibit copying between inconsistent data structures. Secondly, one could apply rules-of-thumb to define how the series to be copied is allocated to the data structure of the receiving page. EVIEWS has obviously chosen the second approach, trusting users that they understand the implications of copying across inconsistent data structures.

When a panel series is copied into a dated (but not panel) structure, the rules of thumb EVIEWS has implemented seem to imply that data for @crossids>1 are not copied. This is fine. Still, however, you may want to consider to amend the rules of thumbs by making sure that the panel structure of the original series is repeated to the extent possible in the structure of the receiving wf page.

To conclude, in dealing with the two issues mentioned above, the following complementary adjustments in future updates of EVIEWS would make the task of dealing with panel data across workfiles much easier:

First, make sure that structure-consistent references of panel data across workfiles work in the same way as they do in the cases of structure-consistent references from a workfile to a series stored in a db. The degree of consistence between panel structures is not always clearly defined. This may require some additional pragmatic rules of thumb, and here, the second proposal would apply:

Second, provided the receiving page does have a proper panel structure (# crossids>1), make sure that structure-inconsistent db2wf or wf2wf copies of panel data allocate the first crossid to the first crossid of the receiving page, the second one to the second crossid of the recieving page, and so forth, to the extent this is feasible.

Best, mamo

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

Re: Accessing a series from a panel wf other then the one in use

Postby EViews Gareth » Mon Nov 12, 2018 8:49 am

mamo wrote:
Regarding the first issue, my example programs suggest that structure-consistent wf2db-referencing works well. Therefore, it seems that some relevant pieces of information about the data structure of the series are stored in a db.


They're just stored as undated series. No date or crossid information is stored.
Follow us on Twitter @IHSEViews

mamo
Posts: 122
Joined: Wed Nov 07, 2012 9:11 am

Re: Accessing a series from a panel wf other then the one in use

Postby mamo » Thu Nov 15, 2018 3:05 am

I now understand - took a bit longer, apologies (also inspecting a db containing a series coming from a panel wf helped).

So the suggestion would be that series coming from a wf page with a panel structure should be stored together with some pieces of structural information in a db: 1) as it is standard time series: the date 2) the number of cross sections, and 3) for each elemtn the respective @crossid.

Couldn't that be a good and useful improvement in a future update of EVIEWS?

Best, mamo


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 3 guests