- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:
$ k, \% U' Q$ `1 D8 ~$ g 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”* T: O+ i& @3 F0 t4 ]
Error in ==> HestonASACalibration at 14/ C% u, A8 l" R2 e
asamin('set','test_in_cost_func',0); O- W% w1 p" x @
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???
7 ^9 _5 v4 R0 H9 M6 b! ?
' D3 x: k, a! Y1 r% c9 k 完整程序5 W4 W+ X0 Y+ J5 ?+ L9 j; u
clear;
# W) k2 ?. l* C5 f- X global OptionData;
+ E b2 |: ?1 v+ r4 q global NoOfOptions;
0 Y$ `$ s& L {; Z' N; z2 X global NoOfIterations;5 v. h+ @# w& t5 w9 v! [# p/ o
global PriceDifference;
4 I% u* `8 L1 m! z: G global ObjectiveFunc;6 G& N/ d! `! o3 N9 a5 \/ W
NoOfIterations = 0;
1 }) o7 n3 e& b %OptionData = [r,T,S0,K,Option Value,bid,offer]
3 }/ {. t; n6 U' ?# p! o Size = size(OptionData);
; ^& a& N3 e% \2 h NoOfOptions = Size(1);% \* ^! }& q1 Y. w: G) b5 K( `
%input sequence in initial vectors [kappa,theta,sigma,rho,v0]
# ]5 C/ p- v5 N2 ~ x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];
9 U0 t4 p& p0 @0 Y lb = [0 0 0 -1 0];ub = [10 1 5 0 1];
5 w: T4 g: ?* a asamin('set','test_in_cost_func',0)4 M5 { W: y1 L7 z- o* k
tic;
1 g5 [, Z- |' t0 E2 f0 W [fstar, xstar, grad, hessian, state] = asamin('minimize',..." |' @9 c J; M: I
'HestonCostFunc',x0',lb',ub',-1*ones(5,1));
+ _$ Z; f, x, Z* s& M6 k toc; %秒表计时器' x7 ^; @# u8 M1 U* S( ]! |
出错程序% j+ l5 a6 a/ {# N
asamin('set','test_in_cost_func',0)
* R0 \, e+ x9 ?) G1 d. Y; m) E运行提示错误为:
# R) n: J. y' l! z??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|