Rank: 1020 based on 144 downloads (last 30 days) and 5 files submitted
photo

Tim Benham

E-mail
Company/University
University of Queensland

Personal Profile:
Professional Interests:
statistics

 

Watch this Author's files

 

Files Posted by Tim 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 47 4
  • 5.0
5.0 | 1 rating
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 16 8
  • 5.0
5.0 | 1 rating
08 Feb 2012 Chebyshev Center and Radius Computes the Chebyshev center and Chebyshev radius of a polytope. Author: Tim Benham polytope, polyhedron, chebyshev center 12 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 57 5
  • 4.66667
4.7 | 3 ratings
Comments and Ratings by Tim View all
Updated File Comments Rating
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"?

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

Alec it does not support equality constraints yet.

03 Feb 2013 Truncated multivariate normal Generates pseudo-random vectors drawn from the truncated multivariate normal distribution. Author: Tim Benham

m = [2 0];
S = [1 0.9; 0.9 1];
X = rmvnrnd(m,S,100,[-eye(2);eye(2)], [0; 0; 1; 1]);
clf; plot(X(:,1),X(:,2),'.')

06 Apr 2011 Random number with specified probability Random number from a discrete distribution Author: Mo Chen

It means someone has already posted a function that uses the same method.

Comments and Ratings on Tim's Files View all
Updated File Comment by Comments Rating
23 Aug 2014 Fast K-means Fast K-means implementation with optional weights and K-means++ style seeding. Author: Tim Benham Jie, Allan

How to download this

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

Excellent example. Thank you very much for your kind support.

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

Yeah, please, that would be awesome.

This function and the Truncated Multivariate Normal distribution constrained to polytopes are exactly what I was looking for!
Thank you very much.

02 Aug 2014 Truncated multivariate normal Generates pseudo-random vectors drawn from the truncated multivariate normal distribution. Author: Tim Benham Sergio

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

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

Contact us