A Function for multiple 2D Gaussians

8 replies · 2K views · last reply
ThunderLight
Messages
27
Reaction score
2
I'm trying to put together a function that sums multiple 2D Gaussian functions in one graph (i.e.; multiple Gaussian pyramids).

So far from my research, I formed the following function definition:
Typeset equations defining a sum of 2D Gaussians: f(gaussians) = sum from i=0 to n of f(x,y)_i, where f(x,y)_i = A_i exp(-((x-x_i)^2/(2 sigma_x_i^2) + (y-y_i)^2/(2 sigma_y_i^2))), and n = sum of gaussians.


I'm not sure if my research led me to the correct way of forming the function. Is this how Gaussians can be represented to give me a graph of multiple Gaussians in one surface?
 
Yes. Kind of a landscape pocked with lots of hills.
 
  • Like
Likes   Reactions: ThunderLight
BvU said:
Yes. Kind of a landscape pocked with lots of hills.

Yes, that's what I'm looking for. But I'm worried about the notation, and placement of the i
Is it also correct for me to say ΣGaussians to represent how many hills, n? - Or there's a more formal notation for that?
 
Yes, I would say ##n## is the count of the hills. You confuse the issue somewhat by using the symbol ##f## twice.
 
  • Like
Likes   Reactions: ThunderLight
BvU said:
Yes, I would say ##n## is the count of the hills. You confuse the issue somewhat by using the symbol ##f## twice.

Would it be more proper/clearer to use only the first ##f## and go on directly to saying ##=... ## instead of redefining what ##f## function is?Thank you for your answer and affirmation.
 
Last edited:
Either that, or you use a symbol g for a single gaussian:
Equations defining a sum of 2D Gaussians: f(gaussians) = sum from i=0 to n of g(x,y)_i, where g(x,y)_i = A_i exp(-((x - x_i)^2/(2 sigma_x_i^2) + (y - y_i)^2/(2 sigma_y_i^2))), and n = sum of gaussians.


I take it you want to pass ##f## to a surface plot program or something.
 
  • Like
Likes   Reactions: ThunderLight
I would put the index i next to the function name: ##g_i(x,y)##

"f(gaussians)" doesn't make sense. f is a function of x and y: f(x,y).
 
  • Like
Likes   Reactions: ThunderLight
BvU said:
Either that, or you use a symbol g for a single gaussian:
View attachment 114288

I take it you want to pass ##f## to a surface plot program or something.

Great, thank you for your tip.
 
mfb said:
I would put the index i next to the function name: ##g_i(x,y)##

"f(gaussians)" doesn't make sense. f is a function of x and y: f(x,y).

I just realized that, thank you for pointing this out. You're right.
Thank you very much