Simple (but nontrivial) vectorization in Numpy
f(a, b, c, d) Let’s say we want to explore the behavior of f in some range of parameters. How can we vectorize the function and iterate over all possible combinations? Is building a Cartesian product the best way? We expect this to be very inefficient, like $O(n^2)$ with respect to $O(n)$ inefficient in memory, at least. Let’s say the parameters have a definite number of samples (len(x) or np.shape(x) in pyhon, with x a parameter vector). We change the axis of the numpy vectors, making them multi-dimensional vectors (or, respecting the notion of dimension in algebra, multi-axial): ...