Showing posts with label Lessons in FM. Show all posts
Showing posts with label Lessons in FM. Show all posts

Sunday, February 24, 2008

Lessons in FM: Part VII - Futures

In one of my previous posts, I mentioned something about the mathematics of futures contracts and asked if anyone would like for me to expound upon the reference I made, and my co-author Samantha Goldflake (as well as other readers) called me out on it, so here goes.


First, I'd like to introduce what a financial derivative is, and from that what a futures contract is and how to value it. A financial derivative has nothing to do with the slope of a tangent line, but rather is an asset which derives its value from some underlying asset. Examples of this include mutual funds, put and call options, interest rate swaps, and futures. These assets all have no value whatsoever on their own, but only derive their value from what some other asset is doing. Many of the stocks in SL are actually financial derivatives.


As a personal note, I love financial derivatives. Financial derivatives are power. I've been asked, and have provided, guides and advice as to how to implement financial derivatives in Second Life to various exchange bigwigs, but so far nothing has come above of it. If any of you are considering doing something with derivatives, please send me an IM - I'd love to be involved.


To me, the most viable financial derivative for Second Life would be a futures contract. A futures contract specifies that an investor will either buy or deliver a set amount of an underlying asset at a set price at a set time. There is no option as to whether or not this sale/purchase will take place - it is set by the contract.


A lot of the numbers you hear tossed about in First Life financial commodities are actually futures numbers. The price of oil, for example, is almost always quoted as a futures price. The same is true with gold, silver, and other precious metals.


So how could you use this in Second Life? Simple - futures on the LindeX. Set up a price and a date, and then you've got a futures contract with USD for L$. Measures would have to be taken to prevent simply bailing out on the contract, but having investors place and x% deposit for taking the contract would probably suffice, depending on what x is.


Regardless, we may wish to know how to price these funky things called futures. It's actually surprisingly simple, and most of the mathematics I've already covered in my first Lessons in FM: Part I - Present Value. Technically, futures contracts with strike prices (the price specified in the contract) equal to the expected cost have zero premium, although in real trading there is always some transaction cost to doing this.

I slipped in the word "expected" to the definition above for a reason. Suppose we're doing a futures contract on a five-year zero-coupon bond yielding 10% per year, costing 1000 now and with an expiration date of 6 months from now. If the strike price is 1000, that contract will actually trade at a premium because 6 months from now the bond is worth more than 1000. We would expect it to be worth

1000*(1.10)1/2 = 1048.81


So the contract actually has a value of 48.81. For the contract to have zero premium, it must have a strike at the expected price of 1048.81, and then it will have zero premium.
To value these contracts then, you have to figure out your payoff and then discount it back to the present value. That's where my previous post comes into play - present value. The payoff on a forward contract is simply:

Payoff = Price - Strike

With the profit equal to

Profit = Price - Strike - Premium

Therefore, to calculate the value for a futures contract expiring at time t, just calculate

Present Value of E(Profit) =
[E(Price) - Strike - Premium] * (1 + i)-t


Where i is the interest rate being used. i varies depending on what you're valuing. With bonds, it's the interest rate. With stocks, it tends to be the dividend yield. With currencies, it's the interest rate in the currency you're using. So, for my futures contract on the LindeX, we'd have to use the Second Life interest rate (or USD interest rate, if we were buying the Lindens) to discount to present value.

I hope this helps demonstrate what futures are and how they work. As I mentioned above, they're used quite frequently in real-life commodity trading, and almost every farmer in the United States is familiar with them. (They tend to sell futures contracts early in the season to ensure they sell their crop at harvest.) If you have any questions, by all means ask!

GM

Thursday, January 3, 2008

Lessons in FM: Part VI - Rate of Return

Note: This is a continuation of the series Lessons in Financial Mathematics. Reading previous posts about this topic may aid in your understanding of this article. Note that this article is a direct continuation of Part V, and so reading that one would probably be a good idea.

Last week, I discussed my pseudo-accounting method of keeping track of the (Linden) dollar value of your gains and losses in an SL capital market. Now we turn to the topic of finding the rate of return earned over that month. I'll be using the same example as I came up with last time.

