R/simHPc.R

simHPc <-
function (lambda,  nEv, fixed.seed = NULL) 
{

    if (!is.null(fixed.seed)) set.seed(fixed.seed)
    if(length(lambda)>1) stop('lambda must be a number')
    if (is.null(nEv)) stop ('nEv must be specified')
	
    posH<-cumsum(rexp(nEv,lambda))
    T<-posH[nEv]

    return(list(posH = posH, T=T,  fixed.seed = fixed.seed))
}

Try the IndTestPP package in your browser

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

IndTestPP documentation built on Aug. 29, 2020, 1:06 a.m.