疑问:, z& u! X( W3 D! W+ T
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.” 3 c4 p9 w8 ^) C( Z* ]" `Error in ==> HestonASACalibration at 14; ^( K/ f& J% R$ _' V
asamin('set','test_in_cost_func',0) * Z& t/ R, w6 B! v我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???$ F& M+ U! Z4 w6 N$ R" u, b' A
& [2 o- ^" k* H 完整程序- ?! j1 v- W( q1 t K" H+ i8 z
clear;2 }( h/ _$ Q8 p* J$ u; v1 ~5 g
global OptionData; 7 u* G0 a- d* D9 o3 ^ global NoOfOptions; # w- a- O) j5 H3 L global NoOfIterations; 6 Z. e1 Q D; ]5 N. a global PriceDifference;) x1 |1 T/ r* h: p; z a1 H
global ObjectiveFunc;, x* E0 o V& U3 ?3 \. ^
NoOfIterations = 0;- K8 f4 m/ g) o! {! \+ |$ o* [
%OptionData = [r,T,S0,K,Option Value,bid,offer] 5 M+ y5 t3 C. }# Y7 { Size = size(OptionData);* k1 }6 |* b% k k4 n! g
NoOfOptions = Size(1); / ~' F1 L( ]1 v* r% j %input sequence in initial vectors [kappa,theta,sigma,rho,v0] / w: d7 }! c n; o& Z/ E8 J x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];9 F- w' ]- A0 E4 ~! l0 | H% v) z
lb = [0 0 0 -1 0];ub = [10 1 5 0 1]; : f% H; L2 Q- W4 M# K5 x asamin('set','test_in_cost_func',0): N! e* Q# }% q. Y
tic; $ I* i8 \1 c$ r O5 Y$ p% q [fstar, xstar, grad, hessian, state] = asamin('minimize',..." Y" H1 }; O) Z2 q
'HestonCostFunc',x0',lb',ub',-1*ones(5,1)); 9 n* @+ G4 B8 \) o" s# ^7 X toc; %秒表计时器+ [! R6 D8 N; X4 N# l' w2 M @$ y2 x
出错程序. K/ |% D- d/ S& i
asamin('set','test_in_cost_func',0)1 [& X8 F5 Y3 A0 W) ~+ e
运行提示错误为: ! F1 w7 q. W% u4 ~8 V1 [/ p2 Y??? Undefined function or method 'asamin' for input arguments of type 'char'.