Displaying 1 result from an estimated 1 matches for "newecdf".
2008 Jan 11
1
Adding weights to ecdf
...observations x=(x1,x2, ... xn), with
weights weig=(w1, w2,..., wn), Fn(t) is the addition of the
normalized weights nwi=wi/sum(weig) for all i such that
xi observations less or equal to t i.e.,
Fn(t) = w1/(sum(i=1,n)wi) sum(i=1,n) Indicator(xi <= t).
The code I suggest to use is the following
newEcdf <- function (x,weig=rep(1,length(x)))
#	x = vector with observations.
#	weig = weigths, one per observation.
{
     n <- length(x)
     if (n < 1)
         stop("'x' have 1 or more non-missing values")
	if (n != length(weig))
         stop("'weig' must have s...