R/alpha2h.R

Defines functions alpha2h

Documented in alpha2h

alpha2h <-
function(alpha,  at, xseq){
  if(alpha>1|alpha<0) stop("Specified alpha should be  between 0 and 1.")
  n<-length(xseq)
  nn<-round(alpha*n)
  ds<-abs(xseq-at)  
  h<-sort(ds, decreasing=T)[nn]
  return(h) 
 }

Try the curvetest package in your browser

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

curvetest documentation built on May 29, 2017, 8:46 p.m.