- 在线时间
- 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
- 自我介绍
- 数学专业
 |
疑问:) W9 Z; ?# W$ z2 f8 B
为什么在运行下边程序时,总是提示“??? Undefined function or method 'asamin' for input arguments of type 'char'.”+ w% E X7 j3 ~% ]3 @
Error in ==> HestonASACalibration at 14
' A" Y* Y$ o0 L6 a3 z) V! j) Z$ N asamin('set','test_in_cost_func',0)$ ]3 }% m4 L m
我在网上查了下,这是在运ASA时,没定义函数的类型……总之,不是很理解,更不知该怎么改正???; a6 W# E3 [8 \- z) t
$ [$ |3 U3 D; y/ ?$ R
完整程序. N3 J3 Q) X/ s* a" ^- x
clear;9 F* N! a! k; e' g
global OptionData;, I9 D2 F2 ~8 W/ K3 c+ e: u2 x( B
global NoOfOptions;' I; k! a& z' l0 x1 `
global NoOfIterations;/ Q4 |: R: w( b% \& I
global PriceDifference;! Z( r3 }6 m1 @+ `
global ObjectiveFunc;4 O% R3 ^: m0 |3 s: B
NoOfIterations = 0;$ e; g3 @4 k5 M% e. v4 p
%OptionData = [r,T,S0,K,Option Value,bid,offer]
; n7 J! S% j" `# e& h" t4 k Size = size(OptionData);
3 A0 `# \( q! S$ U! L/ U6 q NoOfOptions = Size(1);, z4 x" ~7 `5 l" o1 g. o h8 f
%input sequence in initial vectors [kappa,theta,sigma,rho,v0]
/ {: h9 x2 K" }" S# {% b/ I x0 = [0.030854841 0.999999922 0.248415019 -1 0.08977599];
/ p1 ]4 @% E/ ?& G lb = [0 0 0 -1 0];ub = [10 1 5 0 1];, ^2 U( H4 ` D/ P
asamin('set','test_in_cost_func',0)# f0 \( x- w. N) e B8 Y
tic;8 B, x5 j" w' R* ?& |" U
[fstar, xstar, grad, hessian, state] = asamin('minimize',...
" Y5 L* }) l$ S' ^ 'HestonCostFunc',x0',lb',ub',-1*ones(5,1));
# k# m: @# M. ^4 m# q+ N) | toc; %秒表计时器
6 k2 a0 o4 u- F 出错程序
b2 {9 G$ y/ z7 K0 Rasamin('set','test_in_cost_func',0)
+ Z' R( m, i" j9 [ ~- k* Z运行提示错误为:
1 {! \ g9 a& t. s+ l3 c2 b??? Undefined function or method 'asamin' for input arguments of type 'char'. |
zan
|