Redefining objective function to incorporate x-axis

48 Views Asked by At

I recently asked a question about minimizing the standard deviation from a list of equidistant values and I received a great answer here: https://math.stackexchange.com/a/4089367/907708

However, now I am tasked with redefining the first equation in the answer to the above question to allow for an x-axis, (points are no longer equidistant).

At this point, I am now given an x-axis that must remain fixed. (standard deviation must still be optimized but now we are given another constraint that points on the x-axis are no longer equidistant and therefore they must factor into the equation somehow ).

The points along the x-axis must remain fixed but the points on the y-axis are still free to be moved within the bounds defined in the previous question.

I was hoping someone could help me redefine the objective function in the above answer, or at least help point me in the right direction.

Example: y = [20, 24, 28, 24 ,20 ,18, 20, 32 ,30, 28, 20 ,24] (this is the h from the previous question)

x = [10,20,25,30,35,40,45,50,55,60,70,80]

This is not a homework problem so therefore I have no course material to help guide me to an answer. The only guidance I have is from the comments and answers to this post. Please understand that I am in no way a mathematician so I really need all the help I can get. Thanks!

1

There are 1 best solutions below

2
On

For the original data, the standard deviation of the Euclidean distances between all $\binom{12}{2}=66$ pairs of points is $15.29$. By perturbing $y$ to

[22, 24, 30, 26, 20, 18, 20, 34, 32, 28, 20, 25.84]

you can reduce the standard deviation to $15.08$.

enter image description here

I obtained this solution by solving a nonlinear optimization problem to minimize the standard deviation of distances $d_{i,j}$ subject to \begin{align} d_{i,j} &= \sqrt{(x_i-x_j)^2+(y_i'-y_j')^2} &&\text{for all $1\le i<j \le n$}\\ y_i' &\in [y_i,y_i+2] &&\text{for all $i\in\{1,\dots,n\}$} \end{align}


If you instead consider only consecutive pairs $(i,i+1)$, the original standard deviation is $3.14$, and by perturbing $y$ to

[22, 24, 30, 26, 22, 18, 22, 32, 32, 28, 22, 24]

you can reduce the standard deviation to $2.34$. enter image description here