R/fn.CV.R

## Function which computes the coefficient of variation
## See Hoogerheide (2006, p.48)
## __input__
## w : [Nx1 vector] of weights
## __output__
## [double] coefficient of variation
## __20080429__
'fn.CV' <- function(w)
  {
    r <- stats::sd(w)
    if (r==0)
      stop ("'w' is constant in 'fn.CV'")
    as.numeric(r/mean(w))
  }

Try the AdMit package in your browser

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

AdMit documentation built on Feb. 8, 2022, 1:07 a.m.