疑问:# i* Q6 o B8 M. Q) V: U
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”' K0 C. e8 D. q+ I
Error in ==> HestonASACalibration at 14 / R/ p- ?$ E2 M$ m' f# O0 m asamin('set','test_in_cost_func',0) 1 y2 g$ Y+ o/ [8 q+ D0 b我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???4 j2 Q& G0 k1 G( A! r
$ g6 c! ^2 o8 V1 g 完整程序 , e, @' v7 s7 F# A/ M4 tclear;/ @" W6 M4 I( h7 d
global OptionData;# ]( E5 T; x+ r8 Q$ P* o( }* c9 z
global NoOfOptions; % R) O0 J* Y Q Z/ k global NoOfIterations;1 N( U5 l/ a: f
global PriceDifference;. r' v# [9 q1 ? B V
global ObjectiveFunc;0 |; J& r, l( A$ D2 q! G# V
NoOfIterations = 0; ; I+ P% K$ }" k$ }+ } %OptionData = [r,T,S0,K,Option Value,bid,offer]3 N5 k$ R$ k" T) R8 v# s
Size = size(OptionData); ! l) V& a% j" A% L C) I$ C NoOfOptions = Size(1); . b0 U* }+ g- k" H %input sequence in initial vectors [kappa,theta,sigma,rho,v0] , m4 U, x. v* Z& Q x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599]; 9 K! J; J# U0 [& N9 A- X lb = [0 0 0 -1 0];ub = [10 1 5 0 1];' E' Z$ q, x* m' ]" p9 o2 N. o
asamin('set','test_in_cost_func',0)3 v% I, Q' `# p1 r
tic;; }" r/ g( p1 u F
[fstar, xstar, grad, hessian, state] = asamin('minimize',... 7 I) B) R8 Y: ^ 'HestonCostFunc',x0',lb',ub',-1*ones(5,1)); e6 @( a& e3 Z7 t* X5 g toc; %秒表计时器3 \8 u, Z: H' o7 V# |, i6 O+ W- {
出错程序- c0 T5 a; \+ e7 _
asamin('set','test_in_cost_func',0): `% w* B# d! T) U( E2 M' C
运行提示错误为: ) f( I. b0 w) X+ H- p: t??? Undefined function or method 'asamin' for input arguments of type 'char'.