Archive for the 'Matlab' Category

N-Dim Lightspeed Gammaln

« 30 June 2005 | 14:06 | Computing, Matlab, Science and Math | No Comments »

If anyone finds themselves needing an n-dimensional implementation of gammaln in Tom Minka’s Lightspeed, I posted the modified code here.



Stixbox rgamma Bug II

« 30 June 2005 | 12:49 | Computing, Matlab, Research, Science and Math | No Comments »

After wasting an absurd amount of time trying to figure out where the bug in my code was for fitting Dirichlet parameters, it turns out that the bug actually wasn’t in my code, but was in my test data. It appears that Stixbox has a bug in its gamma random variate generator, rgamma that [...]



Stixbox rgamma Fix

« 27 June 2005 | 12:11 | Computing, Matlab, Science and Math | No Comments »

When I run the rgamma function in Stixbox, I regularly get this error:

??? Error using ==> reshape
To RESHAPE the number of elements must not change.
Error in ==> rgamma at 42

So, I changed the last line of the function from this:

x = reshape(x, n/nn(2), nn(2));

to this:

x = reshape(x(1:n), n/nn(2), nn(2));