Performance of numpy matrix vector product on scipy.stats.qmc.Sobol vector when changing reshaping order
I am trying to implement a Brownian bridge and want to speed up the path construction via numpy matrix multiplication, once the bridge is initialised. I am drawing data for 3 underlyings and 256 time steps for 2^16 different paths, which is achieved by drawing 2^16 Sobol’ numbers in 3*256 = 768 dimensions. I then reshape the drawn 2D array into the 3D array of shape (3, 256, 2^16) and apply the brownian bridge matrix of shape (256, 256) via numpy matrix multiplication. To use the first dimensions for the largest variance contributions in the brownian bridge, the array is reshaped using the order=’F’ keyword.