- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:- C+ [% {: q% i; T4 M4 t5 N3 Z5 @
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”& R, w! D/ l4 T
Error in ==> HestonASACalibration at 14* [& C2 l2 n$ Z5 ]8 Q, w
asamin('set','test_in_cost_func',0)' u# v+ [! L; U: o3 a' M
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???) Y* F+ t$ G3 P& T' L2 q
2 |% J( z" \- x# ~4 v6 x2 d
完整程序9 W. I4 w5 b$ A; W8 k) G
clear;
" D6 A8 }2 g& Y; B global OptionData;) Y. d1 @/ K* C% ^. \ ?
global NoOfOptions;
. v& h3 L! B4 j+ D, P9 k: J/ U/ x/ W global NoOfIterations;: u5 N0 N* r9 D9 M
global PriceDifference;
t; w- T2 |# z* t j9 }9 v, u global ObjectiveFunc;
; @& D9 |0 x; T NoOfIterations = 0;/ x0 ?" `/ W f2 @
%OptionData = [r,T,S0,K,Option Value,bid,offer]
7 E. ?6 {7 T) O4 \ Size = size(OptionData);3 R7 [8 H, y3 e8 Q7 a1 D
NoOfOptions = Size(1);2 Q& R* z) b9 r. R# | _" u* \( a
%input sequence in initial vectors [kappa,theta,sigma,rho,v0]
2 h3 l0 u+ Z# o6 e0 r+ f x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];; s+ `4 D! A7 |# R5 |
lb = [0 0 0 -1 0];ub = [10 1 5 0 1];
6 u6 a0 h1 Q, @: I) K4 F asamin('set','test_in_cost_func',0), h) t; p7 B; ?8 b
tic;, Q/ h/ x: k4 N
[fstar, xstar, grad, hessian, state] = asamin('minimize',...
3 J2 e' d: j$ M1 ]1 [ 'HestonCostFunc',x0',lb',ub',-1*ones(5,1));8 c1 Y* B% \2 A7 i- [- P/ y% ~
toc; %秒表计时器
& c' T+ L0 T4 d 出错程序2 K9 v7 t# F3 `+ O6 D7 o4 U; `
asamin('set','test_in_cost_func',0)+ M, b, K" @( z4 q( g
运行提示错误为:
, u1 y) t6 A2 y8 t% c??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|