BermudanSwaption          package:RQuantLib          R Documentation

_B_e_r_m_u_d_a_n _s_w_a_p_t_i_o_n _v_a_l_u_a_t_i_o_n _u_s_i_n_g _s_e_v_e_r_a_l _s_h_o_r_t-_r_a_t_e _m_o_d_e_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     'BermudanSwaption' prices a Bermudan swaption with specified
     strike and maturity (in years), after calibrating the selected
     short-rate model to an input swaption volatility matrix. Swaption
     maturities are in years down the rows, and swap tenors are in
     years along the columns, in the usual fashion. It is assumed that
     the Bermudan swaption is exercisable on each reset date of the
     underlying swaps.

_U_s_a_g_e:

     BermudanSwaption(params, tsQuotes, swaptionMaturities, swapTenors,
     volMatrix)

_A_r_g_u_m_e_n_t_s:

  params: A list specifying the 'tradeDate' (month/day/year),
          'settlementDate', 'payFixed' flag, 'strike', pricing
          'method', and curve construction options (see _Examples_
          section below). Curve construction options are 'interpWhat'
          (possible values are 'discount', 'forward', and 'zero') and
          'interpHow' (possible values are 'linear', 'loglinear' , and
          'spline'). Both 'interpWhat' and 'interpHow' are ignored when
          a flat yield curve is requested, but they must be present
          nevertheless. The pricing method can be one of the following
          (all short-rate models):

            'G2Analytic'  G2 2-factor Gaussian model using analytic formulas.
            'HWAnalytic'  Hull-White model using analytic formulas.
            'HWTree'      Hull-White model using a tree.
            'BKTree'      Black-Karasinski model using a tree.

tsQuotes: Market observables needed to construct the spot term
          structure of interest rates. A list of name/value pairs. See
          the help page for 'DiscountCurve' for details.

swaptionMaturities: A vector containing the swaption maturities
          associated with the rows of the swaption volatility matrix.

swapTenors: A vector containing the underlying swap tenors associated
          with the columns of the swaption volatility matrix.

volMatrix: The swaption volatility matrix. Must be a 2D matrix stored
          by rows. See the example below.

_D_e_t_a_i_l_s:

     This function is based on 'QuantLib' Version 0.3.10. It introduces
     support for fixed-income instruments in 'RQuantLib'.

     At present only a small number of the many parameters that can be
     set in 'QuantLib' are exposed by this function. Some of the
     hard-coded parameters that apply to the current version include:
     day-count conventions, fixing days (2), index (Euribor), fixed leg
     frequency (annual), and floating leg frequency (semi-annual).
     Also, it is assumed that the swaption volatility matrix
     corresponds to expiration dates and tenors that are measured in
     years (a 6-month expiration date is not currently supported, for
     example).

     Given the number of parameters that must be specified and the care
     with which they must be specified (with no defaults), it is not
     practical to use this function in the usual interactive fashion.

     The simplest approach is simply to save the example below to a
     file, edit as desired, and 'source' the result. Alternatively, the
     input commands can be kept in a script file (under Windows) or an
     Emacs/ESS session (under Linux), and selected parts of the script
     can be executed in the usual way.

     Fortunately, the C++ exception mechanism seems to work well with
     the R interface, and 'QuantLib' exceptions are propagated back to
     the R user, usually with a message that indicates what went wrong.
     (The first part of the message contains technical information
     about the precise location of the problem in the 'QuantLib' code.
     Scroll to the end to find information that is meaningful to the R
     user.)

_V_a_l_u_e:

     'BermudanSwaption' returns a list containing calibrated model
     paramters (what parameters are returned depends on the model
     selected) along with: 

   price: Price of swaption in basis points (actual price equals
          'price' times notional divided by 10,000)

ATMStrike: At-the-money strike

  params: Input parameter list

_A_u_t_h_o_r(_s):

     Dominick Samperi

_R_e_f_e_r_e_n_c_e_s:

     Brigo, D. and Mercurio, F. (2001) _Interest Rate Models: Theory
     and Practice_, Springer-Verlag, New York.

     For information about 'QuantLib' see <URL: http://quantlib.org>.

     For information about 'RQuantLib' see <URL:
     http://dirk.eddelbuettel.com/code/rquantlib.html>.

_S_e_e _A_l_s_o:

     'DiscountCurve'

_E_x_a_m_p_l_e_s:

     # This data is taken from sample code shipped with QuantLib 0.3.10.
     params <- list(tradeDate=c(2, 15, 2002),
                      settleDate=c(2, 19, 2002),
                      payFixed=TRUE,
                      strike=.06,
                      method="G2Analytic",
                      interpWhat="discount",
                      interpHow="loglinear")
                     
     # Market data used to construct the term structure of interest rates
     tsQuotes <- list(d1w  =0.0382,
                      d1m  =0.0372,
                      fut1=96.2875,
                      fut2=96.7875,
                      fut3=96.9875,
                      fut4=96.6875,
                      fut5=96.4875,
                      fut6=96.3875,
                      fut7=96.2875,
                      fut8=96.0875,
                      s3y  =0.0398,
                      s5y  =0.0443,
                      s10y =0.05165,
                      s15y =0.055175)

     # Use this to compare with the Bermudan swaption example from QuantLib
     #tsQuotes <- list(flat=0.04875825)

     # Swaption volatility matrix with corresponding maturities and tenors
     swaptionMaturities <- c(1,2,3,4,5)

     swapTenors <- c(1,2,3,4,5)

     volMatrix <- matrix(
                         c(0.1490, 0.1340, 0.1228, 0.1189, 0.1148,
                           0.1290, 0.1201, 0.1146, 0.1108, 0.1040,
                           0.1149, 0.1112, 0.1070, 0.1010, 0.0957,
                           0.1047, 0.1021, 0.0980, 0.0951, 0.1270,
                           0.1000, 0.0950, 0.0900, 0.1230, 0.1160),
                         ncol=5, byrow=TRUE)

     # Price the Bermudan swaption
     pricing <- BermudanSwaption(params, tsQuotes,
                                 swaptionMaturities, swapTenors, volMatrix)
     summary(pricing)

