Objective function for fmincon from surrogate model

2 ビュー (過去 30 日間)
Douglas Eddy
Douglas Eddy 2023 年 1 月 26 日
コメント済み: Douglas Eddy 2023 年 1 月 27 日
Trying to automatically generate the fun objective function for fmincon from a second order quadratic model generated by fitlm. There is no easy way from the outputs of a fitlm model. It should be easy because there is quadratic function created at mdl.Formula.LinearPredictor. ModelCenter is able to able to optimize any function generated as a surrogate model by RSM, which is what fitlm does. Does anybody have some function code that can generate the fun function automatically for fmincon from a quadratic model?

採用された回答

Matt J
Matt J 2023 年 1 月 26 日
編集済み: Matt J 2023 年 1 月 26 日
Can't you just do,
fun=@(X) norm(mdl.predict(X)-y).^2
  1 件のコメント
Douglas Eddy
Douglas Eddy 2023 年 1 月 27 日
Yes! This is exactly what I was looking for. I just was not able to find it in the search. Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeQuadratic Programming and Cone Programming についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by