Constrained minimization of a variable-dependent function
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a set of data to which I need to optimize a multi-variable function. For example the data is:
A=[7 8 9 10 11 12 13 14 15]; B=[0 0 0 1 1.5 2 2.7 4 7];
Where dependant variable B can be estimated using the following function: if A>C B=alpha*(A^p-C^p)^(1/p) else B=0 endif
I want to optimize the variables (alpha, p, C) to obtain the best predictions of B. There are constrains on the variables, namely: 0 < alpha < 1; p > 1; C > 0
It seems that fmincon is the best way to solve this problem, where the function to be minimised would just be: sum(abs(B_predicted-B_actual))
However, I can't figure out how to define the function for use with fmincon because of the "if".
Any help would be much appreciated!
댓글 수: 0
답변 (1개)
Vitali Avagyan
2014년 8월 20일
편집: Vitali Avagyan
2014년 8월 20일
Dear Shannon,
Sorry for replying so late - just saw your question. You do not need to consider "if" in your constrained optimisation if your data is as given in the question. Just start from the 4th element of C since if A<=C -> B=0 we can conclude that any number that satisfies c1>=7, c2>=8 and c3>=9 will be optimal for the first three elements of C. Hence, you need to optimise c4, c5 etc along with alpha and p. Also, you should add the following constraints to the elements of the C, i.e. c4<10, c5<11,c6<12,c7<13, c8<14 and c9<15. The rest is as you defined:
min sum(abs(B_predicted-B_actual))
s.t
0 < alpha < 1;
p > 1;
0<ci<ai, i=4,5...9
Hope, this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!