Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2011-04-19 23:25:15

VitorSilva
Member
Registered: 2011-04-19
Posts: 3

linearising a gaussian function

Hello all,

I need to linearise the following Gaussian function:

f(x) =  a1*exp(-((x-b1)/c1)^2)

but I'm having a really hard time to come up with what is going to be the Y, the X the m and the b (assuming  y=mx+b as the expression that describes the line)

I only need this because I want to apply the method of least squares to compute those variables.. maybe there is a better way of doing this?

Thanks a lot
Vitor

Offline

#2 2011-04-19 23:41:19

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: linearising a gaussian function

Hi VitorSilva;

I am not sure I understand you. Usually a linearization occurs at one or more points.

You could take the natural log of both sides but you still will need some points to determine the constants.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2011-04-20 00:24:30

VitorSilva
Member
Registered: 2011-04-19
Posts: 3

Re: linearising a gaussian function

Thanks bobbym,
I actually have a set of about 206 points, and I want to fit those points to a gaussian curve (I know this can be simply done using matlab (which I already did) but I'm currently on the process of coding this process in python and therefore I needed a little bit more of insight). If I had my points already following a line I would only use the traditional formulae to compute the slope (m) and the  b values (y(x=0)). But I believe I still need to apply some changes to my values before I do this right?

Regards

Offline

#4 2011-04-20 01:31:25

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: linearising a gaussian function

Hi;

I have tried some transformations but with no luck.

If we say:

We are then creating coordinates (x, f(x))...

Using the transformation x -> 1 / y we are graphing (1/y, f(1/y))... This is nearly a straight line. You will have to leave out the point x = 0 to prevent a division by zero.

Trouble is that I cannot recover the f(1/y) back to f(x). You can recover the x's by inverting the 1 / y but not the other.

Another idea is to linearize by using Taylor series around 1. Since I do not know what your data looks like I centered it around one. Probably should be centered around the mean of your data.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#5 2011-04-20 19:12:01

VitorSilva
Member
Registered: 2011-04-19
Posts: 3

Re: linearising a gaussian function

bobbym, thank you so much, I think I got everything I needed.
Cheers

Offline

#6 2011-04-20 19:17:20

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: linearising a gaussian function

Hi;

Please come back and let me know how you did.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB