i have tried the code. The first function (which computes the Oja median) has a slight problem: If you try four points that create a square centred at (2,2) oja.median(cbind(c(1,3,1,3),c(1,1,3,3))) gives (-2,-2) instead of (2,2). Probably just a sign switch somewhere. The second function seems to get the Oja median right but I don't understand what it does when computing quantiles other than the median. It seems to me (but I might be missing something!) that the ordering of observations in the computation of the cofactors, i.e. how signs alternate, should depend on an angle theta that is given as an input. In Koenker's book (p. 274) this is obtained by sorting the bivariate observations y(i), i=1,...,n, according to the quantity y(i,1)cos(theta)+y(i,2)sin(theta). In the p>2 case I would expect to provide p-1 angles to determine a direction in p dimensions. If I have understood correctly, the code just follows the order in which the observations are found in the original data matrix.
Rahul Agarwal ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.