Code covered by the BSD License  

Highlights from
Modeling Variable Annuities with MATLAB

image thumbnail

Modeling Variable Annuities with MATLAB


Yi Wang (view profile)


This demo shows how to price variable annuity product (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
    EP.TimeSeries = flipud(sData);
    EP.Ticker = Ticker;
    EP.FromDate = FromDate;
    EP.ToDate = ToDate;
    EP.Period = Period;
    d = load('stock.mat');
    EP = d.EP;

Contact us