Rank: 991 based on 132 downloads (last 30 days) and 5 files submitted
photo

Tim Benham

E-mail
Company/University
University of Queensland

Personal Profile:

 

Watch this Author's files

 

Files Posted by Tim Benham View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
04 Feb 2013 Screenshot Truncated multivariate normal Generates pseudo-random vectors drawn from the truncated multivariate normal distribution. Author: Tim Benham random, distribution, gaussian, normal, sample, multivariate 35 6
  • 4.5
4.5 | 2 ratings
13 Feb 2012 Uniform distribution over a convex polytope Samples uniformly the interior of a convex polytope. Author: Tim Benham polytope, random, uniform, uniform distribution, hit and run, achr 20 11
  • 5.0
5.0 | 2 ratings
08 Feb 2012 Chebyshev Center and Radius Computes the Chebyshev center and Chebyshev radius of a polytope. Author: Tim Benham polytope, polyhedron, chebyshev center 9 0
21 Nov 2011 Analytic Center Computes the analytic center of a set of linear equations. Author: Tim Benham polytope, linear equations, analytic center, polyhedron 12 0
04 May 2011 Fast K-means Fast K-means implementation with optional weights and K-means++ style seeding. Author: Tim Benham clustering, kmeans, weighted kmeans 56 7
  • 4.66667
4.7 | 3 ratings
Comments and Ratings by Tim Benham View all
Updated File Comments Rating
14 Dec 2014 Truncated multivariate normal Generates pseudo-random vectors drawn from the truncated multivariate normal distribution. Author: Tim Benham

True, I fixed that in the R version. I will incorporate your fix into the MATLAB version.

10 Dec 2014 Fast K-means Fast K-means implementation with optional weights and K-means++ style seeding. Author: Tim Benham

Dung it follows the paper. You don't understand the code.

09 Dec 2014 Uniform distribution over a convex polytope Samples uniformly the interior of a convex polytope. Author: Tim Benham

Taran please check your email.

02 Aug 2014 Uniform distribution over a convex polytope Samples uniformly the interior of a convex polytope. Author: Tim Benham

An easy way to generate sensible A and b is to use vert2con which you can download from this site. Then you can do something like

s = RandStream('mt19937ar','Seed', 11);
RandStream.setDefaultStream(s);
V=rand(5,2);
[A b] = vert2con(V);
X=cprnd(1e3,A,b,struct('method','achr'));
clf; plot(X(:,1),X(:,2),'.')
hold on
plot([V(:,1);V(1,1)],[V(:,2);V(1,2)],'o-g')
axis equal

02 Aug 2014 Uniform distribution over a convex polytope Samples uniformly the interior of a convex polytope. Author: Tim Benham

Sergio why are you passing in a 9x8 matrix instead of a vector as argument "b"?

Comments and Ratings on Tim Benham's Files View all
Updated File Comment by Comments Rating
14 Dec 2014 Truncated multivariate normal Generates pseudo-random vectors drawn from the truncated multivariate normal distribution. Author: Tim Benham Tim Benham

True, I fixed that in the R version. I will incorporate your fix into the MATLAB version.

14 Dec 2014 Truncated multivariate normal Generates pseudo-random vectors drawn from the truncated multivariate normal distribution. Author: Tim Benham Kris Villez

Hi,

I just tested and used this package. I noticed that the Gibbs sampler does not necessarily start in a feasible point (within the polygon). For large-dimensional problems, this can make the chance of arriving in the feasible space by random sampling extremely low.

I made a small modification to the code by using the constrained maximum likelihood solution as the first sample. This helps to avoid this situation.

Otherwise, I think this is a great piece of code. Thanks for sharing.

Best,
Kris

10 Dec 2014 Fast K-means Fast K-means implementation with optional weights and K-means++ style seeding. Author: Tim Benham Tim Benham

Dung it follows the paper. You don't understand the code.

09 Dec 2014 Fast K-means Fast K-means implementation with optional weights and K-means++ style seeding. Author: Tim Benham Dung

I have trouble understanding this line in k-means++ implementation:

idx(i) = find(cumsum(D)/sum(D)>rand,1);

This doesn't follow the description of the algorithm in the paper. You're supposed to randomly choose a data point with probability p(x) = sqrdist(x,C)/sum(sqrdist(X,C)).

In your implementation that uses cumulative sum, the higher the index of a data point, the higher the probability that it will be selected. That doesn't make sense to me. For example, the last data point will have cumsum(D)/sum(D) = 1, i.e. very biased.

09 Dec 2014 Uniform distribution over a convex polytope Samples uniformly the interior of a convex polytope. Author: Tim Benham Tim Benham

Taran please check your email.

Contact us