Heat Map Calculation

Step 1

We use pricing data from Fenics as the input for our detailed calculation methods.

Sample data from Fenics

Matrix Fields

  1. Maturity: Represents the time to maturity of the financial instrument, typically denoted in months (e.g., 1M, 2M, etc.).

  2. atm: At-The-Money (ATM) volatility. It is the implied volatility of options where the strike price is equal to the current price of the underlying asset.

  3. rr: Risk Reversal. It is the difference in implied volatility between a call option and a put option with the same delta, usually 25 delta. It indicates the skewness of the implied volatility.

  4. str: Straddle. It is the sum of the implied volatilities of a call and a put option with the same strike price, typically ATM.

  5. base_df: Base Discount Factor. It is used to calculate the present value of future cash flows. The formula for the discount factor is usually base_df=eβˆ’rβ‹…T\text{base\_df} = e^{-r \cdot T}, where rr is the interest rate and TT is the time to maturity.

  6. quoted_df: Quoted Discount Factor. Similar to the base discount factor, but it may reflect market quotes or other adjustments quoted_df=eβˆ’qβ‹…T\text{quoted\_df} = e^{-q \cdot T}, where qqf(x)=xβˆ—e2piiΞΎxf(x) = x * e^{2 pi i \xi x} is the market-quoted interest rate (or adjusted rate) and TT is the time to maturity (in years).

  7. spot: The current price of the underlying asset.

  8. fwd: Forward Rate. The rate agreed upon today for a transaction that will occur at a future date. It is usually calculated using the formula fwd=spotΓ—e(rβˆ’f)β‹…T\text{fwd} = \text{spot} \times e^{(r - f) \cdot T}, where rr is the domestic interest rate, ff is the foreign interest rate, and TT is the time to maturity.

  9. fwd_offset: Forward Offset. It is the difference between the forward rate and the spot rate, indicating the premium or discount of the forward rate.

Step 2

At this step, we add the fields and begin the calculation process.

  1. Year Fraction (yearfrac): The yearfrac field represents the fraction of the year corresponding to the maturity period. Formula: yearfrac=months12\text{yearfrac} = \frac{\text{months}}{12}

  2. CRRA Exponent: For simplicity, we use a default constant value of 0 for the CRRA Exponent in our calculations.

  3. Normalizing Constant: To calculate the normalizing constant, we use the method defined in getNormalisingConstant. This method ensures that the probabilities sum to one, which is essential for accurate probability calculations.

Step 3

In this step, we use the given data for a 6-month maturity (6M) to calculate the dynamic range of exchange rates and then determine the probabilities for each rate within this range. We'll leverage the normal distribution to compute the minimum and maximum exchange rates and calculate the probability values for each rate step.

Dynamic Range Calculation

Function: calculateDynamicRange

This function computes the minimum and maximum exchange rates based on the spot rate, volatility, year fraction, forward rate, and a minimum probability level.

Parameters:

  • spotRate: The current exchange rate.

  • volatility: The volatility of the exchange rate.

  • yearfrac: The fraction of the year corresponding to the maturity period.

  • forwardRate: The forward exchange rate.

  • minProbabilityLevel: The minimum probability level (usually a small value to determine extreme bounds).

Logic:

  1. Calculate the standard deviation: This is derived from the volatility and the square root of the year fraction.

  2. Determine the z-score: The z-score is computed for the given minimum probability level using the inverse cumulative distribution function of the normal distribution.

  3. Calculate the dynamic range: The minimum and maximum rates are then calculated by adjusting the forward rate by the product of the z-score and the standard deviation.

Rate Steps Calculation

With the dynamic range determined, we now calculate the exchange rates at each step, starting from the minimum rate and increasing by 12 steps to the maximum rate.

Probability Calculation for Each Rate

Logic:

  1. At the smallest rate:

    • Calculate the probability using the cumulative distribution function (CDF) for CRRA at the smallest rate.

CDFCrra visualization
  1. For subsequent rates:

    • Calculate the probability using the difference in CDF values between the previous rate and the current rate.

CDFCrraBetween Visualization

Compararision

Last updated