To be mathematically precise, the rate of return can become a very ugly equation very quickly. The reason is because you have to take into account all the cash flows in and out of your account at the times that they were taken. Basically, you're going to know your cash flows at time t (Ct), as well as the initial and final balances, and you have to solve something like this for i (and this is only for regular investment intervals!):

Final = Initial * (1+i)t + C1 * (1+i)(n-1)/t - C2 * (1+i)(n-2)/t + ... + Cn-1 * (1+i)1/t

This gets really ugly really fast. Normally even financial calculators wind up using a numerical method like Newton's Method to figure this one out. (You can tell this is a hard calculation on a financial calculator because often the calculator will pause for a few seconds before spitting out the answer.)

That being said, there are several things which can make this calculation easier:
  1. Having no cash flows. That chops that ugly polynomial down to a simple exponential problem rather quickly.

  2. Assume all cash flows occur at a certain time (such as at the middle of the month). This, combined with a simple interest assumption, results in a very compact formula which can be very close to the real rate of return, or very far off (if you're unlucky).

  3. Put your cash flows at fixed intervals. This makes it more like an annuity calculation, discussed in Part II of my Lessons in FM.

  4. Harness the power of Excel.
My First Life job requires me to be a venerable Excel ninja, so if you all ever need Excel lessons, just ask away. Google Spreadsheets have most of the Excel functions as well, but I may try to find some hosting space for good ol' honest-to-goodness Excel files as well if need be.

It is time to introduce you all to the XIRR function. IRR stands for "internal rate of return," and is used to calculate that ugly polynomial I referred to up there. XIRR takes the form XIRR(values,dates,[guess]). "Values" are the cash flows (positive for coming in, negative for going out), "dates" are the dates that correspond to the cash flows, and "guess" is where the iterative method starts from (just use .10 or leave it blank). XIRR returns the decimal of your return. For example, a 15% return is expressed as .15, not 15% or 1.15.

However, XIRR is based on a 365 day period, and we were dealing with a one-month period. That means that it isn't discounting quite correctly. Therefore, I suggest adjusting (mathematically: transforming) the date values so that they correspond to a year-long period, rather than a month. To do this, we'll use the YEARFRAC function, which takes a start date and end date and produces the fraction of a (365-day) year that occurs between those two dates. The syntax is YEARFRAC(start_date,end_date). To complete the transformation we want to take that fraction of the year between our start date and our (1-month) dates, multiply that by 365 (number of days different), multiply that by 12 (to stretch it to 1 year instead of 1 month), and then add it to our original starting date (to transform it). The formula looks like this:

YEARFRAC(start_date,end_date) * 12 * 365 + start_date = transformed_date

We know it works because our last day of the month transforms to the day before 1 year after the first day. We started at 12/1/2007, and the last date is 11/30/2008. We win.

The only other adjustment is a small annoyance with XIRR, and that is that our cash flows need to have their signs reversed. Also, one of the balances (preferably the beginning one) needs to be the opposing sign of the other one. I've made the beginning one negative.

XIRR turns out negative for our example because we've only included the realized gains. To get a more complete picture, I've made another couple columns with L$1,500 in unrealized gains included in the ending balance (completely arbitrary, as all unrealized gains calculations are). This results in a much nicer-looking positive rate of return.

You can find the completed spreadsheet here. It's the same as last time, but with a new tab marked "Rate of Return" where you can find these calculations. Once again, I'll happily pass out free copies of the spreadsheet so that you all can read the formulas if you like. Just email me at guardian.market@gmail.com.

I think that takes care of my first reader request. I love to answer questions and help people understand topics, so keep 'em coming. Anyone else want to provide a challenge?

Sunday, December 30, 2007

Lessons in FM: Part V - Gains and Losses

Note: This is a continuation of the series Lessons in Financial Mathematics. Reading previous posts about this topic may aid in your understanding of this article, but may not be necessary for this one. Also note that this topic is by request.

I got an email from a reader asking me to shed some light on the mystery of how to calculate your portfolio return from a mess of buys and sells that is done over the course of a period of time (the reader suggested one month). To be honest, this is not an easy problem. Even Maelstrom Baphomet has (more or less) admitted defeat on this issue.

Please take note that the tracking of financial position is a question perhaps better posed to accountants, but I'm going to show you how I would do it. I'm going to use some techniques accountants will (hopefully) recognize, but without some rigidity they demand. I will also be publishing another Lesson in FM which will be a continuation of this topic, but dealing with how to find the rate of return for your portfolio over a given time period.

I'm first going to tackle the problem of finding the (Linden) dollar value of your return and then address the problem of calculating the rate of return for the given time period. Throughout this article, I will be using one month as the time period in question.

For those of you wanting to track your gains and losses precisely, I'm going to need a few things from all of you who want to know your gains and losses.
  • First, keep track of every transaction you make, including date, ticker, share amount, and share price on Excel. A few of the exchanges also allow you to download this information. I'll be starting with a CapEx download style and building from there.
  • Secondly, make sure you have some way of notating which is a buy and a sell. I'm going to use separate columns for each type (debits and credits, anyone?).
  • Lastly, if you can spare a few seconds, having some notes in your spreadsheet will help you out greatly when you look over it later.
It is now is a good time to talk about realized vs. unrealized gains. By now, I'm guessing most of you know by now that the value your portfolio shows at most exchanges is a fictitious number. The only way to achieve such a value would be to sell every one of your shares at the last traded price, plus the commission. While this is normally not possible or practical, even trying to get an idea of the liquidation value may be impossible, as most exchanges show only the top bid/ask prices for each security, and you may have more shares than that to sell (liquidate). Thus, if you can't tell what the whole market's prices are, you have no way of knowing how many Linden dollars you could get for your shares.

Because of this, unrealized gains can be nearly impossible to track. I'm going to give you a way to track the realized gains/losses (things that either directly cost you cash or gave you cash) and let you estimate the unrealized gains/losses as you so choose. To find the total profit/loss, then, just add the two. For the rate of return calculation, you will need to estimate your unrealized gains/losses, but for the realized portion it is not necessary.

To compute realized gains/losses, you need to know how much you have paid for a security. At first, this may seem like a nightmare, as you may have purchased different amounts at different prices, making some sort of odd average seem very difficult. However, if we just use some Excel commands, we can easily compute the total number of shares held along with how much was paid for them.

Here is a spreadsheet with some transactions (all made-up) for the month of December. Apologies to any companies whose tickers I used inadvertently. I've only got 8 transactions in there to keep life simple, so that readers can check my formulas without too much trouble if need be. I've also listed the beginning and ending balances for the month. The bolded portion of the worksheet represents the part that comes straight off of the download from CapEx - everything else I've added. (Note that because the CapEx format lists cash flows from sells as negative and buys as positive, you must subtract the sum of those cash flows rather than adding them to your beginning balance.)

You'll have to do some scrolling to see the full worksheet. What I've done is separate out the buys and the sells so that I can add them more easily later. I've put buys on the left and sells on the right, and done it for both the cash value traded, as well as the number of shares traded. IF() statements are very useful for doing this quickly.

In Excel, there is a very nice command called SUMIF, which takes the following arguments: SUMIF(lookup_range,condition,sum_range). "lookup_range" refers to the range where the condition is located. "sum_range" is then the corresponding range to sum if the condition is met. For my purposes, the ticker symbol is a nice condition to sum on. Using SUMIF, you get the small chart I have at the bottom-right.

I want to go over the formula I have in the "realized gains/(losses)" cell, however. It reads:

ROUND(Cash_In - Cash_Out * (Shares_Sold / Shares_Bought), 2)

What I'm doing is averaging what your price paid for the stock was, and what you sold it for. All of this is on average. Cash_In is fine as is - you get 100% (less commission) of your sale price as a gain. The Cash_Out, on the other hand, may have been for more shares than you sold. Say you wanted to reduce your holdings in a company. You may still hang on to some shares, but you may have realized a profit on the ones that you did sell. Because of this, I'm multiplying the Cash_Out by the percentage of your shares that you sold. In the line detailing ABC, for example, the investor sold 80% of the holdings, so only 80% of the Cash_Out is applied to the Cash_In when computing these gains/losses.

The final cell calculates a basis for the remaining shares, although not complete in the strict, IRS sense of the word. However, it will provide a nice way for you to track shares carried over from month-to-month using that as your price.

In my happy example, the investor has realized L$103.79 in gains.

A few final comments:
  1. I am not an accountant. Any accountants out there who would like to critique my methods, please do so.
  2. I realize you all cannot view the formulas and that may be less than helpful if you don't have much experience with Excel. If you would like an Excel copy of this spreadsheet, email me at guardian.market@gmail.com.
  3. My First Life job requires me to be pretty disciplined at Excel, but nevertheless I do make mistakes. (Every once in awhile, Excel makes mistakes, too!) Always check at least a few parts of your calculations by hand or calculator when making spreadsheets.
Happy tracking!

Sunday, December 16, 2007

Lessons in FM: Part IV - Equivalent Portfolios

Note: This is a continuation of the series Lessons in Financial Mathematics. Reading previous posts about this topic may aid in your understanding of this article, but shouldn't be necessary for this one.

The last time I had checked, the Big Six and Big Eight bets had all but disappeared from modern craps tables on the Las Vegas strip. The reason is because no one was betting them. The Big Six and Big Eight bets paid even money (1:1) for a payout, but there was another bet, called "Place Six" or "Place Eight" which paid better odds (7:6) and hit at the exact same time that the Big Six and Big Eight bets did. Because of this, bettors learned that it was smarter to use the place bets rather than the large, Big Six or Big Eight bets on the corners. (To try these out for yourself, you can find a nice craps flash game, no real money used, here.)

The Big Six and Big Eight bets violated a fundamental rule of financial mathematics:

Portfolios with equivalent payouts will have the same price at all points in time.

The concept is simple enough - portfolios of investments that provide the exact amount of reward, in exchange for the exact amount of risk, will sell for the same value. If not, the market will buy the more advantageous one and sell the less advantageous other one until the prices come to equilibrium. Note that once again, this is economic argument and not mathematical proof. However, once mathematicians accept this argument, they get their (very powerful) equals sign back and begin to work their magic.

It's very difficult to frame this article in the context of Second Life finances because many of the tools used to bring this principle into practice don't exist there. Short selling, options, futures, etc. all don't exist in Second Life (yet - I'm still holding out hope), and so these strategies likely will not work there. Instead, then, venture with me into First Life and the world of financial derivatives. First, some quick definitions (with links for better explanations):

