R/fitdstnRob.q

Defines functions fitdstnRob

Documented in fitdstnRob

fitdstnRob <- function(x, densfun, ...)
{
  the.call <- match.call()
  data.name <- deparse(substitute(x))
  x <- as.numeric(x)

  if(any(x < 0)) 
    stop("input values must be >= 0")

  densfun <- match.arg(densfun, choices = c("gamma", "lnorm", "lognormal",
                                            "log-normal", "weibull"))

  if(densfun %in% c("lognormal", "log-normal"))
    densfun <- "lnorm"

  ans <- switch(densfun,
    gamma = gammaRob(x, ...),
    lnorm = lognormRob(x, ...),
    weibull = weibullRob(x, ...)
  )

  ans$call <- the.call
  ans$data.name <- data.name

  oldClass(ans) <- "fitdstn"
  ans
}

Try the robust package in your browser

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

robust documentation built on May 2, 2019, 5:20 p.m.