R/mloglik0.R

Defines functions mloglik0

Documented in mloglik0

mloglik0 <-
function(jtms,TT=max(jtms),nu,g,Ig=function(x)sapply(x,function(y)integrate(g,0,y)$value)){
  n.jmp <- length(jtms)
  term1 <- -sum(log(nu(jtms)+
                    sapply(1:n.jmp,
                           function(i)sum(g(jtms[i]-head(jtms,i-1)))
                           )
                    ))
  ## term2 <- integrate(nu,0,TT)$value+sum(Ig(TT-jtms)-Ig(0))
  term2 <- integrate(nu,0,TT)$value+sum(Ig(TT-jtms))  
  term1+term2
}

Try the IHSEP package in your browser

Any scripts or data that you put into this service are public.

IHSEP documentation built on Sept. 17, 2022, 1:05 a.m.