Ejemplo n.º 1
0
        /// <summary>
        /// Determine present value of swaption from fiven paths of
        /// forward LIBOR  rates and  numeraire adjusted discount factors
        /// </summary>
        /// <param name="paths"></param>
        /// <returns>Payoff at exercise date</returns>
        public double DiscountedPayoff(LiborMarketModelPath paths)
        {
            // European swaption, hence there is no path dependence
            // therefore only we only need state of model at the
            // exercise date
            var j            = Array.IndexOf(paths.Dates, ExerciseDate);
            var forwardRates = paths.ForwardRates.Column(j);
            var numeraireAdjustedDiscountFactors = paths.NumeraireAdjustedDiscountFactors.Column(j);

            // present value of the underling swap at exercise date
            var presentValue = PresentValueUnderlyingSwap(paths.InitialNumeraire, paths.Tenors,
                                                          forwardRates, numeraireAdjustedDiscountFactors,
                                                          Strike, Nominal);

            // payoff of the swaption
            return(Math.Max(presentValue, 0));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Discounted payoff of  caplet
        /// Payoff P(T+alpha) = max(N * alpha * L(T,T,T+alpa) - K, 0)
        /// </summary>
        /// <param name="paths"></param>
        /// <returns>Payoff at exercise date</returns>
        public double DiscountedPayoff(LiborMarketModelPath paths)
        {
            // Choose L(T,T, T + alpha)
            var j = Array.IndexOf(paths.Dates, FixingDate);
            var i = Array.IndexOf(paths.TenorStructure, FixingDate);

            var forwardRate = paths.ForwardRates[i, j];

            // Choose D(T+alpha) = B(T+alpha,T+alpha)/B(T+alpha,Tk)
            var jj = Array.IndexOf(paths.Dates, ExpiryDate);
            var ii = Array.IndexOf(paths.TenorStructure, ExpiryDate);

            var numeraireAdjustedDiscountFactor = paths.NumeraireAdjustedDiscountFactors[ii, jj];

            // payoff of the swaption
            return(paths.InitialNumeraire * numeraireAdjustedDiscountFactor * Math.Max(Tenor * Principal * forwardRate - CapRate, 0));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Discounted payoff of  caplet
 /// Payoff P(T+alpha) = max(N * alpha * L(T,T,T+alpa) - K, 0)
 /// </summary>
 /// <param name="paths"></param>
 /// <returns>Payoff at exercise date</returns>
 public double DiscountedPayoff(LiborMarketModelPath paths)
 {
     return(Caplets.Sum(caplet => caplet.DiscountedPayoff(paths)));
 }