Archive for March, 2013

I’m working on a presentation involving Mathematica 9 at the moment and found myself wanting a gallery of all built-in plots using default settings. Since I couldn’t find such a gallery, I made one myself. The notebook is available here and includes 99 built-in plots, charts and gauges generated using default settings. If you hover your mouse over one the plots in the Mathematica notebook, it will display a ToolTip showing usage notes for the function that generated it.

The gallery only includes functions that are fully integrated with Mathematica so doesn’t include things from add-on packages such as StatisticalPlots.

A screenshot of the gallery is below. I haven’t made an in-browser interactive version due to size.

Google Reader has been a part of my life for several years now, forming the basis of my news reading habits. Barely a day goes by that I don’t use it via my Android phone, iPad or the web and I have dozens of feeds effortlessly synced across all platforms. It is, along with Dropbox, one of the most useful cloud services I have signed up for…and now its gone.

I guess I shouldn’t complain too much–after all it is a free service just like Twitter, Facebook, Evernote, Dropbox, Gmail, etc and so Google has every right to yank it away from me if that’s what they want to do. What the cloud giveth, the cloud taketh away and all that.

What if your favourite cloud-based service was switched off?

This has led me to face up to something I’ve always had at the back of my mind but, until now, never really worried about too much– I rely far too much on services that are potentially ephemeral and I have no control over. The loss of Google Reader from my life is frustrating but hardly the end of the world. The loss of something like Dropbox, Evernote, Facebook or Gmail would cause me a lot more pain.

The data I upload to these services may be mine but the platforms are not and since I don’t pay a penny for any of them (Dropbox being a major exception) I am not sure what my legal rights may be. If, for example, a company such as Evernote were to suddenly say ‘This free-access stuff isn’t working out for us so we deleted all your stuff and closed your account, thanks for playing.’, would I have any legal recourse? Even more importantly, would I have a local backup?

Longevity and owning your own platform.

Another issue to consider is longevity. Over the years I have invested time and money in dozens of software applications and, apart from a few notable exceptions where the licensing was crazy, I can still run any one of them today. Languishing in the depths of my hard drives are files so old that they can only be read by ancient applications written by long-dead software development companies yet I can still launch the application and access the data. I can do this because I physically own the platform. The only way someone could prevent me from using the software and data on this platform is to physically take it from me.

To prevent me from using a cloud based service, however, it seems that all it takes is for that service to become unpopular.

Ever since I took a look at GPU accelerating simple Monte Carlo Simulations using MATLAB, I’ve been disappointed with the performance of its GPU random number generator. In MATLAB 2012a, for example, it’s not much faster than the CPU implementation on my GPU hardware. Consider the following code

So, generation of random numbers using the GPU is now over 7 times faster than CPU generation on my laptop hardware–a significant improvment on the previous implementation.

New generators in 2012b

The MATLAB developers went a little further in 2012b though. Not only have they significantly improved performance of the mrg32k3a combined multiple recursive generator, they have also implemented two new GPU random number generators based on the Random123 library. Here are the timings for the generation of 100 million random numbers in MATLAB 2012b

Welcome to the latest Month of Math Software here at WalkingRandomly. If you have any mathematical software news or blogposts that you’d like to share with a larger audience, feel free to contact me. Thanks to everyone who contributed news items this month, I couldn’t do it without you.

Version 3.6.4 of Octave, the free, open-source MATLAB clone has been released. This version contains some minor bug fixes. To see everything that’s new since version 3.6, take a look at the NEWS file. If you like MATLAB syntax but don’t like the price, Octave may well be for you.

The frequently updated Euler Math Toolbox is now at version 20.98 with a full list of changes in the log. Scanning through the recent changes log, I came across the very nice iteratefunction which works as follows

IDL was updated to version 8.2.2. Since I’m currenty obsessed with random number generators, I’ll point out that in this release IDL finally moves away from an old Numerical Recipies generator and now uses the Mersenne Twister like almost everybody else.

In a recent article, Matt Asher considered the feasibility of doing statistical computations in JavaScript. In particular, he showed that the generation of 10 million normal variates can be as fast in Javascript as it is in R provided you use Google’s Chrome for the web browser. From this, one might infer that using javascript to do your Monte Carlo simulations could be a good idea.

It is worth bearing in mind, however, that we are not comparing like for like here.

The default random number generator for R uses the Mersenne Twister algorithm which is of very high quality, has a huge period and is well suited for Monte Carlo simulations. It is also the default algorithm for modern versions of MATLAB and is available in many other high quality mathematical products such as Mathematica, The NAG library, Julia and Numpy.

The algorithm used for Javascript’s math.random() function depends upon your web-browser. A little googling uncovered a document that gives details on some implementations. According to this document, Internet Explorer and Firefox both use 48 bit Linear Congruential Generator (LCG)-style generators but use different methods to set the seed. Safari on Mac OS X uses a 31 bit LCG generator and Version 8 of Chrome on Windows uses 2 calls to rand() in msvcrt.dll. So, for V8 Chrome on Windows, Math.random() is a floating point number consisting of the second rand() value, concatenated with the first rand() value, divided by 2^30.