2D Gauss fitting

Hi !I have a matrix 11x11 and I need a 2D Guassian Fitting algorithm !Does anyone know where i could find one ?ThanksFelix
[157 byte] By [feleexa] at [2007-9-29 11:11:11]
# 1
cross post
duffymoa at 2007-7-15 0:34:46 > top of Java-index,Other Topics,Algorithms...
# 2
Sorry, I thought I'd answered this one somewhere else.Check out "Numerical Recipes" by Bill Press et. al. It's got a lot of info on curve fitting. What did a Google search bring you? - MOD
duffymoa at 2007-7-15 0:34:46 > top of Java-index,Other Topics,Algorithms...
# 3
Didn't find anything apropriate in the Numerical Recepies...And in the google search only software sites show up... No 2D Gauss Fitting algorithm ! Is there any source in C, Java or MatLab out there ?Felix
feleexa at 2007-7-15 0:34:46 > top of Java-index,Other Topics,Algorithms...
# 4

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.

TerryMoorea at 2007-7-15 0:34:46 > top of Java-index,Other Topics,Algorithms...
# 5

> 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].

TerryMoorea at 2007-7-15 0:34:46 > top of Java-index,Other Topics,Algorithms...