[SciPy-User] memory error - numpy mean - netcdf4
Fri Aug 26 19:54:41 CDT 2011
On Fri, Aug 26, 2011 at 2:33 PM, Phil Morefield <firstname.lastname@example.org>wrote:
> The formula you have written looks like you're collapsing everything into a
> single value. I think he's trying to average a bunch of 2D arrays into a
> single 2D array.
You are correct, the form that I posted can be read as if it is for
updating single mean vector \mu, but you can use the same for an nd-array
trivially. Just have \mu and t as nd-arrays. m can be one too. Numpy
broadcasting will take care of the rest.
One advantage is that it requires only a constant amount of memory for the
computation, you can even read the data in from an infinite pipe or
generator that yields a single vector or a matrix at a time (or bundles them
up m at a time). It will always be uptodate with the current estimate of the
means. In fact will work for any moment too.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User