- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:
5 W# J& C, B0 h: ~6 F& n0 @7 |# D 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”; [( ^7 ^. |9 `2 O# Y: W
Error in ==> HestonASACalibration at 140 J+ c4 C2 i# I8 r8 l
asamin('set','test_in_cost_func',0)
7 k$ \5 J; J; x& I9 O3 v+ }我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???. C. L% j( ?) R9 o+ I( w% Z9 M2 p! y) Y
* o! @4 C$ t0 t
完整程序
) J/ e# V+ ~! b5 }' @9 s( nclear;
" S3 V9 S% d7 O global OptionData;
- g2 g- ^$ m; x4 r: d global NoOfOptions;
9 W" x* V* x* o0 k global NoOfIterations;
6 L# }/ S# k4 O/ W' j! i global PriceDifference;
) M) p8 ?! T' T( A% U5 H, K global ObjectiveFunc;
3 b# T/ R) `% u- v! K NoOfIterations = 0;
6 u. L* M b) I6 a0 s7 E3 U %OptionData = [r,T,S0,K,Option Value,bid,offer]* t9 w i$ m+ N
Size = size(OptionData);
7 {0 R$ L. k5 K/ } `3 e NoOfOptions = Size(1);
$ B0 Z3 u! i( W/ ^$ q, c, a! ]( s& } %input sequence in initial vectors [kappa,theta,sigma,rho,v0]& S3 }2 w2 S* q/ V8 }" g u
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599]; M2 S& i0 S9 [/ Z* I4 d" i
lb = [0 0 0 -1 0];ub = [10 1 5 0 1];6 u$ D; ]! J% L9 @5 f6 e8 O3 f
asamin('set','test_in_cost_func',0)( e8 y* N: x5 `" `
tic;
7 H" ?3 W7 x( ^, @ [fstar, xstar, grad, hessian, state] = asamin('minimize',...
1 H' W& m/ [) A9 `8 s 'HestonCostFunc',x0',lb',ub',-1*ones(5,1));
" J* y3 L g {- C4 K* |& y) r toc; %秒表计时器
0 w( `& E- y- z% f' ?0 ? 出错程序
8 s5 u+ l; j/ V" b$ s$ masamin('set','test_in_cost_func',0)
T. L5 |+ K; T2 s8 c运行提示错误为:
0 F3 u8 [( `; D& O6 U$ Y??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|