疑问: : @0 l' j& j' e, E0 w% F2 I4 G 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.” 6 M! V; I, Y3 n! m, x( p/ @1 UError in ==> HestonASACalibration at 14 / E' D& ]" ?( w( U asamin('set','test_in_cost_func',0) v4 n) U, y9 _! @
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???+ }3 n, c4 Q+ y3 L
9 @9 y+ Q" i6 [% s- \. C9 N* {% V 完整程序. |! o& s o8 w' r& w
clear;, L, }5 C5 P% `
global OptionData; + @* n& @8 N2 N% M! B' F4 E global NoOfOptions;/ V% K+ G+ U7 q" I! r! d; R
global NoOfIterations;: P( I1 ?3 B5 k* m* w8 `, S) h* a
global PriceDifference; 9 T2 a6 g5 l: p3 P0 J, p8 |3 {; } global ObjectiveFunc;$ ?& h0 I1 \- x( O
NoOfIterations = 0;: ~& s7 V5 u, H, L$ n( _, c
%OptionData = [r,T,S0,K,Option Value,bid,offer]" x3 z3 f) Y1 I4 i3 m6 i
Size = size(OptionData); 6 I# Y+ C% r" w. ~# A, P NoOfOptions = Size(1); 1 r {8 p& z. v, ~2 H %input sequence in initial vectors [kappa,theta,sigma,rho,v0]/ z' L* `: C- B# o, U* B6 u8 S/ ^5 v; |
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];6 f4 \5 R+ r4 `% m7 \- o
lb = [0 0 0 -1 0];ub = [10 1 5 0 1]; 2 A+ v4 S; @! r. m& @ asamin('set','test_in_cost_func',0) $ c- H+ t& v% R x9 u- s6 o tic; 1 I! w9 R4 _$ K; N9 z2 s [fstar, xstar, grad, hessian, state] = asamin('minimize',...& K l, x! O5 G
'HestonCostFunc',x0',lb',ub',-1*ones(5,1));$ H/ B6 W" s+ P0 C1 T1 } W. X2 ]
toc; %秒表计时器. h" w! L% k( T2 }
出错程序 , T' W' z' O$ T- v/ [, i' k! Casamin('set','test_in_cost_func',0)! ^; S5 u( U3 S# X! S! _+ o8 y
运行提示错误为:: \ k8 v. _. h& B# l
??? Undefined function or method 'asamin' for input arguments of type 'char'.