https://kotlinlang.org logo
Title
i

Igor Alshannikov

12/17/2019, 8:38 PM
We are developing a library for statistical plotting which is pure Kotlin and multiplatform: https://github.com/JetBrains/lets-plot The library includes some statistical algorithms - in particular, smoothing algorithms. We've picked some low hanging fruit -
linear model
(or
lm
) smoothing - although we have not yet implemented more complex algorithms such as
loess
,
glm
or
gam
. Is anybody aware of a pure-Kotlin statistical library in existence or in development which might include said algorithms?
a

altavir

12/18/2019, 7:05 AM
The nexus of univariate statistics in kotlin is @thomasnield's kotlin-statistics: https://github.com/thomasnield/kotlin-statistics. If you need only only univariate case, please put an issue there and I will work on it. The loess interpolator is implemented in commons-math and I can easily port it to multiplatform. I plan to add interpolation API to kmath: https://github.com/mipt-npm/kmath/issues/40, but it will take more time because I want to develop robust API for generic multiavariate case. We can start with the simple algorithm in kotlin-statistics and then back-port it to the new kmath API. In either case please open an issue.
Also Lets-plot is very important for scientific ecosystem, but we need to wrap it in more kotlinized API.
i

Igor Alshannikov

12/18/2019, 5:54 PM
a

altavir

12/18/2019, 5:56 PM
thanks a lot. I will try to find the time to work on Interpolation API. When I am done, it will be quite ease to add
loess
.
t

thomasnield

12/20/2019, 4:07 AM
@altavir please keep me posted.
i

Igor Alshannikov

02/12/2020, 6:53 PM
a

altavir

02/12/2020, 6:58 PM
OK, sorry, I did not manage to make it past the conversion stage. Can you give a reference to the actual code implementing the feature?
I've assigned a student for this task. Some interpolation API is ready, but not yet tested: https://github.com/mipt-npm/kmath/blob/dev/kmath-functions/src/commonMain/kotlin/scientifik/kmath/interpolation/SplineInterpolator.kt
i

Igor Alshannikov

02/12/2020, 7:12 PM
Cool, somebody asked me about spline interpolation on line plots. May be I can use this when ready.
a

altavir

02/12/2020, 7:22 PM
Oh, it is much more simple than the commons-math code I was porting. My current problem is that I want to do it in a generic way, so we could use interpolation for any value with defined field, but of course it is not what you need for simple plotting. I will try to dedicate more time to the problem, saly I do not have a lot of it right now.