EM1partial | R Documentation |
Calculates the RHawkes model parameters via a partial Expectation-Maximization (EM1) algorithm of Wheatley, Filimonov and Sornette (2016).
EM1partial(tms, cens, pars, maxiter = 1000, tol = 1e-8, 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), logg.fn = function(x, p){ dweibull(x, shape = p[1], scale = p[2], log = TRUE) - pweibull(x, shape = p[1], scale = p[2], lower.tail = FALSE, log.p = TRUE) - (x / p[2])^p[1]}, Mu.fn = function(x, p){ - pweibull(x, shape = p[1], scale = p[2], lower.tail = FALSE, log.p = TRUE) })
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. |
pars |
A numeric vector containing the parameters of the model, in order of the immigration parameters μ(.), offspring parameters h(.) and lastly the branching ratio η(.). |
maxiter |
The maximum number of iterations to perform. |
tol |
The algorithm stops when the difference between the previous iteration and
current iteration parameters sum is less than |
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 |
Mu.fn |
A (vectorized) function. Its value at |
logg.fn |
A (vectorized) function. The log of the immigrant distribution function. |
iterations |
The number of iterations until convergence |
diff |
The absolute sum of the difference between the final two parameter estimates |
pars |
The parameter estimates from the EM algorithm |
Feng Chen <feng.chen@unsw.edu.au> Tom Stindl <t.stindl@unsw.edu.au>
## Not run: ## simulated data tms <- sort(runif(100,0,100)) ## the slower version of the EM algorithms on simulated data with default ## immigrant hazard function ## and offspring density system.time( est1 <- EM1partial(tms, 101, c(2,1,0.5,1)) ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.