R/index.scuo.random.r

Defines functions scuo.random

Documented in scuo.random

### Generate random phi values from lognormal distribution and matched by the
### rank of SCUO indices.

scuo.random <- function(SCUO, phi.Obs = NULL,
    meanlog = .CF.PARAM$phi.meanlog, sdlog = .CF.PARAM$phi.sdlog){
  if(!is.null(phi.Obs)){
    meanlog <- mean(log(phi.Obs))
    sdlog <- sqrt(var(log(phi.Obs)))
  }

  n <- length(SCUO)
  x <- rlnorm(n, meanlog = meanlog, sdlog = sdlog)
  ret <- sort(x)[rank(SCUO)]

  ret
} # End of scuo.random().

Try the cubfits package in your browser

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

cubfits documentation built on Nov. 8, 2021, 1:07 a.m.