pre-allocate the memory

pre-allocate the 'stat' matrix to speed up.