weilinhy 发表于 2008-6-6 23:35

IstOpt怎么把数值算大好几倍呢?奇怪

Constant N=893617900, M1=313148160, M2=297872640, X1=7.96, X2=6.93,tuo=2,S=11.430,sigmas=0.4938,r=0.0252; Function sigmas-(V*sigmav/S)* (1/N-(M1/N)* ( normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) /(N+M1+M2) +M2* normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) / ((N+M1)*(N+M1+M2)) ) -(M2/N)*( normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo))))/(N+M1+M2) + M1*normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo))))/ ((N+M2)*(N+M1+M2)) ) ) ; S*N-V+ M1*( (1/(N+M1+M2)) * (V* normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) -exp(-r*tuo)* (N*X1+M2*(X1-X2)) * normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))-sigmav*sqrt(tuo)) ) + (M2/((N+M2)*(N+M1+M2))) * (V* normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) -exp(-r*tuo)* (N*X1+M2*(X1-X2)) * normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))-sigmav*sqrt(tuo)) ) ) + M2* ( (1/(N+M1+M2))* (V* normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) -exp(-r*tuo)* (N*X1+M2*(X1-X2)) * normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))-sigmav*sqrt(tuo)) ) + (M1/((N+M2)*(N+M1+M2))) * (V* normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) -exp(-r*tuo)* (N*X1+M2*(X1-X2)) * normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))-sigmav*sqrt(tuo)) ) ) ; W1= ( (1/(N+M1+M2)) * (V* normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) -exp(-r*tuo)* (N*X1+M2*(X1-X2)) * normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))-sigmav*sqrt(tuo)) ) + (M2/((N+M2)*(N+M1+M2))) * (V* normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) -exp(-r*tuo)* (N*X1+M2*(X1-X2)) * normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))-sigmav*sqrt(tuo)) ) ) ; W2= ( (1/(N+M1+M2))* (V* normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) -exp(-r*tuo)* (N*X1+M2*(X1-X2)) * normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))-sigmav*sqrt(tuo)) ) + (M1/((N+M2)*(N+M1+M2))) * (V* normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) -exp(-r*tuo)* (N*X1+M2*(X1-X2)) * normcdf(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))-sigmav*sqrt(tuo)) ) )


本来结果W1=1.** 竟然变成?奇怪 难道?

dingd 发表于 2008-6-7 22:31

原帖由 weilinhy 于 2008-6-6 23:35 发表 http://www.chinavib.com/forum/images/common/back.gif
本来结果W1=1.** 竟然变成?奇怪 难道?

不大明白上面是什么意思?能否详细、直观点?
还有代码写的似乎不大好,实际只有两个未知数:v 和 sigmav,而w1和w2都只是v 和 sigmav的函数,没必要将求w1和w2的式子也写在求解方程组里。

dingd 发表于 2008-6-7 22:43

这是代码修改后得到的一组数据:
v: 14267584483.5941
sigmav: 0.601554948841127

传递参数(PassParameter):
w1: 6.57052686360499
W2: 6.70079497410009

weilinhy 发表于 2008-6-20 21:50

多谢 dingda 我函数表达式中有问题 谢谢
页: [1]
查看完整版本: IstOpt怎么把数值算大好几倍呢?奇怪