Force minimum of quadratic fit to certain data point I want to fit some data $(x_i, y_i)$ with quadratic function. No problem till there. However, I want the polynomium minimum of the fitted curve to be at certain point $(x_k, y_k)$. If it is possible, I'd like a python example.
Here is the data I work with:
In [161]: x
Out[161]: 
array([ 0. ,  0.1,  0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9,  1. ,
        1.1])

In [162]: y
Out[162]: 
array([-78314.37119, -78314.4009 , -78314.40665, -78314.40274,
       -78314.39626, -78314.39821, -78314.39658, -78314.38418,
       -78314.37636, -78314.35708, -78314.33658, -78314.29853])

In [159]: xf
Out[159]: [0.2]

In [160]: yf
Out[160]: [-78314.40665]

xf and yf are the coordinates of the quadratic fitted minimum (which is the minimum of all the (x,y) values)
 A: As Jyrki Lahtonen commented, the problem reduces to finding the best value of $c$ for the model $$y=c(x-x_k)^2+y_k$$ based on $n$ data points $(x_i,y_i)$. If you define $z_i=(y_i-y_k)$ and $t_i=(x_i-x_k)^2$ then, the model reduces to $$z=c t$$ which corresponds to a linear regression without intercept.
If you want to minimize the sum of squared errors, you would have $$c=\frac{\sum_{i=1}^n t_i z_i }{ \sum_{i=1}^n t_i^2}$$ Using your data 
$$\left(
\begin{array}{cc}
t_i & z_i \\
 0.04 & 0.03546 \\
 0.01 & 0.00575 \\
 0.00 & 0.00000 \\
 0.01 & 0.00391 \\
 0.04 & 0.01039 \\
 0.09 & 0.00844 \\
 0.16 & 0.01007 \\
 0.25 & 0.02247 \\
 0.36 & 0.03029 \\
 0.49 & 0.04957 \\
 0.64 & 0.07007 \\
 0.81 & 0.10812
\end{array}
\right)$$
leading to $c=0.115658$ which is in fact exactly $\frac{887673}{7675000}$.
A: You want to fit a second degree polynomial, i.e., find coefficients $(a,b,c)$ in:
$$y=a+bx+cx^2.$$
The minimum is at
$$0=b+2cx \iff x=-\frac{b}{2c}$$
The value at the minimum is
$$f(x=-\frac{b}{2c})$$
So to fit your function, you could use ordinary least squares with constraints. The constraints are:


*

*$c<0$ (for minimum)

*$-\frac{b}{2c}=x_k$

*$f(-\frac{b}{2c})=a-\frac{b^2}{2c}+\frac{b^2}{4c}=a-\frac{b^2}{4c}=y_k$


where $(x_k,y_k)$ is the point of the global minimum. I don't really know how to implement this in python, but I should think that OLS with constraints is very common.
