Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reconfigure samplers, new gamma sampler #313

Merged
merged 2 commits into from
Nov 20, 2014

Conversation

simonbyrne
Copy link
Member

I've rearranged the samplers, so that they're loaded after the distributions, and take a distribution argument. Also added some more samplers for Gamma.

thoughts?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) when pulling 97ae69b on simonbyrne:rgamma into 4c55ac1 on JuliaStats:master.

@simonbyrne
Copy link
Member Author

test results: shape >= 1

BenchmarkTable [unit = mps]
Dist                            |    rmath       MT       GD  
--------------------------------------------------------------
(Gamma(shape=1.5, scale=1.0),)  |  14.9867  20.4117  13.8144  
(Gamma(shape=2.0, scale=1.0),)  |  15.5620  20.0467  14.4154  
(Gamma(shape=3.0, scale=1.0),)  |  15.4051  20.2385  13.2507  
(Gamma(shape=5.0, scale=1.0),)  |  25.2942  20.8716  26.5691  
(Gamma(shape=20.0, scale=1.0),) |  28.5463  21.5892  30.7547  

shape < 1

BenchmarkTable [unit = mps]
Dist                           |    rmath      GS      IP  
-----------------------------------------------------------
(Gamma(shape=0.1, scale=1.0),) |  11.0985  9.0532  8.8145  
(Gamma(shape=0.5, scale=1.0),) |   9.5341  7.1910  9.0511  
(Gamma(shape=0.9, scale=1.0),) |   9.1693  7.3068  9.2258  

I feel that we're close enough to Rmath now that we could safely use these routines now.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) when pulling ed7b00d on simonbyrne:rgamma into 4c55ac1 on JuliaStats:master.

lindahua added a commit that referenced this pull request Nov 20, 2014
reconfigure samplers, new gamma sampler
@lindahua lindahua merged commit f10f3dd into JuliaStats:master Nov 20, 2014
@lindahua
Copy link
Contributor

Yes, these samplers already have quite good performance. What we need, however, is to incorporate those in a type-stable way -- if sampler(d::Gamma) is not type stable, we may see a performance hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants