Heat Map Calculation
Step 1
We use pricing data from Fenics as the input for our detailed calculation methods.

Matrix Fields
Maturity: Represents the time to maturity of the financial instrument, typically denoted in months (e.g., 1M, 2M, etc.).
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.
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.
str: Straddle. It is the sum of the implied volatilities of a call and a put option with the same strike price, typically ATM.
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 , where is the interest rate and is the time to maturity.
quoted_df: Quoted Discount Factor. Similar to the base discount factor, but it may reflect market quotes or other adjustments , where is the market-quoted interest rate (or adjusted rate) and is the time to maturity (in years).
spot: The current price of the underlying asset.
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 , where is the domestic interest rate, is the foreign interest rate, and is the time to maturity.
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.

Year Fraction (yearfrac): The
yearfracfield represents the fraction of the year corresponding to the maturity period. Formula:CRRA Exponent: For simplicity, we use a default constant value of 0 for the CRRA Exponent in our calculations.
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:
Calculate the standard deviation: This is derived from the volatility and the square root of the year fraction.
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.
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:
At the smallest rate:
Calculate the probability using the cumulative distribution function (CDF) for CRRA at the smallest rate.

For subsequent rates:
Calculate the probability using the difference in CDF values between the previous rate and the current rate.

Compararision

Last updated