Long Buy - This is the stock transaction we're all used to: buying a stock and selling it at a later date.

Short Sell - This is selling a stock you do not own with the promise to pay it back later. You are liable for any dividends, splits, etc. that the stock undergoes while you are shorting it.

Calls - This is an option which gives the holder the right, but not the obligation, to purchase a specified security by a specific time at a specific price, all of which are spelled out in the details of the call contract.

Put - The opposite of a call, this is an option which gives the holder the right, but not the obligation, to sell a specified security by a specific time at a specific price, all of which are spelled out in the details of the put contract.

In the put and call articles of those Wikipedia links above, the authors have provided a graph on which the vertical axis shows the payout (or profit with the dashed line) and the horizontal axis shows the underlying security's price. If you sell the call or put instead of buying it, you simply invert those lines over the horizontal axis to get your new payoff/profit graph. These are shown below the first graphs.

The payoff graph for a long buy is an upward-sloping line (with slope 1). For each unit the underlying security (the stock) goes up, you get another unit of payoff and profit. As I mentioned above, if you happen to short the stock, then the line slopes down (slope = -1) and for each unit the stock goes up, you lose another unit of payoff and profit.

There is also some consideration to be given to interest in this matter. Options take place in the future, and so you have to compensate the investor for giving up their money for a period of time. This is usually done at the risk-free rate.

