# Sum of squared difference and Gaussian noise model

I have been reading that when the underlying error is distributed normally, then minimising the sum of squared difference between the observed data and the model is the appropriate cost function to do the model fitting. However, I am having trouble understanding why that is the case.

I was wondering if there is an intuitive way to understand why this is the case? What would happen if I use other cost functions say point wise mutual information or some local measure like cross correlation.

The sum of squares cost function arises naturally from the assumption, $y = t(x,w) + \epsilon$, where $\epsilon \sim N(0,\beta^{-1})$. Regarding your concrete example, you take a series of measurements, which it amounts to a series image points from images $x$ and $y$. For that set, the likelihood function is,

$$\prod_{n=1}^{M}N(y_{n}|t(x_{n},w);\beta^{-1})$$

Which is equivalent to minimizing the log-likelihood function, that is,

$$\sum_{n} \log N(y_{n}|t(x_{n},w);\beta^{-1}) = -\frac{\beta}{2}\sum_{n}\left[ y_{n} - t(x_{n},w)\right]^{2} + \frac{M}{2}\log \beta - \frac{M}{2} \log(2\pi)$$

The non-linear mapping is embedded in the deterministic function $t(x,w)$, which you previously choose, depending upon your camera calibration settings.

I have been reading that when the underlying error is distributed normally, then minimising the sum of squared difference between the observed data and the model is the appropriate cost function to do the model fitting. However, I am having trouble understanding why that is the case.

"Appropriate" might mean any number of things, but my guess is that they're referring to the fact that when the errors are normal, the least squares estimates are maximum likelihood.

Using maximum likelihood (ML), the estimates are the ones that give the best chance of observing the data you got (conditional on the remaining assumptions).

ML estimators have a number of nice properties and are very widely used - but there's plenty of good reasons to use least squares even when the data aren't normal (on the other hand, when the data are very far from normal, many of those nice properties aren't likely of much use - it's no use being BLUE when all linear estimators are terrible).

What would happen if I use other cost functions say point wise mutual information or some local measure like cross correlation.

Well, presumably they wouldn't be ML, but that's not a problem if you're looking to optimize something else.

Excuse my ignorance; can you give an example (or point to one) showing how these would work in this context?