The underlying idea of the tests is to analyze the behaviour of the second process \(N_y\), given that
a point has occured in the first one, \(N_x\). Under independence between \(N_x\) and \(N_y\), \(N_y\)
should be a Poisson process with intensity lambday.
Intervals of length 2r centered on each point in \(N_x\) are defined. To analyze
the behaviour of \(N_y\), two approaces are implemented, both based on the idea that the number of points
in each interval should be a Poisson of mean \(\mu_i\) equal to the integral of lambday in the interval.
"Poisson" option: under the null, and if the intervals are independent (that is if they do not overlap)
the number of points in all them should be a Poisson of mean \(\mu\), equal to the sum of all the \(\mu_i\).
The p-values is calculated as \(2*min ( (P(Y<yo)+P(Y=yo)/2), (P(X>yo)+P(Y=yo)/2))\), where Y is a r.v.
with distibution Poisson(\(\mu\)) and \(yo\) is the sum of the observed number
of points in all the intervals. Since the p-values are based on a discrete distribution, they
are valid but not exact p-values.
"Normal" option: under the null, the variables \((N_i-\mu_i)/(\mu_i^{1/2})\) must be
zero mean and variance one variables but they are not identically distributed. Under general conditions,
the mean of the variables \((N_i-\mu_i)/(\mu_i^{1/2})\) can be approximated by
a Normal distribution using the Central limit theorem under the Lindeberg condition for r.v which are independent
but not identically distributed. The conditions to have a valid Normal aprroximation are quite weak, even
with a complex intensity, mean values of \(\mu_i\) around 0.6 are valid with \(n_x=50\), and around
0.3 with \(n_x=100\).