R/elnormAltCensored.cv.mle.at.fixed.mean.R

elnormAltCensored.cv.mle.at.fixed.mean <-
function (fixed.mean, mean.mle, cv.mle, x, censored, censoring.side) 
{
    fcn <- function(cv.mle.at.fixed.mean, fixed.mean, x, censored, 
        censoring.side) {
        -loglikCensored(theta = c(mean = fixed.mean, cv = cv.mle.at.fixed.mean), 
            x = x, censored = censored, censoring.side = censoring.side, 
            distribution = "lnormAlt")
    }
    names(fixed.mean) <- NULL
    names(mean.mle) <- NULL
    names(cv.mle) <- NULL
    ret.val <- nlminb(start = cv.mle * mean.mle/fixed.mean, objective = fcn, 
        lower = 1e-07, fixed.mean = fixed.mean, x = x, censored = censored, 
        censoring.side = censoring.side)$par
    names(ret.val) <- NULL
    ret.val
}

Try the EnvStats package in your browser

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

EnvStats documentation built on Sept. 11, 2024, 6:03 p.m.