- 在线时间
- 6 小时
- 最后登录
- 2014-9-22
- 注册时间
- 2014-3-5
- 听众数
- 7
- 收听数
- 0
- 能力
- 0 分
- 体力
- 51 点
- 威望
- 0 点
- 阅读权限
- 20
- 积分
- 24
- 相册
- 0
- 日志
- 0
- 记录
- 4
- 帖子
- 16
- 主题
- 5
- 精华
- 0
- 分享
- 0
- 好友
- 1
升级   20% TA的每日心情 | 难过 2014-9-22 12:14 |
|---|
签到天数: 6 天 [LV.2]偶尔看看I
- 自我介绍
- 数学专业
 |
疑问:& a( ~* t! x; x {
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”
% H' ]1 [( k! W U0 M4 B4 [# E! g2 ?Error in ==> HestonASACalibration at 14
+ C+ B; C1 M3 O$ J' x- C% X asamin('set','test_in_cost_func',0)
6 H* }# W5 ]( `" y我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???: q! s& y4 D6 O) @
: x* o: Z n9 j; H$ L
完整程序
0 O) ]3 ^; h" k4 O2 V2 Rclear;
( q' u/ c2 j5 H0 [6 i( j) q global OptionData;, T& i# B) z+ Y V7 I, c' t* d
global NoOfOptions;
* r `. U# i# | global NoOfIterations; q7 C; H) s5 p1 E* e
global PriceDifference;- H* a8 S5 t8 j N
global ObjectiveFunc;
- C* G/ d7 k+ L: t: P! M NoOfIterations = 0;& X4 l; B) Y! o: e- n: N- Z
%OptionData = [r,T,S0,K,Option Value,bid,offer]
5 g3 Q5 q0 H1 L, X8 F2 q3 a/ ` Size = size(OptionData);4 y$ |5 h( }+ B1 y5 F4 D+ m
NoOfOptions = Size(1);
- Q i; \" k# z$ t; n" K %input sequence in initial vectors [kappa,theta,sigma,rho,v0]6 H$ {2 u, Q0 p7 A( \9 J
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];
/ i* k- o; l7 t' Z lb = [0 0 0 -1 0];ub = [10 1 5 0 1];
4 Z9 H+ N9 t6 b( f0 B0 U asamin('set','test_in_cost_func',0)% G# P7 y, a- Y9 M# d
tic;7 \# X/ D$ [; B$ O5 _
[fstar, xstar, grad, hessian, state] = asamin('minimize',...$ d- [: i4 P7 I9 m
'HestonCostFunc',x0',lb',ub',-1*ones(5,1));! E8 m1 M; u+ e' Z! L2 z- U+ z
toc; %秒表计时器3 a. J* v/ j& t+ ?1 C$ R: i K
出错程序: @# @" \+ m8 n' p/ q
asamin('set','test_in_cost_func',0)
2 ^8 _. L$ p" q4 @" O运行提示错误为:
' [, e" }8 A+ _6 o1 H. k??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|