金融計(jì)算試驗(yàn)報(bào)告_第1頁
金融計(jì)算試驗(yàn)報(bào)告_第2頁
金融計(jì)算試驗(yàn)報(bào)告_第3頁
金融計(jì)算試驗(yàn)報(bào)告_第4頁
金融計(jì)算試驗(yàn)報(bào)告_第5頁
已閱讀5頁,還剩2頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、金融計(jì)算實(shí)驗(yàn)報(bào)告班 級(jí): 學(xué) 號(hào): 姓 名: 指導(dǎo)老師:2013 級(jí)信息與計(jì)算科學(xué)李峰2016年 6 月金融計(jì)算實(shí)驗(yàn)報(bào)告開課實(shí)驗(yàn)室:實(shí)訓(xùn)樓 B-206年級(jí)專業(yè)班2013 級(jí)信息與計(jì)算科學(xué) 日期實(shí)驗(yàn)項(xiàng)目名稱多期復(fù)利算法指導(dǎo)教師 李峰一、 實(shí)驗(yàn)?zāi)康恼莆斩嗥趶?fù)利終值的計(jì)算公式,并能夠進(jìn)行實(shí)際應(yīng)用。二、 實(shí)驗(yàn)內(nèi)容案例: 26 歲的外企白領(lǐng)王小姐,每月工資 6000 元,除去日常開銷和朋友應(yīng)酬所 剩無幾。 考慮到未來購車購房的需求, 王小姐打算每月固定拿出 1000 元用于購買 招商信諾運(yùn)籌帷幄終身壽險(xiǎn)(投資連結(jié)型) ,交滿 10 年,既能投資又有年輕人必 須的意外險(xiǎn)保障,不再做個(gè)“月光族” 。這樣一來

2、,在每月扣取 15 元初始費(fèi)用后, 剩余的 985 元進(jìn)入王小姐名下的保單賬戶,則在投資回報(bào)率分別為7%的假設(shè)下,其未來可能的個(gè)人賬戶價(jià)值是多少三、 源程序清單public class jisuanpublic static void main(String args)double r=;double b2=;double b3=;double b4=;double b5=;double p=;double c2=;double a=fabs(x);double t=+a*p);double b=c2*exp(-x)*(x/);double n=(b5*t+b4)*t+b3)*t+b2)*t+

3、b1)*t; n=*n;if(xn=;return n;double option_price_call_black_scholes(const double &S,const double &X,const double &r,const double &sigma,const double &time)double time_sqrt=sqrt(time);double d1=(log(S/X)+r*time)/(sigma*time_sqrt)+*sigma*time_sqrt;double d2=d1-(sigma*time_sqrt);double c=S*N(d1)-X*exp(-

4、r*time)*N(d2);return c;double option_price_impied_volatility_call_black_scholes_bisections(const double &S,const double &X,const double &r,const double &time,const double &option_price)const double ACCURACY=;const int MAX_ITERATIONS=100;const double ERROR=-1e40;double sigma_low=1e-5;double sigma_hig

5、h=;for(int i=0;iMAX_ITERATIONS;i+)double sigma=(sigma_low+sigma_high)*;double price=option_price_call_black_scholes(S,X,r,sigma,time);double test=(price-option_price);double b2=;double b3=;double b4=;double b5=;double p=;double c2=;double a=fabs(x);double t=+a*p);double b=c2*exp(-x)*(x/);double n=(b

6、5*t+b4)*t+b3)*t+b2)*t+b1)*t; n=*n;if(xb)return a;else return b;double option_price_call_black_schooles(const double &S,const double &X,const double &r,const double &sigma,const double &time)double time_sqrt=sqrt(time);double d1=(log(S/X)+r*time)/(sigma*time_sqrt)+*sigma*time_sqrt; double d2=d1-(sigm

7、a*time_sqrt);double c=S*N(d1)-X*exp(-r*time)*N(d2); return c;double &r,constdouble &r,const&no_sims,doubledouble option_price_put_black_schooles(const double &S,const double &X,const double &sigma,const double &time)double time_sqrt=sqrt(time);double d1=(log(S/X)+r*time)/(sigma*time_sqrt)+*sigma*tim

8、e_sqrt; double d2=d1-(sigma*time_sqrt);double p=X*exp(-r*time)*N(d2)-S*N(d1); return p;double option_price_european_simulated(const double &S,const double &X,const double &sigma,const double &time,const double &call_option,double &put_option)double R=*pow(sigma,2)*time; double SD=sigma*sqrt(time);do

9、uble sum_payoffs1=;double sum_payoffs2=; for(int n=1;n=no_sims;n+)double S_T=S*exp(R+SD*random_normal(); sum_payoffs1+=max,S_T-X); sum_payoffs2+=max(S_T-X,; call_option=exp(-r*time)*sum_payoffs1/double(no_sims); put_option=exp(-r*time)*sum_payoffs2/double(no_sims);double max(double a,double b);void main()double S=,X=,r=,sigma=,time=,no_sims=5000000;double call_option;double put_option;option_price_european_simulated(S,X,r,sigma,time,no_sims,call_option,put_option); coutblack-Scholes():option_price_call_black_schooles(S,

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論