next up previous
Next: Is this really necessary? Up: Reproducible Econometric Research Previous: Reproducible Simulation

Linking FORTRAN to SPLUS

The natural question which arises immediately is, ``why?'' What could motivate us to return to the paleolithic land of GOTO's and DO-loops when SPLUS offers such a convenient environment already. The answer, in a word, is efficiency. It becomes painfully apparent after only a little experience with SPLUS in simulation work, that unless the inner loops of computations are coded in some lower level language like FORTRAN or C, SPLUS can be very slow. As a rule of thumb, if you have a loop which needs to be executed 1000's of times you should begin to consider FORTRANizing it, for your own benefit, and for the welfare of other users who share the machine you happen to compute on.

Fortunately, adding FORTRAN (or C, but I will not delve into this) is quite easy in S. I will briefly describe some tools which I find helpful in the process, and some general rules that I try to follow when venturing into this land of the dinosaurs.





Roger Koenker
Sun Aug 31 15:47:37 CDT 1997