Displaying 1 result from an estimated 1 matches for "mhatab".
Did you mean:
matab
1998 Jul 07
2
S speedup in R
...(x, y, tau, h=tau[2]-tau[1])
{
# conditional cross-intensity function for two point process realizations.
# estimated at tau.
# x and y are vectors of event times (sorting is not necessary).
# tau is the lag (or vector of lags)
# h is binwidth.
# see Brillinger, Bryant, & Segundo (1976) eq 13, mhatAB(u)
n <- length(x)
cif.numerator <- NULL
for(tt in tau)
{
point.counter <- sum(round(rank(c(x + tt + h/2, y))[1:n], 0) -
round(rank(c(x + tt - h/2, y))[1:n], 0))
cif.numerator <- c(cif.numerator,point.counter)
}
cif.numerator/(n * h)
}
But the sped-up version just returns a vector...