Skip to content
Prev 1278 / 63424 Next

performance of apply

Andreas Weingessel <Andreas.Weingessel@ci.tuwien.ac.at> writes:
I should probably have been clearer about what I was saying.  I was
indicating that some computations can be re-phrased in non-obvious
ways that are substantially faster in R.  To a numerical analyst it
would be ridiculous to use a matrix multiplication to collect row sums
because you are doing all those multiplications by 1.  However, in R/S
it is substantially faster because the looping overhear is in C not in
R.

The other issue I was trying to indicate is that efficiency has to be
measured in how long it takes to get the work done.  This includes
both thinking (and often debugging) time and computing time.  The
trade-offs between the cost of thinking and the cost of computing have
changed remarkably over the years.  I often characterize the way I see
people computing now as using a computer as a blunt instrument with
which to bludgeon the problem to death (can you say "Markov Chain
Monte Carlo"?).  In real world terms it may be more efficient to do
that than to think deeply about the computations involved and how to
speed them up.

I have probably said too much about this.  I should go back to writing
my code, which, ironically, is C code designed to speed up simulations
for a particular type of statistical model :-)