What about finding the means and standard deviations of the xs
and ys, and the correlation between them? Then the Gaussian is
given by the simple formula
f(x, y) = exp(((x-xbar)/sx)^2
+ 2*r*((x-xbar)/sx)*((y-ybar)/sy)
+((y-ybar)/sy)^2
)
/((2*pi*sx*sy)*sqrt(1-r^2))
if I remember rightly (but I would check it :-)
If your matrix consists of frequencies, use weighted averages
etc. E.g. xbar = sum over rows (x * sum over columns (f[i,j]))),
sx = sqrt(sum over rows ((x-xbar)^2 * sum over columns (f[i,j]))).
I assume the data is frequencies, but you don't say.
> If your matrix consists of frequencies, use weighted
> averages
> etc. E.g. xbar = sum over rows (x * sum over columns
> (f[i,j]))),
> sx = sqrt(sum over rows ((x-xbar)^2 * sum over columns
> (f[i,j]))).
>
> I assume the data is frequencies, but you don't say.
Sorry, I meant f[i, j] to be scaled so that there sum is 1.
Otherwise divide the averages by the sum of f[i, j].