www.gusucode.com > fininst 案例源码程序 matlab代码 > fininst/PriceaConvertibleBondUsingaCRRTreeExample.m

    %% Price Convertible Bond Using a CRR Tree  

% Copyright 2015 The MathWorks, Inc.


%% 
% Price a convertible bond using the following data for the interest-rate term structure: 
StartDates =  'Jan-1-2014'; 
EndDates = 'Jan-1-2015'; 
Rates = 0.1; 
Basis = 1; 
%% 
% Create the |RateSpec| and |StockSpec|. 
Sigma = 0.3;
Price = 50;

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

StockSpec = stockspec(Sigma,Price)
%% 
% Create the CRR tree for the equity. 
Settle = '1-Jan-2014';
Maturity = '1-Oct-2014';
NumSteps = 3; 
TimeSpec = crrtimespec(Settle,Maturity,NumSteps);
CRRT = crrtree(StockSpec,RateSpec,TimeSpec)  

%% 
% Define and price the convertible bond. 
CouponRate = 0;
Period = 1;
ConvRatio = 2;
CallExDates = '1-Oct-2014';
CallStrike = 115;
AmericanCall = 1;
Spread = 0.05;

[Price,PriceTree,EqtTree,DbtTree] = cbondbycrr(CRRT,CouponRate,Settle,Maturity,ConvRatio,...
'Period',Period,'Spread',Spread,'CallExDates',CallExDates,'CallStrike',CallStrike,'AmericanCall',AmericanCall)