mir.random - my GSoC project
Seb via Digitalmars-d
digitalmars-d at puremagic.com
Sat Apr 23 07:17:19 PDT 2016
Hi all,
I am very proud to be selected as a GSoC stipend for the D
foundation.
Most of you already know me from github (@wilzbach) and IRC
(greenify).
In my GSoC project I will contribute to Dlang’s upcoming
numerical library mir [1]. You probably heard about mir from the
new ndslice [2] package in Phobos. It's also the development &
testing spot for future math additions to Phobos. Ilya is working
very hard to get more functionality to mir and he will also be my
mentor for the mir.random package.
[1] https://github.com/DlangScience/mir
[2] http://dlang.org/phobos/std_experimental_ndslice.html
mir.random
----------
This project is about adding non-uniform random generators to mir
and hopefully eventually to Phobos.
While it is intended to be similar in terms of functionality to
C++’s <random> [3] and NumPy’s random [4], our main focus is it's
performance. Hence I will do a lot of literature research. A
simple example of achieving better performance is the normal
distribution. In most implementations I looked at (<random> [5],
NumPy [6]) the Box-Muller transform [7] is used, however there
exists a newer, faster approach: the Ziggurat method [8, 9] which
is about three to four times faster [9].
Moreover I plan to add a universal random generator to allow easy
creation of arbitrary random distributions. It could be something
like the Tinflex algorithm [10], but I still have to do more
literature research on this topic.
[3] <random> http://en.cppreference.com/w/cpp/numeric/random
[4] numpy.random
http://docs.scipy.org/doc/numpy/reference/routines.random.html
[5] normal in <random>
https://github.com/llvm-mirror/libcxx/blob/master/include/random#L4312
[6] normal in NumPy
https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/distributions.c#L106 https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/randomkit.c#L610
[7] Box-Muller transform
https://en.m.wikipedia.org/wiki/Box%E2%80%93Muller_transform
[8] The Ziggurat Method for Generating Random Variables
http://www.jstatsoft.org/v05/i08/paper
[9] An Improved Ziggurat Method to Generate Normal Random Samples
http://www.doornik.com/research/ziggurat.pdf
[10] Tinflex
https://cran.r-project.org/web/packages/Tinflex/Tinflex.pdf
Stay in touch
------------------
We will occasionally post updates to this newsgroup, but you can
also follow us on Twitter (@libmir) [11] for more updates and for
more general news @DlangScience [12] is tweeting too! Of course
you can also directly watch us on Github [13]. For discussions
and questions, you are cordially invited to our Gitter chat room
[14].
During the GSoC I will also regularly post articles to my blog
[15] - it offers email, rss and atom subscription.
Shortly before the GSoC starts, I will post the final time
schedule here for tracking.
As mentioned mir is quite young, so contributions are very
welcome.
Cheers,
Seb
PS: I will also be at dconf in Berlin, so maybe we can have a
chat there :)
[11] https://twitter.com/libmir
[12] https://twitter.com/dlangscience
[13] https://github.com/libmir/mir
[14] https://gitter.im/libmir/public
[15] https://seb.wilzba.ch
More information about the Digitalmars-d
mailing list