- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:
8 H/ \6 y7 ?! v7 m% g& J& g( O N 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”0 B+ c, d7 y! u, L2 n4 N% O) b
Error in ==> HestonASACalibration at 14( J% ?3 p9 t& {( n7 V" ~
asamin('set','test_in_cost_func',0)2 o* ~9 I+ \+ C6 G# s& {
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???
4 Y$ r( n$ T8 n k+ ^, U; g/ f/ v. i8 R* m% I1 T. {
完整程序
; i% l1 J7 J9 s' V& Rclear;
8 S, D* c6 C; p! x# ~& Z. r/ B global OptionData;
( w7 m: ?3 W# A. A6 m8 U* }/ o4 r global NoOfOptions;% Q* R; }2 G& Z0 o' S3 L# p }
global NoOfIterations;. i1 y# z6 Q! ~& z
global PriceDifference;) ?: S3 [: _& x5 ~2 m% L+ r
global ObjectiveFunc;
" K4 F3 Q6 G9 U* Z* o NoOfIterations = 0;- D* `6 q$ f2 Q1 Q$ O
%OptionData = [r,T,S0,K,Option Value,bid,offer]( n" P& ]9 Q, ^. w2 U/ k5 a* }. s
Size = size(OptionData);0 i! D4 f& o0 L/ l5 e4 f% C, b
NoOfOptions = Size(1);
5 L3 U0 X% |( v0 x5 ~0 H %input sequence in initial vectors [kappa,theta,sigma,rho,v0]
9 G$ }& M' U$ W0 d; a% b8 Z x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];+ Q B1 y, F8 |9 b
lb = [0 0 0 -1 0];ub = [10 1 5 0 1];+ r; \3 X5 I# T/ W1 K; k8 y% ]
asamin('set','test_in_cost_func',0)
) H$ c W1 \, e0 ?" ]: l, }% R tic;3 y' _: J% I/ P9 k, P
[fstar, xstar, grad, hessian, state] = asamin('minimize',...
" U* v2 Q. y) B; g& O' } 'HestonCostFunc',x0',lb',ub',-1*ones(5,1));
: }, w0 ^. \& J4 Q l) {* c8 f toc; %秒表计时器
- G: E0 Z- }0 A! N; R. s! O 出错程序
+ ^4 L2 B) h9 p6 Lasamin('set','test_in_cost_func',0)
4 I1 ?% s! ?/ x5 [! R' n- ]; {$ p运行提示错误为:1 q$ N0 M3 Z9 K4 \6 ~2 E
??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|