mkF: Estimation of the cumulative intensity of a process using...

Description Usage Arguments Value Author(s) References See Also Examples

Description

A function that estimates the density of the points and then creates a valid cumulative intensity function F for input to corrtest.

Usage

1
mkF(x, start = 0, end = 1, adjust = 1, disallow.zero = TRUE)

Arguments

x

a vector of event times.

start

the start of the observation period: must be smaller than all elements of x.

end

the end of the observation period: must be greater than all elements of x.

adjust

parameter passed on to density.

disallow.zero

if TRUE do not allow F to be constant. (Useful to avoid spurious results when using corrtest.)

Value

A non-decreasing function that can serve as input to corrtest.

Author(s)

Patrick Rubin-Delanchy <patrick.rubin-delanchy@bristol.ac.uk>

References

Patrick Rubin-Delanchy and Nicholas A Heard. “A test for dependence between two point processes on the real line”. arXiv:1408.3845.

See Also

corrtest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
start=0; end=1
A=rbeta(100, 1, 10)
B=rbeta(100, 1, 10)
##This will be extreme because A and B are not homogeneous over [0,1]
corrtest(A,B)
##If we use an estimate of F the p-value is less aggressive
corrtest(A,B,F=mkF(c(A,B), start=0, end=1))
##But we can still find evidence of A causing B:
Bc=c(B, sample(A, 10)+abs(rnorm(10, 0,.0001))); Bc = Bc[Bc>start&Bc<end]
corrtest(A,Bc,F=mkF(c(A,Bc), start=0, end=1))

mppa documentation built on May 2, 2019, 2:48 a.m.