R/quantile_estimate.r

Defines functions quantile_estimate

#'  essentially the same as ecdf, but over-writes the max value with the next largest quantile

	quantile_estimate = function(x) {
		i = which( is.finite( x) )
		pr = ecdf(x[i]) ( x[i] )
		ix = which( pr ==1 )
		if ( !{ length(ix) %in% c(0, length(x)) } )  pr[ix] = max( pr[-ix] )
		x[i] = pr
		return(x)
	}
jae0/emaf documentation built on May 28, 2019, 9:57 p.m.