mllRH2 | R Documentation |
Calculates the minus loglikelihood of a RHawkes model with given
immigration hazard function μ, offspring density function
h and branching ratio η for event times tms
on interval [0,cens]. The same as mllRH
although this
version also returns the Rosenblatt residuals.
mllRH2(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) })
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 μ(.), offspring parameters h(.) and lastly the branching ratio η(.). |
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 |
Calculate the RHawkes point process Rosenblatt residuals
mll |
minus log-likelihood |
U |
Rosenblatt residual of observed event time |
n |
number of events |
Feng Chen <feng.chen@unsw.edu.au> Tom Stindl <t.stindl@unsw.edu.au>
mllRH
## Not run: tmp <- mllRH2(sort(runif(1000,0,1000)),1001,c(2,1,0.5,1)) par(mfrow=c(1,2)) qqunif<-function(dat,...){ dat<-sort(as.numeric(dat)); n<-length(dat); pvec<-ppoints(n); plot(pvec,dat,xlab="Theoretical Quantiles", ylab="Sample Quantiles",main="Uniform Q-Q Plot",...) } qqunif(tmp$U) acf(tmp$U) ks.test(tmp$U,"punif") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.