声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1818|回复: 0

[1stopt] 1stOpt遇到的问题

[复制链接]
发表于 2008-6-20 21:46 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
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))))- 1) /(N+M1+M2) +M2* ( normcdf(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo)))) -1 ) / ((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)) * ( 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)) ) -V* normcdf( -(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo))))) ) + (M2/((N+M2)*(N+M1+M2))) *( exp(-r*tuo)* (N*X2-M1*(X1-X2))* normcdf( -(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo))) -sigmav*sqrt(tuo)) ) -V* normcdf( -(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*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*X2-M1*(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)) * ( 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)) ) -V* normcdf( -(((log(V/(N*X1+M2*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo))))) ) + (M2/((N+M2)*(N+M1+M2))) *( exp(-r*tuo)* (N*X2-M1*(X1-X2))* normcdf( -(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*tuo)/(sigmav*sqrt(tuo))) -sigmav*sqrt(tuo)) ) -V* normcdf( -(((log(V/(N*X2-M1*(X1-X2)))+(r+1/2*sigmav*sigmav)*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*X2-M1*(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)) )


怎么结果会成
v: 6937220930.16085
sigmav: -8.00972547285533
w1: -5.76319488865101
w2: -4.94203761626664
负数肯定不对 哪位同学解释下 谢谢
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-28 16:00 , Processed in 0.049663 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表