Failure in initial objective function evaluation. FMINCON cannot continue
이전 댓글 표시
[Lambda] =(mean(Benchmark)-monatlrisikofreierZins)/(2*std(Benchmark)^2);
Zielfunktion = (@(Ausgangsgewichte)Ausgangsgewichte'*(-Alpha)+Lambda*(-(AktiveGewichte'*Kovarianz*AktiveGewichte)));
Aeq=[ones(1,assets);-Beta'];
beq=[1;-1];
OptimierteGewichte = fmincon(Zielfunktion,Ausgangsgewichte,[],[],Aeq,beq,untereGrenze,obereGrenze);
AktiveGewichte = OptimierteGewichte - BenchmarkGewichte;
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the
second matrix. To perform elementwise multiplication, use '.*'.
Error in RelativeOptimierung>@(Ausgangsgewichte)Ausgangsgewichte'*(-Alpha)+Lambda*(-(AktiveGewichte'*Kovarianz*AktiveGewichte))
Error in fmincon (line 546)
initVals.f = feval(funfcn{3},X,varargin{:});
Error in RelativeOptimierung (line 47)
OptimierteGewichte = fmincon(Zielfunktion,Ausgangsgewichte,[],[],Aeq,beq,untereGrenze,obereGrenze);
Caused by:
Failure in initial objective function evaluation. FMINCON cannot continue.
댓글 수: 1
답변 (1개)
Rebecca Biegger
2019년 4월 11일
0 개 추천
댓글 수: 5
Brendan Hamm
2019년 4월 11일
The optimization toolbox will make Ausgangssgewichte a column vector. I'm a bit confused as this is the design variable, so you cannot actually call size(Ausgangsgewichte) which leads me to believe you assumed it to be of this size, but it is not.
Rebecca Biegger
2019년 4월 11일
Rebecca Biegger
2019년 4월 11일
Try
Zielfunktion = @(Ausgangsgewichte) -Ausgangsgewichte*Alpha + Lambda*(-(AktiveGewichte*Kovarianz*AktiveGewichte.'));
But I'm confused about the part
Lambda*(-(AktiveGewichte*Kovarianz*AktiveGewichte.'))
If this part doesn't depend on "Ausgangsgewichte", you don't have to consider it in the objective function.
카테고리
도움말 센터 및 File Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!