Statconn (R&Eviews), loops and screen refresh

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Statconn (R&Eviews), loops and screen refresh

Postby tchaithonov » Tue Sep 20, 2011 10:58 am

Hi there,

I have been writing some codes to pass data to R via Statconn in a set of nested loops, and the program is slow due mostly to screen refresh even when I have "mode quiet" and "logmode addin" at the beginning of the code. Is there a way to stop the screen refresh till the whole thing is done? Would you please let me know? Thanks.

Tchaithonov

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

Re: Statconn (R&Eviews), loops and screen refresh

Postby EViews Gareth » Tue Sep 20, 2011 12:22 pm

What screen refresh?

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Statconn (R&Eviews), loops and screen refresh

Postby tchaithonov » Tue Sep 20, 2011 12:54 pm

Hey Gareth, this is similar to the situation when you write a loop to generate series without putting mode quiet on, the new series show up instantaneously after their creation? But with statconn, even with mode quiet, it still does that. What I do in the code is to use xput to send the data over to R, xrun, xget to get a vector back, and then mtos it into a series. It just seems to have ignored mode quiet altogether.

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

Re: Statconn (R&Eviews), loops and screen refresh

Postby EViews Gareth » Tue Sep 20, 2011 1:43 pm

True, but the small screen refresh to update the workfile contents window is probably a tiny fraction of the time spent in actually getting the object from R.

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Statconn (R&Eviews), loops and screen refresh

Postby tchaithonov » Tue Sep 20, 2011 1:50 pm

But if you have to pass through 100x100x100 (Cross-section x time-series x var, just as an example), it's going to take you a long time...

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

Re: Statconn (R&Eviews), loops and screen refresh

Postby EViews Gareth » Tue Sep 20, 2011 1:51 pm

Yes, the operation will take a long time, but 99% of that time will still be the transaction between R and EViews. The time spent updating the workfile will still be inconsequential.

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Statconn (R&Eviews), loops and screen refresh

Postby tchaithonov » Tue Sep 20, 2011 1:56 pm

And I suppose, from an Eviews perspective, there is no way to make statconn runs faster?

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

Re: Statconn (R&Eviews), loops and screen refresh

Postby EViews Gareth » Tue Sep 20, 2011 2:00 pm

Not really. I think we're pretty much optimized on our end.

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

Re: Statconn (R&Eviews), loops and screen refresh

Postby EViews Gareth » Tue Sep 20, 2011 2:02 pm

Of course, if possible, it might be quicker to bundle all the different things up into one object in R, then bring that big object over and de-bundle it once it is over. For example, rather than bringing over 1000 vectors, bring over 1 matrix with 1000 columns.

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Statconn (R&Eviews), loops and screen refresh

Postby tchaithonov » Tue Sep 20, 2011 2:02 pm

So, I guess the fastest way would be to minimize the number of transactions between R and Eviews then... which means I need to make R understands panel data correctly .... alrighty, thanks Gareth!

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

Re: Statconn (R&Eviews), loops and screen refresh

Postby EViews Gareth » Tue Sep 20, 2011 2:05 pm

There is no guarantee that it will actually be faster. It may be that bundling and de-bundling stuff will take longer than multiple transactions. You'll have to experiment to see.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests