I would like to scale a vector $x$ such that after weighting, it has the following properties:
$\sum_{i} w_{i} x_{i} = 0$ and
$\sum_{i} w_{i} x_{i}^2 = 1$
where $w_{i}$ are weights that add up to one. And $x_{i}$ could be any positive value. Let‘s say
$x=\pmatrix{0.6\\1.8\\2.4\\0.2\\3.1}$ and
$w=\pmatrix{0.2\\0.15\\0.3\\0.1\\0.25}$.
Does anyone know how to do that?
Unfortunately, this is not possible. Consider the following example $$\vec{x} = \left(\begin{matrix} 1 \\1 \end{matrix} \right) $$
Then you would have $$\sum_{i} w_ix_i = w_1x_1 + w_2x_2 = w_1+w_2 \overset{!}{=} 0$$
for the first constraint and
$$\sum_i w_ix_{i}^2 = w_1x_{1}^2 + w_2x_{2}^2 = w_1 + w_2 \overset{!}{=} 1$$ For the second constraint. Since both equations contradict each other, you can not find a suitable solution for $\vec{w}$.