- 在线时间
- 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 m7 T; c+ Z- ]# q3 t6 }6 y
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.” b1 y+ }" w4 s) z! `
Error in ==> HestonASACalibration at 14
2 x4 q2 I D2 A) n4 Y8 k& S asamin('set','test_in_cost_func',0)
, i% p. C0 h4 ` h; Z4 l9 V/ `我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???6 ]' V3 X: v, ~. [' k# |/ Z3 Q2 V
3 q& v/ D5 s: f b6 p8 y
完整程序
# J" t' ~* j( z6 f! _$ B4 Nclear;
7 V& q! w# a) F1 J. T0 @: D global OptionData;
1 J% S& w3 a5 G7 q# G% v global NoOfOptions;
, {- H1 ]" N9 j global NoOfIterations;
7 e; \/ h1 S- s% ?4 | global PriceDifference;
6 s! e& k! F: W, l3 t1 r global ObjectiveFunc;3 h3 j8 c' I1 l5 t+ \' _8 g) k
NoOfIterations = 0;
5 y* R y4 D' ?1 @ %OptionData = [r,T,S0,K,Option Value,bid,offer]5 M) \8 ^% D, ~. a1 Y
Size = size(OptionData);& c3 P/ u( l( U
NoOfOptions = Size(1);7 h/ G; ]7 ^9 {/ w: d
%input sequence in initial vectors [kappa,theta,sigma,rho,v0]' w$ t( W; T1 r7 K- t6 K+ v
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];
' b `% K! c: U% V* g; g lb = [0 0 0 -1 0];ub = [10 1 5 0 1];+ T: \7 L8 b2 P! o0 w1 {+ u0 i
asamin('set','test_in_cost_func',0)
0 m/ r8 f$ _# A) U% u tic;
! x& X3 k/ o3 b* |3 _8 f* O7 V [fstar, xstar, grad, hessian, state] = asamin('minimize',...7 j1 [$ }: W0 u
'HestonCostFunc',x0',lb',ub',-1*ones(5,1));. k& [, B. q0 Y, [; @7 B
toc; %秒表计时器
% g4 _: L, A. \3 }$ A' |; o F+ B& r 出错程序2 E) B+ B* w* C* H& k: j) ~
asamin('set','test_in_cost_func',0)
2 u% m/ R, T( W) _* \& F运行提示错误为:
. a- B& w2 l: L0 x2 ~! H" M+ ~??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|