- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:* i; a! m0 {( k
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”" b; [$ F3 x7 c0 m" w2 ?6 d/ `
Error in ==> HestonASACalibration at 14* o, W, z% z2 R. `+ M, t8 Y Y2 l
asamin('set','test_in_cost_func',0)
2 {% O8 ?/ a4 t' i我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???
1 M8 N8 }1 G7 ?4 M( H
) p3 z7 S+ m# i( Q/ e2 M 完整程序
2 t6 t8 }4 {$ X N+ |6 Zclear;
* N/ }$ h3 ?2 Y* m3 { global OptionData;6 H8 j+ r% z3 ?+ u2 B% k
global NoOfOptions;8 Z7 k8 K- _) f; V% ?: V
global NoOfIterations;: U( V' j3 r4 T A& M6 o0 @! W% q! [
global PriceDifference;
: A/ y9 m7 e+ T- V, K8 m: W- a global ObjectiveFunc;6 N0 `9 ^- g: q: B7 Z4 v( B
NoOfIterations = 0;
6 ~8 Q# H' G" ^; U1 `) V8 }( S- \ L %OptionData = [r,T,S0,K,Option Value,bid,offer]
; o" s. s4 U8 v' M2 r6 M Size = size(OptionData);- q) W) ~& w2 j7 T, V3 @; a$ K
NoOfOptions = Size(1);
# K8 C( _7 I; r5 C( [& _- K %input sequence in initial vectors [kappa,theta,sigma,rho,v0]' ]/ L2 m) ?0 P2 O+ Q
x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];1 s, f# v) G P9 q& r& O
lb = [0 0 0 -1 0];ub = [10 1 5 0 1];0 H) G* Y) _) V2 h
asamin('set','test_in_cost_func',0)- u2 ?1 O/ r4 R" Q( t& T
tic;
; E+ W$ k" P: S# p }9 ~$ _ [fstar, xstar, grad, hessian, state] = asamin('minimize',...8 i+ |7 d# ~6 C! g: G& `
'HestonCostFunc',x0',lb',ub',-1*ones(5,1));+ s+ R6 s! D" [( v& O& b* r
toc; %秒表计时器
' h1 b& ?5 s4 i7 [! D 出错程序
1 _2 v9 j" j) |# kasamin('set','test_in_cost_func',0)7 h( k- R+ x* d, g: q) T% g
运行提示错误为:5 R( f8 Y' c n" @' ~
??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|