Code covered by the BSD License  

Highlights from
Modeling Variable Annuities with MATLAB

image thumbnail

Modeling Variable Annuities with MATLAB

by

 

15 Mar 2010 (Updated )

Pricing Guaranteed Minimum Withdrawal Benefit

getEquityData(Ticker, FromDate, ToDate, Period)
function EP = getEquityData(Ticker, FromDate, ToDate, Period)
conn = yahoo;
if isconnection(conn)
    for i = 1:length(Ticker)
    d = fetch(conn, Ticker(i), 'Close', FromDate, ToDate, Period);
    sData(:, i) = d(:, 2);                                            %#ok
    end
    EP.TimeSeries = flipud(sData);
    EP.Ticker = Ticker;
    EP.FromDate = FromDate;
    EP.ToDate = ToDate;
    EP.Period = Period;
else
    d = load('stock.mat');
    EP = d.EP;
end

Contact us