I wanted to fit a 2D Gaussian function $$f(x,y) = \frac{1}{2 \pi \sigma^2} \exp \left(-\frac{(x-\mu_1)^2 + (y-\mu_2)^2}{2\sigma^2}\right),$$ to a set of points prepared from an image file (triplets $\{x_i, y_j, f_{ij}\}$), and NonlinearModelFit returns quite a confusing fit.
I used the following code
v = Import["https://pastebin.com/raw/6JuygfJ1", "Table"];
f[x_, y_] := 1/(2 Pi σ^2) Exp[
-((x - Subscript[μ, 1])^2 + (y - Subscript[μ, 2])^2)/(2 σ^2)
];
fit = NonlinearModelFit[
v, f[x, y], { Subscript[μ, 1], Subscript[μ, 2], σ}, {x,y}
];
which results in something like this
My problem here is that it even though the $\mu_1, \mu_2$ values look promising, the $\sigma$ is way off. For comparison, here are plots of the data itself, and the data interpolated.
The data comes from an image of a laser beam coming from an optic fiber. There is some visible interference pattern, but I have no idea if that is the problem.
Any help in finding out the strange behaviour will be greatly appreciated.