[SciPy-Dev] Vector Strength function
Wed Mar 27 04:37:47 CDT 2013
On Fri, Feb 1, 2013 at 5:19 PM, Todd <firstname.lastname@example.org> wrote:
> On Wed, Jan 9, 2013 at 8:44 PM, <email@example.com> wrote:
>> On Wed, Jan 9, 2013 at 12:32 PM, Todd <firstname.lastname@example.org> wrote:
>> > I am interested in implementing a function for scipy. The function is
>> > called "vector strength". It is basically a measure of how reliably a
>> > of events occur at a particular phase.
>> > It was originally developed for neuroscience research, to determine how
>> > a set of neural events sync up with a periodic stimulus like a sound
>> > waveform.
>> > However, it is useful for determining how periodic a supposedly
>> periodic set
>> > of events really are, for example:
>> > 1. Determining whether crime is really more common during a full moon
>> and by
>> > how much
>> > 2. Determining how concentrated visitors to a coffee shop are during
>> > hour
>> > 3. Determining exactly how concentrated hurricanes are during hurricane
>> > season
>> > My thinking is that this could be implemented in stages:
>> > First would be a Numpy function that would add a set of vectors in polar
>> > coordinates. Given a number of magnitude/angle pairs it would provide a
>> > summed magnitude/angle pair. This would probably be combined with a
>> > cartesian<->polar conversion functions.
>> > Making use of this function would be a scipy function that would
>> > implement the vector strength calculation. This is done by treating
>> > event as a unit vector with a phase, then taking the average of the
>> > If all events have the same phase, the result will have an amplitude of
>> > If they all have a different phases, the result will have an amplitude
>> of 0.
>> > It may even be worth having a dedicated polar dtype, although that may
>> > too much.
>> > What does everyone think of this proposal?
>> Is this the same as a mean resultant in circular statistics?
>> def circular_resultant(rads, axis=0):
>> mp = np.sum(np.exp(1j*rads), axis=axis)
>> rho = np.abs(mp)
>> mu = np.angle(mp)
>> return mp, rho, mu
> It looks to be the same as the first part of my proposal.
So does anyone have any opinions on this?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-Dev