Rank: 741 based on 93 downloads (last 30 days) and 3 files submitted
photo

Roger Stafford

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Roger View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Oct 2006 Adjugate (adjoint) of a Square Matrix Calculates the adjugate (adjoint) matrix for a square matrix. Author: Roger Stafford adjugate, cofactors, adjoint, matrix, singular, linear algebra 40 6
  • 4.0
4.0 | 3 ratings
24 Jan 2006 Screenshot Random Vectors with Fixed Sum Randomly and uniformly generates vectors with a specified sum and values in a specified interval. Author: Roger Stafford fixedsum, ndimensional, random, simplex, hypercube 31 7
  • 5.0
5.0 | 7 ratings
28 Dec 2005 Screenshot Random Points in an n-Dimensional Hypersphere Randomly and uniformly distributes points throughout a hypersphere. Author: Roger Stafford ndimensional, hypersphere, random, uniformlydistributed, incomplete, radius 22 11
  • 4.75
4.8 | 12 ratings
Comments and Ratings on Roger's Files View all
Updated File Comment by Comments Rating
12 Jan 2012 Adjugate (adjoint) of a Square Matrix Calculates the adjugate (adjoint) matrix for a square matrix. Author: Roger Stafford Hubatka, Michael

@Joel: det(u*v') can also be -1.

07 Nov 2011 Adjugate (adjoint) of a Square Matrix Calculates the adjugate (adjoint) matrix for a square matrix. Author: Roger Stafford Joel

Algebraic question: Why the use of the factor det(u*v') in the documentation? Isn't this factor ALWAYS = 1?

13 Oct 2011 Random Vectors with Fixed Sum Randomly and uniformly generates vectors with a specified sum and values in a specified interval. Author: Roger Stafford Lauwerys, Christophe

Nice. I'm trying to generate random data within a simplex defined by linear inequality constraints.

Lets say I already have the N vertices of the simplex defined by the inequalities. Is it then correct to first generate a random sample in the interval [0,1] with a sum equal to 1, and then take the inner product of this sample with the vector of vertices?

Something along the lines of:

X = rand(6,2);
k = convhull(X);
plot(X(k,1),X(k,2),'b'), hold on
nv = numel(k)-1; % Nmuber of vertices
X = X(k(1:end-1),:); % Remove repeated first vertex
L = randfixedsum(size(X,1),1000,1,0,1);
Y = L'*X;
plot(Y(:,1),Y(:,2),'r.'), hold off

Maybe I shouldn't trust my vision on this, but the samples don't really look uniformly spread within the simplex. For some reason they only seem to do for a triangle.

Any thoughts?

Thanks

Christophe

28 Apr 2011 Random Points in an n-Dimensional Hypersphere Randomly and uniformly distributes points throughout a hypersphere. Author: Roger Stafford Dubourg, Vincent

Hi again,

I googled a little more and finally found a short explanation in the book by Rubinstein (2008, p. 69). I leave the link here in case it deserves someone else...
http://books.google.com/books?id=1-ffZVmazvwC&pg=PA69&lpg=PA69&dq=random+hypersphere+rubinstein&source=bl&ots=-q859Ytx3q&sig=q-PtG2P62_kTCgzi-J7QuqvPOZA&hl=fr&ei=zZ25TcfUJ4SChQeIzY3_Dg&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBwQ6AEwAA

Cheers,
Vincent

28 Apr 2011 Random Points in an n-Dimensional Hypersphere Randomly and uniformly distributes points throughout a hypersphere. Author: Roger Stafford Dubourg, Vincent

Hi!

Thank you for sharing this neat function! I was wondering if you could give me any reference explaining the theoretical concepts underlying this script?

Thanks,
Vincent

Top Tags Applied by Roger
ndimensional, random, adjoint, adjugate, cofactors
Files Tagged by Roger View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Oct 2006 Adjugate (adjoint) of a Square Matrix Calculates the adjugate (adjoint) matrix for a square matrix. Author: Roger Stafford adjugate, cofactors, adjoint, matrix, singular, linear algebra 40 6
  • 4.0
4.0 | 3 ratings
24 Jan 2006 Screenshot Random Vectors with Fixed Sum Randomly and uniformly generates vectors with a specified sum and values in a specified interval. Author: Roger Stafford fixedsum, ndimensional, random, simplex, hypercube 31 7
  • 5.0
5.0 | 7 ratings
28 Dec 2005 Screenshot Random Points in an n-Dimensional Hypersphere Randomly and uniformly distributes points throughout a hypersphere. Author: Roger Stafford ndimensional, hypersphere, random, uniformlydistributed, incomplete, radius 22 11
  • 4.75
4.8 | 12 ratings

Contact us at files@mathworks.com