R/quatexp.R

"quatexp" <-
function(f,para,paracheck=TRUE) {
    if(! check.fs(f)) return()
    if(paracheck == TRUE) {
      if(! are.partexp.valid(para)) return()
    }
    U <-   para$para[1]
    B <- 1/para$para[2]
    S <-   para$para[3]

    x <- vector(mode="numeric", length=length(f))
    if(S) { # stationary
       x <- S*f
    } else if(is.na(U)) {
       x <- qexp(f, rate=B)
    } else { # non stationary
       BU <- 1 - exp(-B*U)
       x <- suppressWarnings(-log(1 - f*BU)/B)
       # is the below trap for finiteness needed?
       x[! is.finite(x)] <- -log(.Machine$double.eps) / B
    }
    names(x) <- NULL
    return(x)
}

Try the lmomco package in your browser

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

lmomco documentation built on May 29, 2024, 10:06 a.m.