Skip to content
Prev 309122 / 398503 Next

how to make simulation faster

The code you posted was not runnable.  'r' and at least 'Zi' were missing.

The 'total time' is the amount of the elapsed time that it was
sampling with the given function.  The "self time" is how much time
was actually spent in that function.
is probably within the "aggregate" function since this is where most
of the "total time" is being spent.  You may want to look at what you
are trying to do with the "aggregate" and see if there is another way
of doing it.

You seem to have an object "i" being used in the aggregate that does
not seem to be defined.

There are probably other ways of speeding it up.  Here is one that
compares 'aggregate' to 'sapply' to do the same thing:
user  system elapsed
   3.62    0.05    3.67
user  system elapsed
   0.56    0.00    0.56

So this is about a 6X increase in performance.
On Fri, Oct 26, 2012 at 9:08 AM, stats12 <skarmv at gmail.com> wrote: