Last active
October 3, 2018 14:31
-
-
Save kailuowang/a210a3130b7c6408641cc88af9e547ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.stripe.rainier.repl._ | |
import com.stripe.rainier.core._ | |
val data = Gamma(0.5, 3).param.sample() | |
val ap = for { | |
a <- Normal(0.5, 0.05).param | |
b <- Normal(3, 0.1).param | |
d <- Gamma(a, b).fit(data) | |
} yield a | |
ap.sample() // took forever. |
import com.stripe.rainier.repl._
import com.stripe.rainier.core._
import com.stripe.rainier.sampler._
val data = Gamma(0.5, 3).param.sample().take(5000)
val ap = for {
a <- Normal(0.5, 0.05).param
b <- Normal(3, 0.1).param
d <- Gamma(a, b).fit(data)
} yield a
ap.sample(HMC(5), 1000, 1000) // 35 seconds
ap.sample(Walkers(100), 1000, 1000) // 2 seconds
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is on
0.1.3
. Also it is probably more general than this particular case, I think I had the same issue with aLogNormal
distribution.