疑问: 5 g. u& z1 a3 U- W& l 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”9 [( P5 i% M E& z- X8 a
Error in ==> HestonASACalibration at 142 W% J p! _% g7 Y6 _, H- ?
asamin('set','test_in_cost_func',0)5 F* U! _2 g# W, c* S2 ^) m, B) k
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???/ b7 ~$ p2 T+ E1 b5 p5 P
1 r* d; v+ h! q, U' [, _& K 完整程序, ?' a9 c* G t
clear;" `+ J# S( H% Z3 a4 K3 f: h
global OptionData; : a/ x+ h4 }! x5 C9 ^ ?" d0 m global NoOfOptions;% T' X+ H2 r2 @; J( y1 V3 |
global NoOfIterations; / m- h( P% \: f# H% g* p4 x global PriceDifference; + H- ~; [) a; H; e+ J global ObjectiveFunc; - R0 y5 n% [6 ~- u; {7 V4 ^ NoOfIterations = 0; ! L2 M7 k& t/ s( ^8 U/ p+ U %OptionData = [r,T,S0,K,Option Value,bid,offer] 0 p: e$ e o- `* y6 c/ c Size = size(OptionData);2 {! h' S V2 W7 r8 U$ w! c3 ^
NoOfOptions = Size(1); , W0 o* V3 d9 q- e7 B+ N %input sequence in initial vectors [kappa,theta,sigma,rho,v0], G4 ^% S% P ^* }4 K2 p
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];. M8 a4 Q6 D! y7 E8 t* V6 a' X, X
lb = [0 0 0 -1 0];ub = [10 1 5 0 1]; 5 L3 u" T; _; _7 ~+ n4 K, E asamin('set','test_in_cost_func',0)5 r6 Z, t! `2 d' ?1 W
tic;7 p5 c( G! r# B( Y. d/ f G
[fstar, xstar, grad, hessian, state] = asamin('minimize',...$ k: O. ~: f; z x' `. E
'HestonCostFunc',x0',lb',ub',-1*ones(5,1)); + G/ w' K% l |/ M toc; %秒表计时器0 l' }; p8 ]" ~7 f
出错程序" U: X8 h, d8 U5 L5 G
asamin('set','test_in_cost_func',0)6 l+ A3 d, ?( U) O+ k7 N$ X- E e
运行提示错误为: ) j! z8 P* e5 X??? Undefined function or method 'asamin' for input arguments of type 'char'.