%% Compute the Price of an Asian Option Using the Kemna-Vorst Model
% Define the RateSpec.

StartDates = 'Jan-1-2013';
EndDates = 'Jan-1-2014';
Rates = 0.035;
Basis = 1;
RateSpec = intenvset('ValuationDate', StartDates, 'StartDates', StartDates, ...
'EndDates', EndDates,'Rates', Rates,  'Compounding', -1, 'Basis', Basis)

%
% Define the StockSpec for the asset.

AssetPrice = 100;
Sigma = 0.15;
DivType = 'continuous';
DivAmounts = 0.03;
StockSpec = stockspec(Sigma, AssetPrice, DivType, DivAmounts)

%
% Define the Asian 'call' and 'put' options.

Strike = 102;
OptSpec = {'put'; 'call'};
Settle = 'Jan-1-2013';
Maturity = 'Apr-1-2013';

%
% Compute the European geometric Average Price for the Asian option using the Kemna-Vorst model.

Price = asiansensbykv(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity)

% Copyright 2015 The MathWorks, Inc.