Describe the bug
StackOverflowError is thrown for a specific mixture model fitted on a Gaussian dataset. Please note, sometimes, it may not throw for the given example, but it throws most of the time.
Expected behavior
Expected mixture model's fit not to throw StackOverflowError on a Gaussian dataset generated by smile.
Actual behavior
MixtureModelsTest ABORTED
java.lang.StackOverflowError:
at smile.math.special.Gamma.gamma(Gamma.java:84)
at smile.math.special.Gamma.gamma(Gamma.java:84)
at smile.math.special.Gamma.gamma(Gamma.java:84)
at smile.math.special.Gamma.gamma(Gamma.java:84)
at smile.math.special.Gamma.gamma(Gamma.java:84)
Code snippet
val xs = (for _ <- 1 to 1000 yield GaussianDistribution(10.0, 5.0).rand()).filter(_ > 0).toArray
val distributions = List(Gamma Distribution(0.0005, 1.0185))
val priori = 1.0 / distributions.length
val components =
distributions.map { dist =>
new Mixture.Component(priori, dist)
}
val kernel =
ExponentialFamilyMixture.fit(
xs,
components: _*
)
Input data
val xs = (for <- 1 to 1000 yield GaussianDistribution(10.0, 5.0).rand()).filter( > 0).toArray
Describe the bug StackOverflowError is thrown for a specific mixture model fitted on a Gaussian dataset. Please note, sometimes, it may not throw for the given example, but it throws most of the time.
Expected behavior Expected mixture model's
fit
not to throw StackOverflowError on a Gaussian dataset generated by smile.Actual behavior MixtureModelsTest ABORTED java.lang.StackOverflowError: at smile.math.special.Gamma.gamma(Gamma.java:84) at smile.math.special.Gamma.gamma(Gamma.java:84) at smile.math.special.Gamma.gamma(Gamma.java:84) at smile.math.special.Gamma.gamma(Gamma.java:84) at smile.math.special.Gamma.gamma(Gamma.java:84)
Code snippet
Input data val xs = (for <- 1 to 1000 yield GaussianDistribution(10.0, 5.0).rand()).filter( > 0).toArray
Additional context