疑问:3 G$ k8 }" K- H! E
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.” H' Q* f4 O4 s! V6 m2 e+ }/ YError in ==> HestonASACalibration at 14: s$ r8 I' b5 a& e+ W* c) Z
asamin('set','test_in_cost_func',0)* r; u X/ h2 e+ z! _& S$ {
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???! p& ?$ L" j7 \7 V, V
O, {% D- V" D u2 t 完整程序 0 S4 C! F, u2 ?! Kclear; ( O5 R$ j1 H. w) y global OptionData; 3 z2 _- A' g! `! H# b. O/ h global NoOfOptions; ) b+ H0 t- Y" \8 S( t global NoOfIterations; ) B$ A3 p! i% C+ ]7 P7 t global PriceDifference; # N" X& b5 z0 G global ObjectiveFunc; 5 f- l. l# z: E- ?. }3 m NoOfIterations = 0;% _6 K! s/ _ R! i- w2 j# U
%OptionData = [r,T,S0,K,Option Value,bid,offer] / x7 `( @& G- c3 }% Z Size = size(OptionData);5 f! ?2 f: R' S9 t" o' c. C7 H
NoOfOptions = Size(1); 9 G# M' a$ f# L! _& h# ]' W, }% e( O( Y %input sequence in initial vectors [kappa,theta,sigma,rho,v0] ! k j# E. u. K+ k x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599]; 2 S8 n. G5 W D$ h+ h lb = [0 0 0 -1 0];ub = [10 1 5 0 1];; j8 K9 y/ x+ z1 A7 A- N
asamin('set','test_in_cost_func',0), `5 @3 Q' x. l7 t$ a6 K' Z
tic;$ ^8 O6 P( ?% i/ E
[fstar, xstar, grad, hessian, state] = asamin('minimize',... , u2 m& K0 f) h u 'HestonCostFunc',x0',lb',ub',-1*ones(5,1)); & v0 P) _; e& ]4 D toc; %秒表计时器 - A* T9 g7 C% _7 r 出错程序$ h* D5 b( P* {) G7 B# u
asamin('set','test_in_cost_func',0) ) k/ `3 t- z1 \运行提示错误为:# S- } x3 q, [5 T
??? Undefined function or method 'asamin' for input arguments of type 'char'.