- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:) a8 K# F( o! w6 Q8 @2 X2 ^
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”
! Y& w- j% ?; m" v& r5 KError in ==> HestonASACalibration at 14! x8 q/ i5 }7 d" i5 Z+ O4 y! ~
asamin('set','test_in_cost_func',0)
& @! i+ W/ ~ u k+ S: `' X我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???
1 ^6 p! t, d F' c I" C3 ]2 N
完整程序/ z1 w$ ?$ Y' k1 Q+ L4 z, T
clear;
1 H2 I& I5 |& I: N" [! y! Q global OptionData;
2 O' L! C) D7 w global NoOfOptions;& M2 Y# k( a) |, S
global NoOfIterations;6 S6 L* m* G, {% x o
global PriceDifference;9 K% g8 S4 d d" f
global ObjectiveFunc;
% ]7 H& a N* c2 {; J/ n NoOfIterations = 0;* A4 \: C3 u: s. F! B2 V
%OptionData = [r,T,S0,K,Option Value,bid,offer]
( v; {" t# t0 D: p Size = size(OptionData);! K: p8 v/ }2 b5 s( y, X
NoOfOptions = Size(1);: v2 Q* z! }2 \" v
%input sequence in initial vectors [kappa,theta,sigma,rho,v0]
7 l7 C6 @6 T) Z x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];6 _7 L6 u J% u7 z( Y! S
lb = [0 0 0 -1 0];ub = [10 1 5 0 1];
9 C7 [ Z, ]# ]' M3 p asamin('set','test_in_cost_func',0)# H, |, D7 w" P& G6 L. k
tic;% F( N, ?6 ]1 d- X9 s p
[fstar, xstar, grad, hessian, state] = asamin('minimize',...
, u6 u p2 i' {/ V$ a! B 'HestonCostFunc',x0',lb',ub',-1*ones(5,1));
8 q) B2 h. J3 F a7 ^ toc; %秒表计时器
& E2 i) q* U% M# R6 ? 出错程序
0 B( n# U X `# H+ z4 gasamin('set','test_in_cost_func',0)
3 d X4 `& g/ j运行提示错误为:
& C( D) g: \$ F e9 i: o??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|