Algorithm for weighted elliptic curve fit
Fitting an ellipse to a set of points is sometimes known as elliptical regression.  Doing a Google search on that phrase will find you many resources on the subject (e.g., 1, 2, etc.; I can't vouch for any of these).

Let's focus first on the case where you ignore outliers.  Then, there are two methods.  One way is to use least-squares fitting and directly compute a best fit (e.g., the method of Fitzgibbon et al).  An alternative method is to use iterative methods, where you write an objective function $\Phi(p)$ that captures how well the ellipse parameters $p$ fit the data and then use gradient descent, the Gauss-Newton method, or some other method of optimization.  See, e.g., the Levenberg-Marquardt algorithm.

You'll also need to decide on objective function, or equivalently, on the error model.  Standard methods typically measure the "goodness of fit" by measuring the vertical error: for each point, you measure the length of the vertical line from that point to the fitted ellipse, and that is the error associated with that point; then, you sum up the squares of those errors.  This is the right model if you think that your measurement of the $x$-coordinate is perfect and your measurement of the $y$-coordinate is corrupted by random errors.  However, in practice that's probably often not the case; rather, we probably think that the location of the point has been shifted from the ellipse in a random direction.  In that case, a better measure of "goodness of fit" would be to measure the distance from the point to the ellipse (in whatever direction makes that distance minimized; not restricting only to a vertical distance), and then take the sum of those squared distances.  This does require you to use iterative methods to minimize this objective function.  A similar issue arises in linear regression (see here) and it might be easier to understand in that scenario first.

OK, that should handle the case where you have no outliers.  What if you do have outliers?  Then there are multiple reasonable approaches.  One is to use an objective function that is robust to outliers: for instance, use the median of the squared distances rather than the sum of squared distances, or use the Huber loss function instead of the square.  The downside of these methods is that they make it harder to compute the gradient and thus harder to apply iterative methods (and the non-iterative methods probably can't be used at all).

An alternative way to deal with outliers is to use RANSAC, which is a general procedure for dealing with outliers.  An overview is that you pick a small random sample of the points, hope that the random sample has no outliers, tentatively fit an ellipse to the sample, use the tentative ellipse to classify the points into inliers vs outliers based on how far they are from the tentative ellipse, then fit a new ellipse to all the inliers; and repeat 1000 times with 1000 different random samples, taking the best solution found.  This is a generic method for dealing with outliers that has the advantage of being usable with existing non-robust methods for elliptical regression.  You don't need to modify the loss function, objective function, or algorithm at all, since you are only applying elliptical regression to inliers, so you can use any method for elliptical regression without needing it to be robust to outliers.