- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:
0 x! ^0 b4 q* }4 s 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”
8 E1 q+ I, u q4 E8 L$ f1 nError in ==> HestonASACalibration at 14
% f/ }* t6 h! W$ o asamin('set','test_in_cost_func',0)8 M; p. A$ \. G5 ~4 Q8 R
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???
, o9 E( i9 K7 M0 u+ E' W' D- V: i/ p: {0 P$ @/ | c8 K
完整程序6 s: F1 Y G, r1 ^6 U5 F% x0 o
clear;
/ n$ [4 ?6 H, w- Y4 l m$ _8 k global OptionData;* n* {* c. n. d7 J* E
global NoOfOptions;/ R. p- H: @+ ?/ g/ J
global NoOfIterations;- [' F& d% ?6 e
global PriceDifference;
' E1 _- h; ~8 F) b1 D3 w, d& _ global ObjectiveFunc;' s) B/ E P; N7 |4 ~' g# p
NoOfIterations = 0;. z0 j1 e, p6 o! V2 v) G1 a
%OptionData = [r,T,S0,K,Option Value,bid,offer]
' l( T# h) Y) p j0 @2 s Size = size(OptionData);8 u& t, }) r/ g) c. c( r
NoOfOptions = Size(1);
# W. T/ s9 \; l %input sequence in initial vectors [kappa,theta,sigma,rho,v0]7 e. L1 g( v. l! P5 p m& A" E
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];- H4 b5 |8 G! O) c$ i5 i( M( T
lb = [0 0 0 -1 0];ub = [10 1 5 0 1];( b/ F, ^6 u7 L# G- M
asamin('set','test_in_cost_func',0)2 R$ m# S' c9 s/ Y
tic;
4 S* S8 t+ X& M; P; @ [fstar, xstar, grad, hessian, state] = asamin('minimize',...8 V/ P- n8 l0 i; {; T9 |/ O
'HestonCostFunc',x0',lb',ub',-1*ones(5,1));! `# P5 v" p; w- F
toc; %秒表计时器
: T' t# t& x4 o" L 出错程序! r$ F' D: ~2 E0 I6 w
asamin('set','test_in_cost_func',0)
& W& `2 g. S4 S$ I) {( s运行提示错误为:
6 M* {' X' d3 }??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|