- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:
4 T& I+ Y Q8 ? q 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”
. A/ c& J: ^, X1 G9 g e! p- W# eError in ==> HestonASACalibration at 14
* \. s3 Q" q9 I+ K+ d: |% |$ [+ f asamin('set','test_in_cost_func',0)$ _7 F. j* K5 i2 H8 t* s$ k
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???# |5 Y4 a: f7 U9 Q4 L
& N7 {9 G3 N4 `- ~0 ~6 y
完整程序
3 ~: r2 C# m" g" l) oclear;
5 }9 G! }) G" ]# ^( O% z) K) w global OptionData;( w) Z% t& g; y/ p. N. o
global NoOfOptions;
3 K6 n' G9 p/ g3 {! A global NoOfIterations;0 y: {" T6 G3 y
global PriceDifference;6 R7 ?6 X& t$ J/ f- o
global ObjectiveFunc;6 M4 F% w0 c' V/ L a# o( g Y/ y
NoOfIterations = 0;: p" C+ k; C: n- z+ n a
%OptionData = [r,T,S0,K,Option Value,bid,offer]/ ?( q- C+ w6 P/ {+ B2 ^3 q
Size = size(OptionData);
( ^7 Z4 [* E5 b k: c Z* o: U NoOfOptions = Size(1);
" \3 q2 c7 H( |! l- W3 f2 y* l %input sequence in initial vectors [kappa,theta,sigma,rho,v0]: P9 M4 n4 E+ `8 ]8 h/ T
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];
3 A4 j+ F/ u% W6 S0 _! { lb = [0 0 0 -1 0];ub = [10 1 5 0 1];
7 |! O3 `3 m7 X' e! |1 G9 P6 ~8 `( ?1 }$ a asamin('set','test_in_cost_func',0)
, F9 B9 O( e/ w, S tic; P6 S2 X& }' @* K" {3 ]! h
[fstar, xstar, grad, hessian, state] = asamin('minimize',...
1 T5 g6 s' ~! n$ v$ c9 t3 \; _/ h 'HestonCostFunc',x0',lb',ub',-1*ones(5,1));
- E$ C( J9 ~7 z" H toc; %秒表计时器# T) S( x" `% y. M8 P! g. {3 l
出错程序6 Z+ d) \$ }, E3 p# T. I8 q+ I- m
asamin('set','test_in_cost_func',0)
$ T4 w* T/ p6 C1 k7 n运行提示错误为:
( V# W! k* J. o! g! s# B( _/ \2 O??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|