疑问: 7 Z' u: o0 o4 i0 l 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”2 W- F$ S/ \& t9 \6 o- ~
Error in ==> HestonASACalibration at 144 j% c' Y. ?( l' B8 T! ^
asamin('set','test_in_cost_func',0) ' q+ F; E' @5 ^/ v3 f9 U* T我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???8 B, \8 g" ?6 M c' |/ u
4 a, I; f# F. p) I0 r$ ^7 d/ m. }9 X 完整程序# m! X3 Y8 Z) ]# X. h y' Z
clear;- S- j3 X) m; J
global OptionData;* N# y: H# |6 _$ s! i0 [
global NoOfOptions; 4 y6 W; A! k# \' l2 X global NoOfIterations; G) @! S# R4 w+ c4 h$ H# s global PriceDifference; 1 S5 g# P* [/ t0 c) Z8 ] global ObjectiveFunc;* b& G. h, G0 h! @9 G- _# Y
NoOfIterations = 0; ; ~* a1 ^+ f7 E) w$ D7 f %OptionData = [r,T,S0,K,Option Value,bid,offer] 1 ]% z# |& y. H# n* G) e9 d Size = size(OptionData); + E# |8 j% e$ X& v; y/ t5 ? NoOfOptions = Size(1); $ ? M# P# ?3 ^* |+ I %input sequence in initial vectors [kappa,theta,sigma,rho,v0] ; J# v/ s* A; h$ `" L5 P x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];" ]( l' |+ k* Y. m0 C; N
lb = [0 0 0 -1 0];ub = [10 1 5 0 1]; " ^+ o5 s6 E# a7 y asamin('set','test_in_cost_func',0) # N% }$ J' H; w tic; / v% `$ Q4 \ n* f" H$ B! A [fstar, xstar, grad, hessian, state] = asamin('minimize',... 6 }! `) I; i* t. N4 X1 b4 Q 'HestonCostFunc',x0',lb',ub',-1*ones(5,1)); ) A5 C/ q+ b; G$ r( \" y8 [1 o toc; %秒表计时器0 \4 B% A$ S$ o: V. w4 ^
出错程序( ^( a" K2 q; k! U
asamin('set','test_in_cost_func',0) - H( R# j7 [( a! O% H( P- ]. @运行提示错误为:( k" ]* C$ k4 s" _
??? Undefined function or method 'asamin' for input arguments of type 'char'.