%% Calculate the Sensitivity Values for an Interest-Rate Swaption
% Define the interest rate and the model parameters.

SwapRate = 0.0357; 
Strike = 0.03; 
Alpha = 0.036; 
Beta = 0.5; 
Rho = -0.25; 
Nu = 0.35; 
Rates = 0.05;

%
% Define the Settle, ExerciseDate, and OptSpec for an interest-rate swaption.

Settle = datenum('15-Sep-2013'); 
ExerciseDate = datenum('15-Sep-2015'); 
OptSpec = 'call';

%
% Define the RateSpec for the interest-rate curve.

RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, ...
'EndDates', ExerciseDate, 'Rates', Rates, 'Compounding', -1, 'Basis', 1)

%
% Calculate the Delta and Vega sensitivity values for the interest-rate swaption.

[SABRDelta, SABRVega] = optsensbysabr(RateSpec, Alpha, Beta, Rho, Nu, Settle, ...
ExerciseDate, SwapRate, Strike, OptSpec, 'OutSpec',  {'Delta', 'Vega'})

% Copyright 2015 The MathWorks, Inc.