- 在线时间
- 6 小时
- 最后登录
- 2014-9-22
- 注册时间
- 2014-3-5
- 听众数
- 7
- 收听数
- 0
- 能力
- 0 分
- 体力
- 51 点
- 威望
- 0 点
- 阅读权限
- 20
- 积分
- 24
- 相册
- 0
- 日志
- 0
- 记录
- 4
- 帖子
- 16
- 主题
- 5
- 精华
- 0
- 分享
- 0
- 好友
- 1
升级   20% TA的每日心情 | 难过 2014-9-22 12:14 |
|---|
签到天数: 6 天 [LV.2]偶尔看看I
- 自我介绍
- 数学专业
 |
疑问:
; z- K( E& ^% I" \: j 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”3 D5 x7 \- t# n( `
Error in ==> HestonASACalibration at 14
* `; G7 d, z( r- G asamin('set','test_in_cost_func',0)
. `) E+ v0 @7 a4 y# I. J w我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???) V! `3 C$ Q; z! P9 J U8 q
" r- P8 H: s1 E- c. s 完整程序
& G/ R) H& ]7 m4 aclear;
, v o# X; k1 A8 \' N global OptionData;
2 v ]% z7 k1 i9 ?. G7 r3 s9 k global NoOfOptions;
" @1 x( Z4 N8 Z; U. Q. R global NoOfIterations;
/ i, u( p3 L, E! {4 O global PriceDifference;
- w! x2 ~+ w9 V% B H global ObjectiveFunc;
e( v& A ^' U) Q( I/ ?# r M NoOfIterations = 0;. [4 [: H" k3 s6 n9 ^
%OptionData = [r,T,S0,K,Option Value,bid,offer]
9 i: t7 r, Q( j! P4 a Size = size(OptionData);
! T' g3 A$ j" U+ e5 r+ v9 M3 l. @ NoOfOptions = Size(1);
# l, @) C/ N( c; H5 Z v/ d p %input sequence in initial vectors [kappa,theta,sigma,rho,v0]& L- {6 j+ v0 u8 @" n
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];
8 D( Z. V, D" m$ G% C2 a9 O lb = [0 0 0 -1 0];ub = [10 1 5 0 1];
, z& B9 P# Y/ ` asamin('set','test_in_cost_func',0)
1 h8 D0 u" ~2 U& Q tic;
) j6 T' m0 y0 J9 W( D [fstar, xstar, grad, hessian, state] = asamin('minimize',...% N5 F8 c, Z& B# V8 `+ U! y( P$ d3 U5 l
'HestonCostFunc',x0',lb',ub',-1*ones(5,1)); q0 K2 s. i. y. g# O5 s
toc; %秒表计时器1 G" ?) o) u' r/ o
出错程序; k- e% E3 J- P6 G
asamin('set','test_in_cost_func',0) ^9 E( y6 F! n% ]
运行提示错误为:
' L) m2 k, n6 D# a3 P- |??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|