Displaying 1 result from an estimated 1 matches for "ndidx".
Did you mean:
didx
2008 Jan 11
1
Adding weights to ecdf
...if (n < 1)
stop("'x' have 1 or more non-missing values")
if (n != length(weig))
stop("'weig' must have same length than 'x'")
xPerm <- order(x)
weig <- weig/sum(weig)
x <- x[xPerm]
weig <- weig[xPerm]
ndIdx <- !duplicated(x)
vals <- x[ndIdx]
weig <- sapply(x[ndIdx],function(xx) sum(weig[x==xx]))
rval <- approxfun(vals, cumsum(weig),
method = "constant", yleft = 0, yright = 1, f = 0, ties =
"ordered")
class(rval) <- c("ecdf", &q...