发新话题
打印

MATLAB 求解问题

本主题由 QuantHR 于 2008-3-29 03:49 PM 移动

MATLAB 求解问题

一个求在一定的目标函数下,求解资产最优配置问题。 期望收益率和方差协方差矩阵已经估计出来, 就是目标函数不知如何写。。。
       特请教大家。。
附件: 您所在的用户组无法下载或查看附件

TOP

^_^,  非线性优化就可以搞定

TOP

有什么不好弄的? 你公式不是已经写出来了吗? 用fmincon就可以了。
Search Quantitative Finance Code
欢迎与本站友链
发帖前请看置顶帖+搜索历史旧帖

TOP

有新问题了

我用了fmincon 函数,但是报错
X=fmincon(func,X0,[],[],aeq,beq,lb,ub)
Warning: Large-scale (trust region) method does not currently solve this type of problem,
switching to medium-scale (line search).
> In fmincon at 260
??? Error using ==> fmincon
FMINCON cannot continue because user supplied objective function failed with the following error:
Error using ==> inlineeval
Error in inline expression ==> (X*transpose(meanrate))/sqrt(X*ratecovar*transpose(X))
??? Error using ==> eval
Undefined function or variable 'X'.

TOP

把code贴出来才能帮你。
Search Quantitative Finance Code
欢迎与本站友链
发帖前请看置顶帖+搜索历史旧帖

TOP

汗!

做出来了, 原来是我把一个本来是行向量的弄成了列向量!
  羞愧。。。
  谢谢老大!

TOP

回复 6# 的帖子

果然很汗阿,   :)

TOP

发新话题