- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:$ e+ z9 o( y* m
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”* P7 m! f# Z' M, \0 ^! g0 m% M
Error in ==> HestonASACalibration at 14
% R; {; u- c2 N* U* W0 T; J asamin('set','test_in_cost_func',0)8 n2 z0 F- G# R. v& M: p4 }) q
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???
" C; U. S( C$ ?, U8 H
0 C7 L% p( E6 A4 w$ R 完整程序
3 [- i! L2 H8 c1 d! }' oclear;9 `* v% {3 A9 Y, M. e! G
global OptionData;& I7 Y. \% [% g
global NoOfOptions;$ K" T/ X/ q0 w
global NoOfIterations;
" Q- n, Z4 `4 n b- ^ global PriceDifference;! i( f+ f, y1 V# u6 _0 B
global ObjectiveFunc;
) ?5 V: R- \; e% ~% t& D4 A' c NoOfIterations = 0;
( M% N% j# Z# v3 D& d4 u4 _/ z6 Y# ]6 [ %OptionData = [r,T,S0,K,Option Value,bid,offer]
. R! L' z/ Y8 I; m, c8 f) m Size = size(OptionData);
1 E" q( R% ]! b; ~' u$ W NoOfOptions = Size(1);
5 H7 p! G4 @' u/ C0 V %input sequence in initial vectors [kappa,theta,sigma,rho,v0]6 @3 ^$ s0 {3 M% ]! }. w2 A0 L
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];
8 B" ?) P+ f' `' P+ p lb = [0 0 0 -1 0];ub = [10 1 5 0 1];& z3 m7 {4 R9 O7 }/ X) ^4 x
asamin('set','test_in_cost_func',0)6 i/ u0 T& L$ E7 o8 `3 N
tic;2 `8 K5 V( w3 h$ p2 U
[fstar, xstar, grad, hessian, state] = asamin('minimize',...% A7 e3 g9 ^- {8 [8 ?5 y
'HestonCostFunc',x0',lb',ub',-1*ones(5,1));
3 Z8 b' ] J# p4 h% w0 u/ q) M toc; %秒表计时器6 X$ |, L, f8 B( q! i0 u Y
出错程序) m: E6 u) {; T
asamin('set','test_in_cost_func',0)3 n% Q. E3 C% W, {# I" |
运行提示错误为:! _( @% F. n1 m( W2 f) h6 v
??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|