資源簡(jiǎn)介
本文章中包括我編寫 matlab 最小二乘蒙特卡羅(LMS)美式期權(quán)定價(jià) 程序,以及相關(guān)資料,歡迎下載學(xué)習(xí),如有錯(cuò)誤指不吝賜教
代碼片段和文件信息
function?p?=?AmericanOption(rkTsPath)
%?American?call?Option
[nStepnPath]?=?size(sPath);
nStep?=?nStep?-?1;
%?time?step
deltaT?=?T?/?nStep;
%?initialize?cashflow?matrix
cashflow?=?zeros(size(sPath));
%?the?last?row‘s?value
cashflow(end:)?=?max(sPath(end:)-k0);
%?etime?:?Record?the?optimal?execution?time
etime?=?(nStep+1)?*?ones(1nPath);
%?Calculate?from?the?back?to?the?front
for?i?=?nStep:-1:2
%?row‘s?value
cashflow(i:)?=?max(sPath(i:)-k0);
%?find?Find?the?location?of?real-value?options
ind?=?find(cashflow(i:)?>?0);
%?Read?the?cash?flow?corresponding?to?line?I?+?1
%?which?corresponds?to?the?real?value?path?of?line?I
cf?=?cashflow(i+1ind);
%?Discount?cash?flow
v?=?cf?.*?exp(-r?*?deltaT);
%?Find?out?the?stock?prices?corresponding?to?these?locations
s?=?sPath(iind);
%?Regression?to?find?the?parameters?of?a?b?c
md?=?fitlm(sv‘purequadratic‘);
fun?=?@(x)?(md.Coefficients.Estimate(1)?+?md.Coefficients.Estimate(2)?.*?x?...
????+?md.Coefficients.Estimate(3)?.*?x?.^?2);
%?Continuing?Holding?Value?of?Options
????hv?=?fun(s);
????
%??
%?%?Comparing?holding?value?with?execution?value?using?ind1?to?mark?the?optimal?execution?time
%?ind1?=?cashflow(iind)?>?hv;
%?%?If?the?holding?value?is?less?than?the?execution?value?and?the?position?option?is?executed?immediately?
%?%?the?cash?flow?at?the?position?of?i+1?is?0.
%?cashflow(i+1ind(ind1))?=?0;
%?%?Find?out?the?non-optimal?position
%?ind2?=?setdiff(1:nPathind(ind1));
%?%?Discount?cash?flow?of?I?+?1?position??to?I?position
%?cashflow(iind2)?=?cashflow(i+1ind2)?.*?exp(-r?*?deltaT);
%?Comparing?holding?value?with?execution?value?using?ind1?to?mark?the?optimal?execution?time
ind1?=?cashflow(iind)?>?hv;
cashflow(iind(~ind1))?=?hv(~ind1);
%?If?the?holding?value?is?less?than?the?execution?value?and?the?position?option?is?executed?immediately?
%?the?cash?flow?at?the?position?of?i+1?is?0.
cashflow(i+1:endind(ind1))?=?0;
%?Find?out?the?non-optimal?position
ind2?=?setdiff(1:nPathind);
cashflow(iind2)?=?cashflow(i+1ind2)?*?exp(-r?*?deltaT);
%?Discount?cash?flow?of?I?+?1?position??to?I?position
%?cashflow(iind2)?=?cashflow(i+1ind2)?.*?exp(-r?*?deltaT);
%?Recording?optimal?execution?time
etime(ind(ind1))?=?i;
end
%?Calculating?Option?Price
p?=?mean(cashflow(2:))?*?exp(-r?*?deltaT);
end
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????10704644??2019-03-21?22:39??287579.pdf
?????文件????????2346??2019-03-25?20:22??AmericanOption.m
?????文件??????100265??2019-03-21?22:35??Annualised?Volatility?of?IBM.xlsx
?????文件????????1075??2019-03-25?21:24??aoption.m
?????文件??????756774??2019-03-26?00:50??LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf
?????文件?????????747??2019-03-27?00:28??main_sc
?????文件????????1446??2019-03-25?23:47??mcAoption.m
?????文件??????125694??2019-03-25?23:51??simulate?paths.jpg
?????文件?????????408??2019-03-23?18:23??simulatePath.m
?????文件?????????165??2019-04-04?13:54??~$Annualised?Volatility?of?IBM.xlsx
?????文件??????903789??2019-03-25?17:57??關(guān)于最小二乘蒙特卡洛模擬法在美式期權(quán)定價(jià)中的應(yīng)用.xdf
?????文件?????3212567??2019-03-25?18:37??基于最小二乘蒙特卡羅模擬方法的豆粕期貨期權(quán)定價(jià)實(shí)證研究.pdf
?????文件?????3610715??2019-03-25?17:32??美式期權(quán)定價(jià)的最小二乘蒙特卡羅方法及其改進(jìn)模型.nh
?????文件???????87046??2019-03-22?13:06??要求.png
評(píng)論
共有 條評(píng)論