October 2015

Software for Teaching Probability Models

By Yvonne Chueh

Once upon a time, there was a belief—teaching was believing.

Doing textbook problems using proper "tools" was part of believing!

Abacus for arithmetic,
Compass and protractor for circles,
Ruler for lines and geometry,
Drawing movements in four dimensions for dance.


Kellom Tomlinson, The Art of Dancing, Explained by Reading and Figures (London, 1735), book I, plate XII.

Recall slide rules?

Peter Alfeld of the University of Utah: “There was a time when electronic calculators did not yet exist. This did not stop us from doing complicated things, like going to the moon, figuring out the double helix, or designing the Boeing 747. In those days, when we needed to compute things, we used slide rules which are marvelous and beautiful instruments!”

And then the calculator, scientific calculator, graphing calculator, mainframe computer, PC computer, tablet computer, smart phone, in the order of time boomed to join the hands-on learning philosophy. Huge amounts of advanced math and data analysis became more approachable and feasible than ever with the help of high-speed computational technology, and fingertip Internet online publications. While over decades, we have gotten lots of state-of-the-art statistical software packages that evolved to open access coding languages such as R that expand our horizons and capabilities to approach the big data world and open up our classroom ceilings. In these fast-paced days, our undergraduate and graduate students are not only expected to learn from the course syllabus, but also are geared to explore the real-world problems to enrich their college experience and gain an edge in the job market. Evidently, the employers' hiring preferences foster such real-world problem solving pursuits and it will only intensify following the waves of global competitions.

However, when we turned to the probability theory and practice page, the world seemed to adhere to the rule “imagining is believing.” It is not uncommon that years after taking statistics, students (especially non-actuarial) often forget what statistics procedures are all about, but can still recall some statistical software-guided experience. Statistics are all about probabilities and underlying probability models and theory. Student-drawn bell-shaped normal curves can appear like an upside down bowl or funny looking, even though bell curves were repeated in the textbook (Doesn't ring a bell anymore to careless test takers.) They probably don't visualize nor have enough hands-on experience with normal curves for them to make a strong spontaneous impression. Needless to tell, skewed density curves can often be neither tangible nor precise in the textbook and software, or there's a lack of visual enhancing experience, in a traditional classroom setting. With distribution parameters such as Alpha, Beta, Gamma, Tao, Theta, how in the world do these Greek letters parametrize the central mark, shape, scale, skewness, and kurtosis of the mentioned probability density models? How can you see these parameters put into action? Beyond normal probability, specialized probability density models appeared very challenging to tackle for general students, and lots of entry actuarial students initially.

In the “imagining/seeing is believing” (which is, of course, not necessarily true, but quite convincing) kind of technology era, how can you imagine the interactions of density curve parameters and their constructed density curve shape and all the useful properties? There is Mathematica, R, Matlab, Excel and other resources that allow people to build interactive tools, one curve at a time, for learning and exploration, given its time-consuming cost to begin the first one. How about using this particular curve to solve a real-world problem? A big data modeling problem? Can we spend or afford more time on finding, defining the problem, researching, and solving the problem than on building an ad hoc tool?

Absolutely! If someone has built a tool so that it is portable and re-useable, indefinitely, without the compatibility or obsolete issues, that would be a great investment of our time! Just like the Lego artist Nathan Sawaya, "it all started with one brick" before his many master works made of tens of thousands of Legos.

Do you know that now there is such a free tool developed in academia that was created for the purpose of teaching probability, and for researcher's modeling efficiency? The recent version, resulted from a series of developing stages, has to show audit-able graphs for tracking unforeseen programming bugs or hidden mathematical errors in the codes, and allowing frequent test cases. This tool implements 600 “bricks” (model candidates) of probability density models incorporating mixed density curves to suit real-world data in which bi-modal behavior is quite common over a longer period of time. This software is not a black box when using it, but rather is illuminated for one to see the dynamics of the interrelationship of model parameters and the generated figures and numerical results. This innovative feature makes learning probabilities intimate, friendly, and intuitive!

For example, when the user clicks the model parameter scale bars, Alpha, Beta, Gamma, Tau, Theta, etc., one by one, the instant change reflected on the density curve figure responds to the new parameter values. Once the parameters are all set to bring out the final density curve, actuarial and financial measures of the density curve model, CTE and VaR can then be computed within minutes of numerical integrations that take on improper integrals. When a real-world data set, theoretically any big or small size, is available to be imported and modeled, an automated optimization process will find the maximum likelihood solutions for the set of model parameters. Users may also lock some model parameters and run the optimization process because of the likelihood it is only subject to some specific parameter(s). Since MME (moment matching) and PME (percentiles matching) can be done in MS Excel, this tool aims for the most challenging yet efficient MLE method to estimate the probability density's parameters. In the future, there is a plan to add normal, and discrete models in this tool. With 600 model candidates and each candidate frequently yielding several best models, the limitation of the tool is beyond our original plan. It may be interesting to tweak the initial parameter values and solve for a different optimized model. The K-S and Chi-square tests, paired with log likelihood measure and AIC, are performed for model selection process.

Here are some unsolicited comments about the software by an actuarial major at Drake University: “I absolutely love this software. I have been playing around with this software for a while now with different sets of data to compute the parameters using MoM, MLE and percentile matching. But, hands down, the advantage AMOOF has is that unlike solver (where the starting value is a problem), AMOOF allows us to get a pretty close starting value. It provides us with graph on top of our original data. That way, by manually manipulating the parameters, we could see how each graph would fit in our dataset. Then, it’s all the same as solver! But, AMOOF has another advantage of showing how close the distribution would look like with the given parameters (in a graphical method). Also, as the iterations take place for the “solver” in the AMOOF, we can check the values that it had generated before giving the final parameter(s) from the cmd black box in the background. It doesn’t say much in terms of the result since all we care about is the parameters and not the trajectory itself. But, I feel having that would give us a rough estimate of how much we were off from our initial point. Finally, I have to say that, AMOOF allows us to generate a report on word documents and it is actually pretty impressive with the histogram from the original data and all the moments as well as important percentiles. It has a separate report for requesting the parameters of a particular distribution.”

The software so far has contributed to several undergraduate research projects ranging from NFL Seattle Seahawks' offensive plays in sports science to Lion Rock Grill in resource management that have one thing in common--benefited from optimal probability models and used this software tool to build best models.

To close this article—
Once upon a time, there was a belief: Teaching with doing was believing, and it still is and will always be!

If you are still in doubt—
Now consider this after some Disney movie family time:

'If Princess Anna (Disney's Frozen) wants to make an ice cube, she has to do it the manual way: e.g., pouring water, freezing it. But if Queen Elsa wants to make an ice cube, BOOM! It's there. In this world, you need to be both Anna and Elsa in order to succeed (need to know how to do mathematics manually and by computer). Because aren't the girls of the royal family of Arendelle sisters and best friends?'
~Annie Kang

PVI (Pour votre information), the snow behavior simulations in Disney's Frozen was made by a team of mathematician and software engineers!

Author's note:

  1. The lead developer of this tool, James Smigaj, employed by Coaching Actuaries (CA) right after his initial presentation in the ARC 2014, continues in refining and expanding this tool with his leisure time with encouragement and resources from his employer CA.
  2. This tool, AMOOF3, formerly AMOOF2 sponsored by the Actuarial Foundation research grant to revamp and make it a stand-alone (not MS Excel dependent) free software for the actuarial community. AMOOF2 team leader, Zach Haberman, is a current employee of Intel in their Seattle office who commended this project for getting his job. To download and learn more, please visit and feel welcomed to leave your feedback and issues if any occur!