Description Usage Arguments Details Value Author(s) See Also Examples
Simulation of multivariate (marked) point processes using the Ogata thinning algorithm.
1 |
n |
an |
lambda |
a |
h |
a |
A |
a |
seed |
an |
tLim |
an |
... |
other arguments passed to |
This implementation of the Ogata thinning algorithm generates n
points based
on a vector valued function lambda
that returns the intensity
given the history of points. For an example of a lambda
-function
see hawkesRate
.
The algorithm requires the specification of filter functions h
(a lists of lists of function evaluations) and a bound, A
, on how much history is needed.
The list h
is a list of lists with h[[m]][[k]]
a vector containing the effect of
the k'th process on the m'th process.
A data.frame
with the two columns time
and markType
and n
rows.
Niels Richard Hansen, Niels.R.Hansen@math.ku.dk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | h <- list(
list(function(t)
- 0.1 * exp(- (2*(t-1))^2),
function(t)
exp(- (2*(t-2))^2)
),
list(function(t)
exp(- (2*(t-1))^2),
NULL
)
)
## Evaluations of the filter functions.
M <- length(h)
Delta <- 0.001
A <- 5
h1 <- vector("list", M)
for (m in seq_len(M)) {
h1[[m]] <- vector("list", M)
for (k in seq_len(M)) {
if (!is.null(h[[m]][[k]])) {
h1[[m]][[k]] <- h[[m]][[k]](seq(0, A, Delta))
}
}
}
## Simulation using the 'hawkesRate' intensity function.
T <- Ogata(100,
lambda = hawkesRate,
h = h1,
A = A,
Delta = Delta,
beta0 = c(0.1, 0.1)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.