Solving a One Dimensional Problem with Interpolation of Vectors

138 Views Asked by At

I have the following optimization problem.

$$\operatorname*{argmax}_{w} \|(1-w)\boldsymbol{X} -w\boldsymbol{Y}\|^2 \\ s.t. \quad 0<w<1 $$

How can I find the solution of this problem? May be can I apply gradient descent?

$J = \|(1-w)X -wY\|^2 + \mu (w-1)+\lambda w\\\frac{\partial J}{\partial w} = 0$

Is it correct? should I use $\lambda \quad \text{and} \quad \mu$ ?

$X$ and $Y$ are known, one dimensional vectors, their values are bounded in a known range.

2

There are 2 best solutions below

3
On BEST ANSWER

Since $X,Y \in \mathbb{R}$, we can restate your problem as $$w^* :=\arg \max_{0\leq w\leq 1} (a+bw)^2$$ where $a = X$ and $b = -(X+Y)$. Now, with $f(w) = (a+bw)^2$, we now that this convex parabola has a zero at $-\frac{a}{b}$ (where the minimum is reached). So we want to go the further as possible from the minimum. Therefore we have $$ w^* = 1 \quad \text{ if } -\frac{b}{a}\leq\frac{1}{2},\quad \text{ and } \quad w^* = 0 \quad \text{ if } -\frac{b}{a}>\frac{1}{2}.$$ See the figure below to get a better intuition.

enter image description here

In blue $-\frac{b}{a} \leq \frac{1}{2}$ and in red $-\frac{b}{a} \geq \frac{1}{2}$.

0
On

The objective function is a quadratic function of $w$, as can be seen using FOIL. The graph of this quadratic function is a parabola that opens upwards. The maximum value of this quadratic function over $[0,1]$ must occur either at $w = 0$ or $w = 1$. So just check those two possibilities.