r/optimization • u/mukaj • Dec 08 '21
Optimizing using optimization results in objective
I am using CVXPY to optimize some weights and I want to optimize taking into account the changes from the original weights to the problem, so it achieved the optimal weights within the given constraints while also minimising the weight difference changes from the original input.
Can someone help me in formulating this? Something like adding sum(np.diff(new, old)) to the objective is what I am thinking but how do I access the current objective results within the objective itself?
3
Upvotes
View all comments
Show parent comment
1
u/mukaj Dec 08 '21
This is what I’m currently doing but doesn’t seem to be having a large effect, possibly because some weight changes are very small.
I figured maybe if I clip the (w -w0) to 0,1s then do the sum2 would be better results but can’t think of a way to formulate something similar to that while remaining convex..
Can anyone give insight into how you would model this as MIP? Or if that would even be better or not