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
Statconn (R&Eviews), loops and screen refresh
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
tchaithonov
- Posts: 168
- Joined: Mon Apr 13, 2009 7:39 am
- Location: New York City
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Statconn (R&Eviews), loops and screen refresh
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
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: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Statconn (R&Eviews), loops and screen refresh
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
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: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Statconn (R&Eviews), loops and screen refresh
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
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: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Statconn (R&Eviews), loops and screen refresh
Not really. I think we're pretty much optimized on our end.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Statconn (R&Eviews), loops and screen refresh
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
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: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Statconn (R&Eviews), loops and screen refresh
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.
Who is online
Users browsing this forum: No registered users and 1 guest
