疑问:, k+ [$ f9 ]3 K/ R2 d
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.” 4 [6 m% t o6 d; ?$ n4 x/ m9 @- SError in ==> HestonASACalibration at 141 Z+ T, p) J3 v, E. U, u
asamin('set','test_in_cost_func',0) 2 V9 [3 D' E; f } i7 s我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???) y. t% k6 H+ c% }" |$ K7 W
/ z# N1 e3 N2 u* e 完整程序5 N2 k7 i, Z4 f5 M
clear;# E& ?$ x: s5 W6 D' z0 Y. y0 t
global OptionData; 9 A' I& {$ \0 z) t4 q& G global NoOfOptions; : c2 S* T' M! D; p" |) _9 c global NoOfIterations; l9 t2 l' p' L1 a0 {
global PriceDifference;; S; i1 ~( y) X5 I5 Z& X
global ObjectiveFunc;) v/ y! F" w8 x0 a5 H6 s
NoOfIterations = 0; 1 W/ b; D# I! \ %OptionData = [r,T,S0,K,Option Value,bid,offer]; B/ H( O7 |# y3 K+ P4 @7 e1 B$ u
Size = size(OptionData); % N/ c/ d! C# i& M6 g/ t NoOfOptions = Size(1); 5 f& Q4 w9 I1 o; }2 j2 W %input sequence in initial vectors [kappa,theta,sigma,rho,v0]9 S+ Y* @3 [) H
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599]; 1 v# F* I2 `0 V lb = [0 0 0 -1 0];ub = [10 1 5 0 1]; & O+ k& G; f# {3 `% I asamin('set','test_in_cost_func',0); r8 o% N' f$ p5 C4 k
tic;/ i0 o) G" E, k. @
[fstar, xstar, grad, hessian, state] = asamin('minimize',.../ g2 I7 B3 @2 o* o+ P" F \) G
'HestonCostFunc',x0',lb',ub',-1*ones(5,1));: M( G& N: F3 U( f
toc; %秒表计时器3 r' t. p7 D D3 O% I- x( E( S$ W
出错程序# t2 J L% [& |" O; Z
asamin('set','test_in_cost_func',0) : |7 r B; m& l- v, ^运行提示错误为: " [( x* u2 C- V; }1 s1 S??? Undefined function or method 'asamin' for input arguments of type 'char'.