simMRHawkes: Simulate an (bivariate) renewal Hawkes (MRHawkes) process

Description Usage Arguments Details Value Author(s) Examples

Description

Simulate an (bivairate) renewal Hawkes (MRHawkes) process with given renewal immigration distribution functions μ, offspring density functions h and branching ratios η using the cascading structure of the process.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
simMRHawkes(re.dist1 = rweibull, par.redist1 = list(shape = 3, scale = 1.2), 
            re.dist2 = rweibull, par.redist2 = list(shape = 1/3, scale = 0.2), 
            h1.fn = function(x, p.h1) 1/p.h1 * exp(-x/p.h1), 
            h2.fn = function(x, p.h2) 1/p.h2 * exp(-x/p.h2), 
            p.h1 = 1, p.h2 = 1, 
            eta11 = 0.3, eta12 = 0.1, eta21 = 0.1, eta22 = 0.3, cens = 100, 
            B = 10, B0 = 50, 
            max.h1 = max(optimize(h1.fn, c(0, cens), maximum = TRUE, p = p.h1)$obj, 
                         h1.fn(0, p.h1), h1.fn(cens, p.h1)) * 1.1, 
            max.h2 = max(optimize(h2.fn, c(0, cens), maximum = TRUE, p = p.h2)$obj, 
                         h2.fn(0, p.h2), h2.fn(cens, p.h2)) * 1.1)

Arguments

re.dist1

The renewal distribution for type one events.

re.dist2

The renewal distribution for type two events.

par.redist1

A numeric list. The parameters of the renewal distribution for type one events.

par.redist2

A numeric list. The parameters of the renewal distribution for type two events.

h1.fn

A (vectorized) function. The offspring density function for type one events.

h2.fn

A (vectorized) function. The offspring density function for type two events.

p.h1

A numeric vector. The paramters of the offspring density for type one events.

p.h2

A numeric vector. The paramters of the offspring density for type two events.

eta11

A numeric scalar. The self-exciting branching ratio for type one events.

eta12

A numeric scalar. The cross-exciting branching ratio for type one events due to the effects of a type two event.

eta21

A numeric scalar. The cross-exciting branching ratio for type two events due to the effects of a type one event.

eta22

A numeric scalar. The self-exciting branching ratio for type two events.

cens

A scalar. The censoring time.

B

A numeric scalar. Tuning parameter

B0

A numeric scalar. Tuning parameter

max.h1

A numeric scalar. The maximum value of the offspring density for type one events.

max.h2

A numeric scalar. The maximum value of the offspring density for type two events.

Details

The function works by simulating the arrival times of immigrants accoridng to the respective renewal immigration distribution for each event type. The birth times ofoffspring from each immigrant are then simulated according to an non-stationary multivariate Hawkes Process (NSMHP) with appropriate baseline and excitation functions.

Value

A numeric matrix. The row coloumn contains the event times in ascending order while the second coloumn contains the corresponding event type.

Author(s)

Tom Stindl <t.stindl@unsw.edu.au> Feng Chen <feng.chen@unsw.edu.au>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  B <- 10; i <- 0;
  data <- replicate(B, 
                    {cat(i<<-i+1,'\n'); 
                    simMRHawkes(re.dist1 = rweibull, 
                                par.redist1 = list(shape = 3, scale = 1.2),
                                re.dist2 = rweibull, 
                                par.redist2 = list(shape = 1 / 3, scale = 0.2),
                                p.h1 = 1, p.h2 = 1,
                                eta11 = 0.3, eta12 = 0.1, 
                                eta21 = 0.1, eta22 = 0.3,
                                cens = 100)
                    })

MRHawkes documentation built on May 2, 2019, 2:51 p.m.