Excel solver functionality in Matlab
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi everyone,
I am currently working on an inventory model and I want to forecast the demand using the holt-winters additive forecasting method. In this forecasting method there are three parameters that influence the outcome namely: alpha, beta, and gamma. I first made this forecast in Excel but now I want to implement it into Matlab. To have the best values for these three parameters I am using a training dataset and by using in Excel the solver function, screenshot below.
With this tool I can set the objective, this is the total deviation between the forecasted values and the actual demand, and I this to be a close as possible to zero. Therefore the solver can change three cells: alpha, beta, and gamma. The solver changes the values of the parameters to make the objective as close as possible to zero. Is there a way to do this in matlab?
Thank you for your help in advance!
댓글 수: 0
답변 (1개)
Harsh Mahalwar
2024년 2월 23일
Hi Sem,
I can recognise that you are trying to find a way to solve a nonlinear optimisation problem using MATLAB.
The optimisation toolbox in MATLAB provides the fmincon function which can be used for solving constrained nonlinear optimization problems. Unfortunately, it has no support for generalized reduced gradient (GRG) method (refer this article to know more on this), but you can choose between multiple algorithms in it using optimoptions function.
Here an example in which I am changing the algorithm from 'interior-point' (default) to ‘sqp’:
options = optimoptions(@fmincon,'Algorithm','sqp')
You can learn more about the optimoptions function from the link mentioned here:
One important thing to remember here is that 'trust-region-reflective' algorithm requires a gradient which can be added by setting SpecifyObjectiveGradient to true.
To know more about the algorithms supported by fmincon, from the link mentioned here:
For more information on the fmincon function in MATLAB by using the link mentioned here:
I hope this, helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!