As a general remark, matrix operations are usually faster if you work
with the entire matrix (or vector) in one go, because the actual
calculations are then handed over to compiled C code in the background.
If you do element-by-element operations, I don't see any reason to
expect higher speed. Plus, in this case you're mixing series (x) and
matrices (example2). My speculation would be that it's slower because
gretl has to figure out what you want to do and if that's really
syntactically correct.
fwiw,
sven
Am 07.09.2011 23:14, schrieb artur bala:
Hello,
In comparing the following scripts, the matrix operations are much more
time-consuming tasks. Is such a behaviour normal ? I was under the
understanding that handling matrices is quicker than operations on
series. :-[
cheers,
artur
nulldata 10000
series x = normal()
series example = 0
loop for i = 1..$nobs --quiet
example[i] = x[i]
endloop
matrix example2 = zeros($nobs,1)
loop for i = 1..$nobs --quiet
example2[i,1] = x[i]
endloop
--
Artur BALA
development economist, consultant
phone: +216 22 99 73 44
skype: artur.bala.tn
email: artur.bala.tn(a)gmail.com
*********************************
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users