Learn R Programming

RHawkes (version 1.0)

mllRH1: Minus loglikelihood of a RHawkes model with parent probabilities

Description

Calculates the minus loglikelihood of a RHawkes model with given immigration hazard function \(\mu\), offspring density function \(h\) and branching ratio \(\eta\) for event times tms on interval \([0,cens]\). The same as mllRH although this version also returns the parent probabilities.

Usage

mllRH1(tms, cens, par, 
      h.fn = function(x, p) dexp(x, rate = 1/p), 
      mu.fn = function(x, p) {
        exp(dweibull(x, shape = p[1], scale = p[2], log = TRUE) - 
        pweibull(x, shape = p[1], scale = p[2], lower.tail = FALSE, log.p = TRUE))
        }, 
        H.fn = function(x, p) pexp(x, rate = 1/p), 
        Mu.fn = function(x, p) {
          -pweibull(x, shape = p[1], scale = p[2], lower.tail = FALSE, log.p = TRUE)
        })

Arguments

tms

A numeric vector, with values sorted in ascending order. Event times to fit the RHawkes point process model.

cens

A scalar. The censoring time.

par

A numeric vector containing the parameters of the model, in order of the immigration parameters \(\mu(.)\), offspring parameters \(h(.)\) and lastly the branching ratio \(\eta(.)\).

h.fn

A (vectorized) function. The offspring density function.

mu.fn

A (vectorized) function. The immigration hazard function.

H.fn

A (vectorized) function. Its value at t gives the integral of the offspring density function from 0 to t.

Mu.fn

A (vectorized) function. Its value at t gives the integral of the immigrant hazard function from 0 to t.

Value

mll

minus log-likelihood

log.p

parent probabilities

n

number of events

See Also

mllRH

Examples

Run this code
# NOT RUN {
tmp <- mllRH1(sort(runif(1000,0,1000)), 1001, c(2,1,0.5,1))
for(i in 1:tmp$n)
  cat(exp(tmp$log.p[i*(i - 1)/2 + 1:i]), "\n")    
# }

Run the code above in your browser using DataLab