Most of the financial modeling/Mathematica books I've seen are intended to (1) provide theorical insights and Mathematica based tools to price "exotic" derivatives, and/or (2) to show how to use Mathematica to develop derivative trading strategies. Very helpful for experienced quants. Not the best way to learn about investing.
Successful investing requires the skillful combination of five aspects of finance. You should know how: 1) financial markets work, 2) different financial instruments are priced, 3) assets can be combined in a portfolio to meet a particular investment objective, 4) risk is measured and and managed, and 5) investment success is measured and monitored. Each of these five areas require practical knowledge and also involve important theoretical questions. (In spite of the fact that two Nobel prices have been awarded for work in categories 2 and 3, research is ongoing in each of the five areas). Mathematica is a useful tool for the student and practitioner in each area.
Although Mathematica has sophisticated functions for valuing various instruments, if you want to learn about finance, it's better to write your own financial functions so you know how pricing works.
1. PRICING FINANCIAL INSTRUMENTS (What's it worth?)
Bonds are a great place to start learning about finance. The price of a treasury bond is just the sum of the present values of each of its coupon payments and its principal at maturity. Moreover, this "sum of the present value of future cashflows," introduces a foundational concept of finance called the law of one price. The law of one prices says everything that has the same future cash flows MUST have the same price (or the differences will be arbitraged away). Therefore, any package of financial instruments that has the same future cashflows as a certain bond must have the same price as that bond.
Mathematica makes it relatively easy to learn about bond pricing and the surprisingly many and more subtle related concepts of duration, curvature, yield to maturity, etc.
1a. Fixed Income Securities
The present value of a future cash payment is equal to:
presentValue = cashPayment/(1 + annualInterestRate)^(timeInYearsToPayment)
This means that, if you know the face value, coupon payments, and time to maturity of a bond that won't default (you can be sure the payment will really happen), you can calculate it's price in any environment (meaning when bonds are trading at any particular yield). For example:
Treasury Bonds (which, in theory, will never default)
The price of a US Treasury bond is:
So, Treasury bonds are really mathematical entities. And you can learn about them with Mathematica by making and playing with models. For example, bond prices are a simple but interesting function of yield:
This price-yield curve is the essential element of bond pricing. The curve itself a function of bond maturity, coupon, coupon frequency, and yield. Its slope (called bond duration) is a measure of the bond's sensitivity to interest rate changes, and since the curve isn't flat, duration is also a function of interest rates (curvature). This gets complicated, but bonds are managed in terms of duration and curvature.
The Yield Curve
Bonds are actually priced from a yield curve, either the Treasury yield curve, or one based on treasuries but adjusted with yields appropriate to a specific bond. Two yield curves are shown below. The blue curve corresponds to Treasury yields on Dec, 17, 2012. The present value of each coupon payment and of the bond's value at maturity is based on the interest rate for that payment's maturity taken from the current yield curve.
Note how different they are. The same bond would have a very different price when priced against those two curves. Let's calculate the price of a bond relative to the blue curve. The values use for the yield curve are based on a standard set of Treasuries with maturities of one month, three months, six months, one year, etc. We need a interpolation function to get the interest rate for any maturity. Let's assume a 10 year bond with a 4% coupon paid once a year. The price for a 100$ bond is 120.69%.
The bond has a price of 109.12$ against the higher yield curve. As shown in the price-yield curve above, bond prices fall when yields rise. The yield curve changes over time. Let's use Wolfram|Alpha to compare the yield curves for October 15, 2012 and October 15, 2005. What would happen to our bond's price under those changes?
Wolfram|Alpha Bond Queries
Yield to Maturity
Bond Related Demonstrations
Macaulay Duration as the Balancing Point of a Seesaw
Valuation and Management of Bonds
Yield, Spot, and Forward Curves
Term Structure of Interest Rates
Corporate Bonds (where default is possible)
Yield Curves with Mathematica 6.0
Callable Bonds (where future payments are contingent)
Pass-through Bonds (packages of various interest paying securities)
Miscellaneous Notes & Links
Bond Market Pricing Conventions
Using Mathematica at BondDesk Group LLC
Interest Rate Senstivity of Bonds
I'm going to replace this with a Mathematica centric discussion soon. I'm gathering my thoughts a the moment...
(The classical approach to valuing stocks is to use a dividend discount model. The underlying idea is that the present value of a stock is equal to the sum of the present values of it's future dividends. This approach, along with various implementation issues is discussed throughly by Aswath Damodaran, a professor at NYU. There are lots of issues: how do you estimate the size of the uncertain future cashflows, how much should they be "discounted", and more recently, does this approach give the proper importance to sentiment. For example, John Cochrane, the past President of the American Financial Institution and a professor at the University of Chicago, has argued that "price-dividend ratios correspond to discount-rate variations instead of variations in expected cash flows." He present evidence taken from many asset classes to support the generality of this claim. He suggest that the emphasis on future cash flows is misdirected. This fits into the broad category of behavioral investment theory.
Continuing in this theme, Philip Maymin (above) is the founding editor of Algorithmic Finance, the current issue of which contains an article, which claims that "The sentiment indicator we introduce gives a way to actually quantify the impact of human biases and sentiments directly on the markets instead of simply postulating effects which is often done in the field of Behavioral Finance. There are really a lot of open issues in what might seem to be a plain vanilla topic as stock pricing, and it is worth learning about them. I've left out the Capital Asset Pricing Model, Arbitrage Pricing, and other subjects that are exciting, controversial, and fun to learn about.)
Financial Statistics (How to, using stock prices from W|A - Good)
Related Internet Sites
Math Estate: Stock Investment Tools
Forwards and Futures
1d. "Alternative" Asset Classes
Math Estate: Real Estate Tools
2. PORTFOLIOS (How do I package stocks, bonds, etc. together?)
Benefits of Diversification
3. RISK MEASURMENT AND MANAGEMENT (What can go wrong?)
Value at Risk
Value at Risk Explained
Bootstrapping to Compute Value-at-Risk Standard Errors
Value at Risk
4. PERFORMANCE EVALUATION (How am I doing?)
5. FINANCIAL MARKETS (What can I expect?)
6. Miscellaneous Items
Risk and Return to Investments in Five Emerging Nations
Quantitative Research and Trading