Out of all these graphs and rates, you can push, pull, bend, and tweak various portfolios to have the exact same payouts, even though on the face they look very different. Some of these portfolios will make even the most seasoned investor's head spin, but because of financial mathematical principles, the price can be easily calculated.

A good example of this is the put-call parity formula. This formula tells how the price of a put, call, the underlying stock, and the interest rate all depend on each other. Given any three of those, you can solve for the fourth.

Let's get an example here. At the time of this writing, the price of 3M Corporation (NYSE:MMM) was $85.93. A January 2009 call for $90 is selling for $8.42, and a January 2009 put at $90 is selling for $9.40. Using the put-call parity formula, we can calculate what the interest rate must be in order for these prices to be in line. From the article (with symbols properly translated):

Call Price + (Strike Price)/(1+i) = Put Price + Asset Price

8.42 + 95/(1 + i) = 9.40 + 85.93

i = 9.3%

Investors in the 3M Corporation believe that they must receive exactly 9.3% interest between now and January 16, 2009 (8.28% annually) in order to make these prices work. Note, however, that the put-call parity formula assumes no transactions costs. Your 9.3% rate of return would be offset by these transactions costs. Still, if you happen to be looking for a decent rate of return (and don't mind making your broker sweat in order to get it), this is something to consider.

Questions? Comments? To me, this is one of the most fascinating concepts in financial mathematics, because it allows you to construct new portfolios, new investments, new ways of moving money around and still have a good idea of what the price should be. It also allows for you to more easily see arbitrage opportunities, and exploit them if they happen to exist.

I have no idea what the next Lesson in FM topic will be. Suggestions, anyone? It doesn't have to be overly complex - if a reader would like me to take a stab at explaining a concept, I'll do my best. Just leave your thoughts in a comment here, and it'll find its way back to me.

Sunday, December 9, 2007

Lessons in FM: Part III - Risk

Note: This is a continuation of the series Lessons in Financial Mathematics. Please read Part I - Present Value and Part II - Annuities if you have not already done so. They will aid greatly in your understanding of subsequent parts of the series. Although for this article, you can probably get along just fine without reading those if you really don't want to.

Risk. You've probably heard the term a lot in various contexts. Around the SL capital markets, you've likely heard of it as far as business risks, risks of default, and/or risks of de-listing. I know of one company which specializes in insurance in SL, The Rock Insurance, which is a tool used to mitigate risk. But has anyone ever defined risk for you? Beware, however, because this is a mathematical definition of risk. Finance professionals probably wouldn't accept my definition, or only grudgingly so, because of the consequences it brings. Here we go, though:

Risk = Standard Deviation(Returns)

That's it. Anticlimactic, I know. Mathematically speaking, we measure risk through standard deviation (or variance, the square of standard deviation), which can usually be estimated. Please note that this means that risk occurs regardless of whether the security in question goes up or down. Obviously most investors would rather have the risk only go one direction, up, but such is life.

In order to accurately gauge risk, we need a measure of earnings without any risk. In my classes, we defined a risk-free asset, usually United States Treasury Bills (T-bills), to be the risk-free assets earning the risk-free rate of return. Take a look at what they're currently earning here. Note that these are annualized yields - you don't really earn 2.98% in 4 weeks' time.

Anything above that risk-free rate is defined to be a risky asset. How much investors need to be compensated in addition to the risk-free rate to invest in that asset is called the risk premium, and can be computed as follows:

Risk Premium = E(Return of Asset) - (risk-free rate)

Note that I've used the notation for expected value (E(X)) here, because the return on the asset in question is risky - it will vary. By definition, the asset determining the risk-free rate of return has no risk.

So let's take a look at the risk premium for a typical bank deposit in Second Life. The SLCapEx is currently offering rates of 0.1% compounded daily. To make that an annualized rate, we take

[(1 + .001)365 - 1] = .44025

or 44.025% return. But, we're not done here. The SLCapEx cash accounts are a risky asset, and there is some probability that they will not pay out. We've already seen several bank collapses in SL this year, and that's the probability I'm talking about. I'm going to assume, for illustrative purposes, that the SLCapEx has a 90% chance of paying that rate of return, and a 10% chance of paying zero. Therefore, we calculate the expected value of SLCapEx returns as:

(.44025)*(.90) + 0*(.10) = .39623 = 39.623%

The risk-free T-bill had a rate of return of 2.98%. Therefore, the risk premium on a SLCapEx cash account is 36.643%! That is pretty staggeringly high, and usually those risk premiums are found only on the Las Vegas Strip.

So why aren't hordes of billionaires coming into Second Life to take advantage of SLCapEx's great rate of return? They're afraid of the risk. To them, the risk of losing their capital (and they would use more sophisticated models than I assumed above) outweighs the potential return that they could get. They are (as are most investors) risk-averse, meaning that they prefer less risk to more risk. There are some who are risk-takers, that will choose a riskier asset to a less risky asset. The third option is being risk-neutral, which means you don't care about the risk and just look at the rate of return, and I believe it's the rarest case of the three.

At this point, some pictures might be helpful. What we need is a graph to help us understand the relationship between risk and return. Fortunately, one exists, and is called the efficient frontier. What you do is you graph risk (measured either by variance or standard deviation) on the x-axis and rates of return on the y-axis. Then, by economic argument (not mathematical proof, mind you) you only take the highest rates of return for given levels of risk. What you wind up with looks something like this:


Pretty, isn't it? That line represents the best that you can do in the market. The lower dots are ignored, because investors would choose the higher dots (securities with a greater rate of return for the same risk) instead. Think about it - if you had two banks, one with a savings account at 3% and the other at 5%, you'd probably go to the one with the 5% rate of return (ceteris paribus).

There are an infinite number of points on that curve, however. How do we decide which one to take? Well, that's where your individual preferences come in via something called utility curves (or indifference curves). Actually, these are multi-dimensional functions that are often projected onto two-dimensional graphs as curves. Anyway, these curves quantify how much return you must be compensated with in order to take on an additional unit of risk. You wind up with a picture that looks like this:



You should choose the portfolio that maximizes your utility and lies on the efficient frontier. Simple, right? Well, the mathematics gets messy, but ideally (economists would like to think) we do this every day without even thinking about it.

All of this stuff falls under the umbrella of modern portfolio theory, and I encourage those interested to do some exploring on Google to see the range of topics out there.

Next week - equivalent portfolios and their magic.

----

Just a quick note: I take requests here at Second Chaos. If there's some mathematical, financial, or economic topic you'd like me to explore, let me know. I might refuse topics that I feel are too far advanced for me, but I'll gladly make articles explaining standard deviation or variance or anything like that. Just FYI.

Saturday, December 1, 2007

Lessons in FM: Part II - Annuities

Note: This is a continuation of the series Lessons in Financial Mathematics. Please read Part I - Present Value if you have not already done so. It will aid greatly in your understanding of subsequent parts of the series.

Now that you understand the basics of present value, you might see how this could possible get a little cumbersome. For example, if you had monthly payments due for 30 years on a mortgage, you could do the sum of all the present values...all 30*12=360 of them...but it would take awhile. Fortunately, there is a better way: geometric series to the rescue!

From your early algebra classes (and I know all of you treasured those greatly), you might recall that if you have a sum where the terms increase or decrease by a common ratio (r) then you can easily condense the sum into a compact formula. The proof is very compact, but I will summarize the findings here:

a + a*r + a*r2 + a*r3 + ... + a*rn = a*(1-rn+1)/(1-r)

There's also a version for an infinite sum, provided that |r|<1:>2 + a*r3 + ... = a* (1/(1-r))

If we had a series of payments occurring at regular intervals, they would likely look something like this, where P is the payment, PV is present value, v is (as defined in Part I) 1/(1+i), i is the interest rate, and there are n payments:

P + P*v + P*v2 + P*v3 + ... + P*vn-1 = PV

(we use n-1 because we started at time t=0, so going from that to n-1 gives n payments) using the geometric series above, this simplifies to:

PV = P*(1-vn)/(1-v)

and 1-v can be simplified to i/(1+i) (I leave that proof to the reader). In FM, we define the discount rate d = i/(1+i). Therefore, the entire formula reduces to:

PV = P*(1-vn)/d

Cute, huh? Note that this formula is applicable if payments are made at the beginning of the period. If they are made at the end of the period, then you replace the d with an i (for the interest rate) and the formula still works (I'll leave the proof of that to the reader). Actuaries have a special symbol for that, which will be rather difficult to put in Blogger. It's named "a-double-dot angle n", and is a lowercase "a" with two dots over it. I can find an image of it from the Wikipedia article on actuarial notation:




The lowercase a represents the fact that it's an annuity (as opposed to being a capital A, which would represent an insurance). The angle-n represents that the payment is guaranteed for n periods. The double-dot represents that the payment occurs at the beginning of the period (if it is missing, then it occurs at the end of the period). The i after the angle is often omitted, but is simply a reminder of what interest rate is being used.

For the remainder of this post, I will assume end of period payments (thus eliminating the need for double dots), and spell out "a-angle-n" whenever I need to use it.

Let's do an example. Suppose you want to take out a loan for L$10,000 and the banker wants to charge you 7% interest. You agree to pay the loan back over 30 periods. The question then becomes, how much is the payment.

To solve this, you use the formula above. You know the present value (10,000), the interest rate (0.07), and the number of periods (n), so you just solve for the payment.

PV = P * "a-angle-30"
10,000 = P * (1 + (1/1.07)^30)/(0.07)
10,000 = P * (12.40904)
P = 805.86

Your payment would be L$805.86 at the end of each period.

You might be saying "there has to be an easier way" at this point. Fortunately, there is. I give you, the financial calculator! To show you how to use this, we'll go over the previous example again with the calculator.

To start, note that the general way of inputting numbers to the right-hand side of that calculator is to enter the number first, and then press the value that you want it to go to. Also note that we enter percentages, so 7% is entered at 7, not 0.07. To do the previous example, follow these steps:

  1. Enter 10000
  2. Press PV
  3. Enter 7
  4. Press i%
  5. Enter 0
  6. Press FV (the loan is worth zero at the end)
  7. Enter 30
  8. Press N
  9. Press Calculate
  10. Press PMT
Now, observe that the number it spit out was the same as I calculated above (rounded): 805.86. Funny how that works.

I haven't actually defined that funny word in the title of the article yet: annuities. An annuity is a set of payments, guaranteed or conditional, that occur at regular intervals. There is a lot more detail that can be set up with annuities, such as varying the frequency of payment (say, to quarterly), the amount of payment (increasing/decreasing), the time frame (infinite annuity = perpetuity, by the way), etc. These are annuities, and they are the basis of loans, dividends, millions of people's retirements, insurance, etc. Annuities are quite flexible and applicable in a variety of financial settings.

I'll leave you to play with that calculator. Note that it only appears to do end-of-period calculations. You can enter any four of the five variables, and it'll compute the last one (provided it is solvable). The next segment will have less math (I think...) and deal with a more economic topic: Risk.

Saturday, November 24, 2007

Lessons in FM: Part I - Present Value

I'm going to start a series of educational posts about the basic concepts of Financial Mathematics, my major. These are not intended to be overly complex and I will do my best to keep the calculus out of it. There will be a mix of mathematics and economics, and the symbols used will likely be actuarial in nature. This convention won't bother those who are new to the topic, but might if you have some familiarity with it already from another discipline, like Finance.

Present value tells you the value of some amount at one point in time at another point in time. Usually, you're trying to bring payments at some future time back and find out what they're worth today. To find this, you need the future value(s) of payments (FV), the interest rate (i), and the times at which these payments will be made (t or tk). We'll work with just one payment for now, and we'll also be using compound interest.

The equation we start with is pretty basic:

Present Value * Interest = Future Value

in symbols,

PV * (1+i)t = FV

To solve for PV, we divide both sides by (i+i)^t. However, remember that actuarial notation I mentioned? Actuaries use this method (dividing by the interest factor) so often that they have their own symbol for it, v ("vee").

Definition: v = 1 / (1 + i)

Using this notation, we solve for PV and get

PV = FV * vt

And that's it! Just plug your numbers in after that! So long as you have three of the variables, you can solve for the fourth.

So that's great and all, Guardian, but what if I have more than one payment? Well, fortunately, you can just add them up. Say you have two payments - one at time t = 1 and the other at time t = 3. To find what they're worth today, just add them. You get

PV1 = FV1*v1
PV3 = FV3*v3

PV1 + PV3 = PVtotal = FV1*v1 + FV3*v3

The tricky thing is finding the interest rate which makes that equation balance. This is a problem that often has no direct solution and must be done iteratively using numerical methods. That's part of that scary math I promised I wouldn't get into. (As an aside, if people really want to see that mathematics, comment that you do and I'll whip something up.)

So what good does this do in the Second Life capital markets? Well, theoretically (and in Second Life, I mean very theoretically), that is what all the stock prices are based on. Investors value securities according to what they think the future value of it is, discounted with interest (this interest rate likely has a risk premium built into it, however). Whether that future value is based off of reselling the security, dividend payments, or both is something that each investor must decide for themselves. However, if you know your own preferences and you can make guesses as to the dividend amounts and/or stock prices, you can use this method to value what "your" price of the securities is and whether or not it's a good buy for you.

So what if there are a lot of payments, but they occur in regular intervals? I'll tackle that one in Part II.
Google