Spot Rate and Forward Rate Calculator

Spot Rate and Forward Rate Calculator

function calculateForwardRate() { var spotRate1 = parseFloat(document.getElementById("spotRate1").value); var spotRate2 = parseFloat(document.getElementById("spotRate2").value); var years = parseFloat(document.getElementById("years").value); var resultDiv = document.getElementById("result"); if (isNaN(spotRate1) || isNaN(spotRate2) || isNaN(years) || years <= 0) { resultDiv.innerHTML = "Please enter valid numbers for all fields, and ensure the number of years is greater than zero."; return; } // Convert percentages to decimals for calculation var r1 = spotRate1 / 100; var r2 = spotRate2 / 100; // Formula for calculating the forward rate between t1 and t2 (where t1 is the start year and t2 is the end year) // Forward Rate (t1, t2) = [ (1 + Spot Rate t2)^t2 / (1 + Spot Rate t1)^t1 ] ^ (1 / (t2 – t1)) – 1 // In this calculator, t1 is implicitly year 1 (so its value is 1) and t2 is the sum of year 1 and the number of years to the forward rate. // Let's assume spotRate1 is the rate for year 1, and spotRate2 is the rate for year 2 (or the end of the period we are interested in for the spot rate). // If we want to calculate the forward rate from year 1 to year 1 + 'years', we need the spot rate for year 1+years. // The common scenario is calculating the forward rate between two different maturities using existing spot rates. // For example, to find the 1-year forward rate starting in 1 year, given a 1-year spot rate and a 2-year spot rate. // Here, spotRate1 is the rate for the first period (e.g., 1 year). // spotRate2 is the rate for the second, longer period (e.g., 2 years). // 'years' represents the duration of the forward rate (e.g., 1 year for a 1-year forward rate). // Re-interpreting for clarity: // var spotRate1 be the current spot rate for maturity T1 (e.g., 1 year). // var spotRate2 be the current spot rate for maturity T2 (e.g., 2 years). // We want to find the forward rate for the period between T1 and T2. // The number of years for the forward rate is T2 – T1. In our input, 'years' is this difference. // So, T1 = 1 (implicitly, as spotRate1 is the rate for the first year/period) // T2 = 1 + years // For this to work, spotRate2 must be the spot rate for maturity (1 + years). var T1 = 1; // Assuming spotRate1 is for the first year/period var T2 = 1 + years; // The maturity for spotRate2 // Check if spotRate2 actually represents the rate for T2. The input labels are a bit ambiguous. // Let's assume the user inputs the spot rate for year 1 and the spot rate for year (1 + 'years'). // So, if 'years' is 1, they input the 1-year spot rate and the 2-year spot rate. var forwardRateDecimal = (Math.pow(1 + r2, T2) / Math.pow(1 + r1, T1)) – 1; var forwardRatePercentage = forwardRateDecimal * 100; // Format the output to two decimal places resultDiv.innerHTML = "The " + years + "-year forward rate starting in " + T1 + " year(s) is: " + forwardRatePercentage.toFixed(4) + "%"; }

Understanding Spot Rates and Forward Rates

In the world of finance, interest rates are not static; they change over time and depend on the maturity of a debt instrument. Two fundamental concepts that help us understand these time-varying interest rates are spot rates and forward rates.

What is a Spot Rate?

A spot rate (also known as a zero-coupon yield or zero rate) is the yield to maturity on a zero-coupon bond. Essentially, it's the interest rate for a single payment at a specific point in the future. For example, a 1-year spot rate is the interest rate you would earn on an investment today that matures in exactly one year. A 2-year spot rate is the interest rate for an investment maturing in two years, and so on.

Spot rates are crucial because they represent the pure time value of money for different maturities, without any embedded coupon payments. They are the building blocks for pricing all other fixed-income securities.

What is a Forward Rate?

A forward rate is an interest rate that is agreed upon today for a loan or investment that will occur at some point in the future. It's essentially an expectation of what a future spot rate will be. For instance, a 1-year forward rate starting in 1 year (often denoted as $${_1}f_1$$) is the interest rate agreed upon today for a 1-year investment that begins one year from now.

Forward rates are important for hedging and for understanding market expectations about future interest rate movements. They are derived from current spot rates.

The Relationship Between Spot Rates and Forward Rates

The core principle connecting spot rates and forward rates is the concept of no-arbitrage. This means that an investor should achieve the same return by investing for a longer period at the spot rate for that longer period, as they would by investing for a shorter period at the initial spot rate and then reinvesting at the prevailing forward rate for the remaining period.

Mathematically, if you know the spot rate for time $${t_1}$$ ($$r_{t_1}$$) and the spot rate for time $${t_2}$$ ($$r_{t_2}$$), where $${t_2 > t_1}$$, you can calculate the forward rate ($${_ {t_2-t_1}}f_{t_1}$$) for the period between $${t_1}$$ and $${t_2}$$ using the following formula:

$$$$(1 + r_{t_2})^{t_2} = (1 + r_{t_1})^{t_1} \times (1 + {_{t_2-t_1}}f_{t_1})^{(t_2-t_1)}$$$

Rearranging this to solve for the forward rate:

$$$$(1 + {_{t_2-t_1}}f_{t_1})^{(t_2-t_1)} = \frac{(1 + r_{t_2})^{t_2}}{(1 + r_{t_1})^{t_1}}$$$

$$$$${_{t_2-t_1}}f_{t_1} = \left( \frac{(1 + r_{t_2})^{t_2}}{(1 + r_{t_1})^{t_1}} \right)^{\frac{1}{t_2-t_1}} – 1$$$

How the Calculator Works

This calculator helps you determine a forward interest rate based on two known spot rates and the duration of the forward period. It assumes:

  • Spot Rate (Year 1) (%): This is the current spot rate for the first period, typically 1 year.
  • Spot Rate (Year 2) (%): This is the current spot rate for the longer maturity period. If you want to calculate a forward rate that starts after the first period, this would be the spot rate for the total period from inception to the end of the forward rate period. For example, if 'Spot Rate (Year 1)' is the 1-year spot rate, and 'Number of Years to Forward Rate' is 1, then 'Spot Rate (Year 2)' should be the 2-year spot rate.
  • Number of Years to Forward Rate: This is the length of the period for which you want to determine the forward rate, starting after the first period.

The calculator uses the formula derived above to compute the implied forward rate.

Example Calculation

Let's say:

  • The current 1-year spot rate is 2.50% (i.e., `spotRate1 = 2.50`).
  • The current 2-year spot rate is 3.00% (i.e., `spotRate2 = 3.00`).
  • You want to find the 1-year forward rate that starts in 1 year (i.e., `years = 1`). This means you are looking for the rate between the end of year 1 and the end of year 2.

Here, $${t_1 = 1}$$, $${r_{t_1} = 0.025}$$. And $${t_2 = 1 + 1 = 2}$$, $${r_{t_2} = 0.03}$$.

Using the formula:

$$$$(1 + { _1}f_1) = \left( \frac{(1 + 0.0300)^2}{(1 + 0.0250)^1} \right)^{\frac{1}{1}} – 1$$$

$$$$(1 + { _1}f_1) = \left( \frac{1.0300^2}{1.0250} \right) – 1$$$

$$$$(1 + { _1}f_1) = \left( \frac{1.0609}{1.0250} \right) – 1$$$

$$$$(1 + { _1}f_1) = 1.035024 – 1$$$

$$$${ _1}f_1 = 0.035024$$$

Converting this back to a percentage, the 1-year forward rate starting in 1 year is approximately 3.5024%.

Leave a Comment