Dear all,
I made a little experiment this morning as I was a bit puzzled that the
SB() function for generating stationary bootstraps felt a bit "sluggish"
when I played around with it -- at least for large vectors and many
bootstrap iterations.
So I decided to compare the speed of Gretl (4 days old 2017d-git) with
MATLAB (2014), and the difference is astonishing. Loop recursion is
about 40 times faster in MATLAB compared to Gretl. I am a bit shocked
that this difference is that large. Usually I claim that Gretl is really
quick.
Let me give you the following example (see attached file) for which I
provide both the Gretl and MATLAB codes.
In exercise 1 (Ex. 1) I call SB() 10000 times for a vector with 10000
obs. The speed difference is remarkable. In Ex. 2 I draw 10000 a scalar
from a uniform distribution. The difference in speed is rather negligible.
I am not claiming that the SB() is programmed in the most efficient way,
but as both codes are identical I would not expect such massive
differences. Or do I miss something?
#-------------------------------
# Speed comparison on my laptop
#-------------------------------
# Gretl Matlab
# Ex. 1 124.6562 3.1606 sec.
# Ex. 2 0.0025 0.0021 sec.
Best,
Artur