R/hulfun.R

Defines functions hulfun

Documented in hulfun

hulfun <-
function(x)
  {
    n<-length(x)
    a <-median(x)
    y <- rep(0, n)
    for (i in 1: n)
    {
      if( x[i] <= (a))
      {
      y[i] <-x[i]^2/2
      }
      else
       y[i] <- a*x[i]-a^2/2
      }
    return(y)
   }

Try the RKUM package in your browser

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

RKUM documentation built on June 22, 2022, 9:06 a.m.