Re: [Numpy-discussion] Rebinning numpy array

2011-11-14 Thread Chris.Barker
On 11/13/11 9:55 AM, Olivier Delalleau wrote: > idea, since it will throw out a lot of information if you decrease the > number of bins: I agree -- I'd think about looking at a smooth interpolation -- maybe kernel density estimation? On 11/14/11 8:12 AM, Sturla Molden wrote: > Fit a poisson dist

Re: [Numpy-discussion] Rebinning numpy array

2011-11-14 Thread Sturla Molden
Fit a poisson distribution (radioactive decay is a Poisson process), recompute lambda for whatever bin-size you need, and compute the new (estimated) bin counts by maximum likehood. It basically becomes a contrained optimization problem. Sturla Den 13.11.2011 17:04, skrev Johannes Bauer: > Hi gr

Re: [Numpy-discussion] Rebinning numpy array

2011-11-13 Thread Olivier Delalleau
2011/11/13 Robert Kern > On Sun, Nov 13, 2011 at 17:48, Olivier Delalleau wrote: > > Also: it seems like you are using values at the boundaries of the bins, > > while I think it would make more sense to compute interpolated values at > the > > middle point of a bin. I'm not sure it'll make a big

Re: [Numpy-discussion] Rebinning numpy array

2011-11-13 Thread Robert Kern
On Sun, Nov 13, 2011 at 17:48, Olivier Delalleau wrote: > Also: it seems like you are using values at the boundaries of the bins, > while I think it would make more sense to compute interpolated values at the > middle point of a bin. I'm not sure it'll make a big difference visually, > but it may

Re: [Numpy-discussion] Rebinning numpy array

2011-11-13 Thread Olivier Delalleau
(Sorry for the spam, I should have given more thought to this before hitting reply). It actually seems to me that using a linear interpolation is not a good idea, since it will throw out a lot of information if you decrease the number of bins: to compute the value at time t, it will only use the c

Re: [Numpy-discussion] Rebinning numpy array

2011-11-13 Thread Olivier Delalleau
Also: it seems like you are using values at the boundaries of the bins, while I think it would make more sense to compute interpolated values at the middle point of a bin. I'm not sure it'll make a big difference visually, but it may be more appropriate. -=- Olivier 2011/11/13 Olivier Delalleau

Re: [Numpy-discussion] Rebinning numpy array

2011-11-13 Thread Olivier Delalleau
Just one thing: numpy.interp says it doesn't check that the x coordinates are increasing, so make sure it's the case. Assuming this is ok, I could still see how you may get some non-smooth behavior: this may be because your spike can either be split between two bins (which "dilutes" it somehow), o

Re: [Numpy-discussion] Rebinning numpy array

2011-11-13 Thread Robert Kern
On Sun, Nov 13, 2011 at 16:04, Johannes Bauer wrote: > Hi group, > > I have a rather simple problem, or so it would seem. However I cannot > seem to find the right solution. Here's the problem: > > A Geiger counter measures counts in distinct time intervals. The time > intervals are not of constan

[Numpy-discussion] Rebinning numpy array

2011-11-13 Thread Johannes Bauer
Hi group, I have a rather simple problem, or so it would seem. However I cannot seem to find the right solution. Here's the problem: A Geiger counter measures counts in distinct time intervals. The time intervals are not of constant length. Imaging for example that the counter would always create