Page 1 of 1
Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 10:58 am
by tchaithonov
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
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 12:22 pm
by EViews Gareth
What screen refresh?
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 12:54 pm
by tchaithonov
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.
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 1:43 pm
by EViews Gareth
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.
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 1:50 pm
by tchaithonov
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...
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 1:51 pm
by EViews Gareth
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.
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 1:56 pm
by tchaithonov
And I suppose, from an Eviews perspective, there is no way to make statconn runs faster?
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 2:00 pm
by EViews Gareth
Not really. I think we're pretty much optimized on our end.
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 2:02 pm
by EViews Gareth
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.
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 2:02 pm
by tchaithonov
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!
Re: Statconn (R&Eviews), loops and screen refresh
Posted: Tue Sep 20, 2011 2:05 pm
by EViews Gareth
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.