R/lamda.stem.ml.R

'lambda.stem.ml' <- 
function(n, tb, eps=0)
{
  betaF <- function(r, t1)
  {
    xf <- (exp(r*t1)-1)/(exp(r*t1)-eps)
    xf;
  }
  LF <- function(r)
  {
   -(log(1 - betaF(r, tb)) + (n-1)*log(betaF(r, tb)))
  }
  res <- suppressWarnings(nlm(function(p) LF(p[1]), .05))  
  res$lambda <- res$estimate/(1-eps)
  res$r <- res$estimate
  res
}

Try the laser package in your browser

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

laser documentation built on Jan. 15, 2017, 4:49 p.m.