memory leakage and FIND

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
betahatsubt
Posts: 1
Joined: Tue Jul 24, 2012 11:44 am

memory leakage and FIND

Unread post by betahatsubt »

I want to evaluate the forecast accuracy of models that are used to construct portfolios weights (think mean-variance). Accuracy is measured using utility functions of ex-post gross returns on the investment (mean-variance, power, etc.). Forecasts are constructed recursively. That last part matters below.

More precisely, I am running a program designed to evaluate the actual size properties of a block bootstrap approach to inference on the "usefulness" of a competing model. To do this I am running a simulation of a block bootstrap. The statistic used to evaluate accuracy is the root of a function. This function is essentially the difference in the average out-of-sample utilities associated with the two investing strategies. In earlier sims the root had a closed form and I used that closed form directly. That code ran - perhaps slower than I would like but the sims got done. I have modified the same code but now using a different utility function. The root now does not have a closed form.

I can think of two ways to solve for the root. One is to use FIND. When I do this the code is reasonably fast but devours memory - so much so that I cannot possibly run 50 reps of 499 bootstrap reps much less the 2000 reps of 499 bootstrap reps I want to run. The other approach is to do a direct grid search using a loop. This does not devour memory but I will be very very old indeed by the time these sims finish.

I am currently running version 7.3. I know version 8.x is out. I am not using it for a reason. The forecasts are all recursive. Do loops over linregs is dirt slow. Instead, a colleague gave me a procedure to speed that part up by an order of magnitude. However, I have not been able to get that procedure to work here at the StL Fed using version 8.x - but it does work on version 7.3.

Any help would be appreciated. I would prefer FIND to work rather than use my very simple grid search. The latter requires me to search over a "region" that I define. In this sim that region is centered around zero (size). in future sims I will not be so fortunate as to know where that region should be centered (power).

--Mike
Attachments
PowerUtility_grid_test.PRG
This is the program I described that uses a do-loop based grid search.
(6.55 KiB) Downloaded 724 times
PowerUtility_test.PRG
This is the program I described that uses FIND.
(6.33 KiB) Downloaded 710 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: memory leakage and FIND

Unread post by TomDoan »

There's a memory leak in FIND that was fixed with version 8.1. What you posted doesn't include enough to check to see if everything now works on our development version. If you could send copies of the data and supporting procedures to support@estima.com, we can run it here.
Post Reply