[SciPy-User] Kuiper test (was Re: scipy.stats.fit inquiry)
Thu Oct 29 03:22:12 CDT 2009
> On Wed, Oct 28, 2009 at 10:48 PM, Anne Archibald
> <firstname.lastname@example.org> wrote:
>> 2009/10/28 <email@example.com>:
>>> zm2 or Zm2 ?
>> That's a good question. The test is usually written in LaTeX as
>> $Z_m^2$, so in a sense Zm2 would be more natural, but it's not pep8
>> (and I'm really used to caps indicating a class by now).
> I prefer zm2, although in numpy/scipy, pep8 capitalization is not really
> well observed, given all the classes that pretend to be functions.
So do I; not sure why I had it the other way.
> I just checked: the original tests for random number generation still don't
> use a random seed, but they are not very strict.
> All new tests, for the other distributions methods, have a seed directly
> before every call to random, so they are completely deterministic.
> The tests for kstest have two simple examples verified against R and
> some regression tests with seeded random numbers and also deterministic
> I haven't written any tests that are truly random for inclusion in a
> testsuite in a while, but I use them during development because
> they are easy to write.
I wrote a "seed" decorator that makes per-test seeding easy. Just make
sure it goes *outside* the double_check decorator...
I think the pseudorandomness is a good way to test things like the
Kuiper false positive probability.
> BTW: I looked at some graphs of pulse profiles and they look really
> like seasonal time series to me. But I never thought of forecasting the
> load (demand) on an electricity grid for the next day in half hour
> intervals as based on astronomical phenomena. I didn't see whether
> pulsars have special events like a soccer world cup in the middle
> of the night.
Heh. In a way, yes. Those profiles you saw are probably *average*
pulse profiles, and in fact in those (few) cases where we have enough
signal-to-noise to look at individual pulses, they are often
distressingly variable. The most astonishing example is perhaps the
Crab pulsar, in which there are often "giant pulses", in which a
region less than a meter across blasts out a single pulse often bright
enough to see on your (analog) TV if you knew when to look. These
pulses vary on brightness by several orders of magnitude. Even for
average pulsars, there are many that undergo "outages" anything from
one pulse long to several weeks long; some pulsars flip back and forth
between two or more different "modes" with different pulse profiles,
and it looks like maybe most pulsars' average profiles are actually
just the envelope of shorter "drifting subpulses" that drift
systematically or randomly in phase.
Most of this weirdness is seen in radio, though, where the emission is
a negligible fraction of a pulsar's power budget (though the one that
shuts off for weeks at a time actually spins down faster when on, by
something like 50%). In the X-rays things are mostly a little better
(though the anomalous X-ray pulsars show millisecond-long bursts,
gradual profile changes, and long-term "flares", among other peculiar
behaviour) and the gamma rays look like an even better handle on the
emission physics. Both X-rays and gamma rays are photon-starved (Fermi
gets a photon every few days from a typical source, I think), so maybe
we're just not seeing the weirdness. Photon counting does at least
make for a nice clean statistical problem. Hence the various
More information about the SciPy-User