%% Compute the Real Zero Rates From the Real Yields of Inflation-Linked Bonds
% Use zbtyield to compute the real zero rates from the real yields of inflation-linked bonds.

% Load the data
load usbond_02Sep2008
Settle = datenum('02-Sep-2008');

% Compute the real yields and then compute the real zero rates.

RealYields = bndyield(TIPSPrice,TIPSCoupon,Settle,TIPSMaturity);
TIPSBonds = [TIPSMaturity TIPSCoupon];
[RealZeroRates, CurveDates] = zbtyield(TIPSBonds, RealYields, Settle)

% Copyright 2018 The MathWorks, Inc.