疑问:2 Q( |) e3 I% U+ G3 ?( C
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”: j' v+ Y0 y8 L/ Y! C9 h
Error in ==> HestonASACalibration at 14 ! V1 V& R1 x& Y3 q; k& W' W6 F asamin('set','test_in_cost_func',0) + q- l A7 l h* }5 Y$ y1 k- e3 i我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???/ Y- i: R/ F9 V/ a, d5 d: u
: N; W/ v( C" k: k0 c( _5 P 完整程序$ C; I/ J$ [% V2 j" ]0 d* o
clear; 0 Z2 V% V& I* l1 I global OptionData;* }1 ^7 N* s" \) t. B2 s; v
global NoOfOptions; + p0 \- \3 D+ S: d6 ?0 A global NoOfIterations; & {) H9 K$ O4 P% b' { H global PriceDifference;9 I& |* K6 Z3 ^2 L1 `2 i: q6 t! B
global ObjectiveFunc; f2 N, a4 `0 p1 |
NoOfIterations = 0; - b" x: Q( L8 L* j* ] %OptionData = [r,T,S0,K,Option Value,bid,offer] ! Q! d( H4 h. ` Size = size(OptionData); " ^ y- F5 {& k% M$ O NoOfOptions = Size(1); # l+ n, f; v3 ~* f1 v4 N %input sequence in initial vectors [kappa,theta,sigma,rho,v0] " M. _3 b+ [* ~ x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];; V& K2 `9 _/ @5 a( b' ?
lb = [0 0 0 -1 0];ub = [10 1 5 0 1]; # a* n w) W$ |$ ` asamin('set','test_in_cost_func',0), |1 [, w D6 B( [9 `( w
tic;3 V+ T0 s# A8 g6 i9 {" R6 D
[fstar, xstar, grad, hessian, state] = asamin('minimize',... 4 x4 K% v! @# i7 y* q, b 'HestonCostFunc',x0',lb',ub',-1*ones(5,1));7 k4 X% Q+ N" f
toc; %秒表计时器& [6 b# w: t- W5 E
出错程序# D: z+ W& H% ~, \ A
asamin('set','test_in_cost_func',0) # E& b2 u* B# [% J" A o* R运行提示错误为: & m4 q7 b" Z3 A! ]5 y' V d??? Undefined function or method 'asamin' for input arguments of type 'char'.