疑问:! z2 _9 F6 s& ~% d x2 z
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”, Y2 x5 U) u: p2 G/ |
Error in ==> HestonASACalibration at 14 1 |; m \7 x5 t asamin('set','test_in_cost_func',0) 1 {" W& B, }% M3 W& Q* b+ ^我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???. u3 G! _5 y9 V
& g( l7 N. R$ Z+ Z5 d. M- f4 l9 e 完整程序 ) l ` T" H9 h- o) Pclear; + q3 l: {7 c7 d! s! W+ I global OptionData; / r* u1 A% X3 U global NoOfOptions; ) r# Q* o" I/ q, a4 f& D P global NoOfIterations; 1 l; S& x4 X$ ?/ p/ a( S global PriceDifference; ' N6 x& @; r' H6 _9 F4 n global ObjectiveFunc;2 ]+ k# k8 `( k( C( M3 }5 u9 Z4 t
NoOfIterations = 0;/ o) Z' a' T: ~5 Q
%OptionData = [r,T,S0,K,Option Value,bid,offer] ]3 [* [5 b( Y) Z! d" T2 P
Size = size(OptionData);6 {% f! {5 A$ q5 I
NoOfOptions = Size(1);/ l/ b) \: e% S& U) m J3 p
%input sequence in initial vectors [kappa,theta,sigma,rho,v0] _& G( s5 v$ r9 h, ^
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];' v! r3 U; Z2 ` u: v$ I: Z
lb = [0 0 0 -1 0];ub = [10 1 5 0 1]; 1 S9 s# O/ t& z/ Q asamin('set','test_in_cost_func',0)$ l( r3 i4 a6 d! \
tic; & j" Y5 m( j0 Z0 q, @ [fstar, xstar, grad, hessian, state] = asamin('minimize',... 7 P4 ?. H; A9 L; E2 V2 j 'HestonCostFunc',x0',lb',ub',-1*ones(5,1)); 8 w9 M( y+ X+ D/ U' O: m' q toc; %秒表计时器 . B d; C# }0 G! K& Q; `( M 出错程序0 k( T- a G8 t$ S# O5 e# O( {
asamin('set','test_in_cost_func',0)6 n# | C+ h! R4 i' V
运行提示错误为:8 E: G( K) d0 ]& s- \! q! P7 _/ M
??? Undefined function or method 'asamin' for input arguments of type 'char'.