R/NBlike_phi_offset.R

Defines functions NBlike_phi_offset

NBlike_phi_offset <-
function(para, data1, ppr1, ppr0, mus,mub, k=k)
{
#Log-likelihood based on mixture of NB(mu, size), maximised using optim() function
   N=length(data1)
   phis=para[1]
   phib=para[2]
   temp1=sum(ppr1*ifelse(data1<k, 0, dnbinom(data1-k, phis, ,mus, log=TRUE)))
   temp2=sum(ppr0*dnbinom(data1, phib, ,mub, log=TRUE))
   logl=temp1+temp2
   return(-logl)
}

Try the enRich package in your browser

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

enRich documentation built on March 13, 2020, 2:46 a.m.