Mathematica Manages Financial Risk
November 3, 2009 — Elizabeth Shack, Technical Communication and Strategy
Finance professionals have been using Mathematica for years to optimize portfolios, develop and refine analytic risk models, rapidly prototype products and trading strategies, deploy analysis tools over the web, and much more.
Not surprisingly, we’ve seen increased interest in Mathematica‘s financial applications stemming from the current economic struggles. Accurate models and analyses are in demand to determine the best way to get the world’s economy back on track and prevent future crises.
That’s a great match for Mathematica‘s powerful capabilities.
To showcase how effective Mathematica is, we designed a portal to demonstrate its capabilities for financial applications. The new Mathematica Solution for Financial Risk Management web page, which I researched and created, is a comprehensive overview of what Mathematica can do in finance.
On the page, you’ll find tutorials, articles, documentation, and other resources to get you started. You can also view telling case-study videos and written descriptions of how finance professionals use Mathematica to get their jobs done.
For example, in one user story Fannie Mae economist Bernard Gress details how he created new mortgage-forecasting models utilizing Mathematica. In another, Alan Savoy of nGenera discusses combining Mathematica and webMathematica to build an online financial analysis tool.
One of the things I enjoyed personally about the project was going through the financial category of the Wolfram Demonstrations Project. There are currently nearly 200 financial Demonstrations—some of them tools created by finance professionals to use in their work, some of them created by educators to teach certain concepts (I admit I found those really useful), and some written by developers to show off various things Mathematica can do in the world of finance. And all the code used to create them is freely available, making them a great starting point for your own explorations.
I’d like to share some Demonstrations I think you’ll enjoy.
The Constant Risk Aversion Utility Functions Demonstration by Seth Chandler is interesting because it requires Mathematica to solve a second-order differential equation symbolically in real time whenever the parameters are changed, to plot utility functions that exhibit constant risk aversion under the Arrow-Pratt measure.
You can choose whether to show the constant absolute risk aversion curve or the constant relative risk aversion curve, vary the risk aversion coefficient, and set the coefficient’s value at two points along the curve.
Jason Cawley’s Credit Risk Demonstration looks at 30 years of actual data on corporate bond performance, then creates a Markov chain model of credit risk. Using Mathematica‘s ability to manipulate lists of data and create visualizations, the Demonstration shows how the ratings of 100 simulated bonds change over time.
When using the tool, you can adjust the maturity, the length of call protection, the starting rating, and the subordination, or choose a new random seed for the simulation.
Robustness of the Longstaff-Schwartz LSM Method of Pricing American Derivatives by Andrzej Kozlowski uses the Longstaff-Schwartz least squares Monte Carlo method of computing the value of an American put option, approximated by a Bermudan option with 50 exercise times. It’s an intriguing Demonstration because it shows how Mathematica Demonstrations can be used to study problems in current financial research; the author references two journal articles.
In it you can select three kinds of bases and can vary several parameters including degree and number of paths of the Monte Carlo sample. The Demonstration produces a plot of the expected cash flow vs. stock price.
These are just a few of the Demonstrations that show how financial professionals use Mathematica to model, compute, and analyze.
When you get a moment, check out the Mathematica Solution for Financial Risk Management website. Let us know what you think, and also let us know how you’re using Mathematica in your financial work—leave your comments below.