- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:
! f5 \4 A' R6 }8 [# z3 C) P 为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”6 ?2 \4 [ F! J3 D, T* E
Error in ==> HestonASACalibration at 14
& N/ _6 N5 f2 o8 }, `: k asamin('set','test_in_cost_func',0)
" D' ~8 x5 b( V, {* _# H我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???5 J; L5 ~" p# ?4 V
, j; Z# H+ F p5 c2 |
完整程序& u) h9 ^2 k- f
clear;# ^7 p9 U* h! C [
global OptionData;! u* s% v/ w z# c4 C
global NoOfOptions;
8 K3 Y0 t' ^' a2 X- [4 Z9 \" d global NoOfIterations;& s$ \* c$ D! D8 c3 O9 G& S* f
global PriceDifference;
8 Q! A. q5 P: L4 y1 @, a global ObjectiveFunc;7 x$ e: H& D7 x4 [9 q
NoOfIterations = 0;: j: n Y. C. X/ n4 A/ B
%OptionData = [r,T,S0,K,Option Value,bid,offer]
5 W, V9 }' c: G* A8 H! u& P& v Size = size(OptionData);7 C h$ E. ]& t
NoOfOptions = Size(1);3 ~# F: }1 x' A) W X: D
%input sequence in initial vectors [kappa,theta,sigma,rho,v0]
4 }) P' k7 S. m x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];
$ `2 o B6 k- q6 r$ } lb = [0 0 0 -1 0];ub = [10 1 5 0 1];! a; D r+ o; R
asamin('set','test_in_cost_func',0)# o0 i" b: h2 F+ F
tic; K9 I$ L- l. R/ Y* g+ R% ~
[fstar, xstar, grad, hessian, state] = asamin('minimize',...' ^6 o2 T2 Z# c# e# s
'HestonCostFunc',x0',lb',ub',-1*ones(5,1));
# m$ [6 }) k. [- v" }: V7 [ toc; %秒表计时器' i* u6 k8 |) A6 v% b
出错程序
; Y+ R j/ A# n X6 ?asamin('set','test_in_cost_func',0)9 z& \/ y$ P' i- l5 n7 s
运行提示错误为:
9 p/ N/ n8 ^0 k* u??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|