[R] boundary check

2010-09-24 Thread Feng Li
Dear R, I have a covariates matrix with 10 observations, e.g. X - matrix(rnorm(50), 10, 5) X [,1][,2][,3][,4] [,5] [1,] 0.24857135 0.30880745 -1.44118657 1.10229027 1.0526010 [2,] 1.24316806 0.36275370 -0.40096866 -0.24387888 -1.5324384 [3,]

Re: [R] boundary check

2010-09-24 Thread Robin Hankin
Hello convex hulls in large numbers of dimensions are hard. For your problem, though, one can tell whether a given point is inside or outside by using linear programming: X - matrix(rnorm(50), 10, 5) x_i - matrix(rnorm(5), 1, 5) isin.chull function(candidate,p,plot=FALSE,give.answers=FALSE,

Re: [R] boundary check

2010-09-24 Thread Michael Bedward
Hello, If an N-dimensional convex hull fits your idea of a smallest ball then you could try the convhulln function in the geometry package. For testing if a new point is inside a previously derived hull, one brute force approach is to rbind the new point to your data, generate a new hull and see

Re: [R] boundary check

2010-09-24 Thread baptiste auguie
Hi, I remember a discussion we had on this list a few months ago for a better way to decide if a point is inside a convex hull. It eventually lead to a R function in this post, http://tolstoy.newcastle.edu.au/R/e8/help/09/12/8784.html I don't know if it was included in the geometry package in

Re: [R] boundary check

2010-09-24 Thread Feng Li
Thanks. I agree with you that the speed and memory issues might be (actually is) a big problem for big dimensions. It is interesting to know to solve this by using linear programming. Buy the way, it seems a potential bug in your function if you try this X - matrix(rnorm(50), 10, 5)

Re: [R] boundary check

2010-09-24 Thread Keith Jewell
Hi, Below Baptiste's message I attach the R code and the .Rd documentation I treated as 'final', it may be slightly different from that in the Dec 2009 post. I did submit if for inclusion in the geometry package, but last time I checked it wasn't there. I have found (and others have

Re: [R] boundary check

2010-09-24 Thread Robin Hankin
Feng thanks for this. The problem you report is reproducible; it originates from simplex() of the boot packge. It is ultimately due to the fact that x_i is precisely *on* the convex hull, which is evidently causing problems. I'll investigate it. In the short term, you can break the

Re: [R] boundary check

2010-09-24 Thread Greg Snow
3:44 AM To: r-help@r-project.org Subject: [R] boundary check Dear R, I have a covariates matrix with 10 observations, e.g. X - matrix(rnorm(50), 10, 5) X [,1][,2][,3][,4] [,5] [1,] 0.24857135 0.30880745 -1.44118657 1.10229027 1.0526010