[scilab-Users] lsqrsolve
Gary Nelson
gnelson at quantasonics.com
Wed May 5 21:10:55 CEST 2010
Thanks. Your observation is correct but, as far as I can determine, in my application would not apply. Perhaps one of the other scilab operators would be better suited to what I want to do --
lsqrsolve, datafit, fitdata, optim.
Suppose we have a gaussian plus noise centered at C (ie, maximum at C) and we have samples from -(large number) to C from which we want to estimate C, amplitude A, and sigma. I don't see how the mean and variance of the data will reveal these 3 gaussian parameters.
So I still want to try a parameter estimation tool and am soliciting a bit of guidance.
Suppose I have N samples (sample_freq=fs) from the left side of gaussian-like data that includes a maximum. I have a scilab function that generates a gaussian based on fs and the value of the maximum and an estimate of width at the half-amplitde (or .707 or 1/e or your favorite gaussian definition) point. What tool do I use to improve the parameter estimate of A, C, and sigma?
Thanks
Gary Nelson
On May 4, 2010, at 7:57 PM, ray joseph wrote:
> Gary,
>
> I am sorry that I am bypassing your original request; but if you calculate
> the mean and standard deviation of your data set, you will get the two
> parameters. Using the solver will be a fun exercise.
>
> Ray
>
> ----- Original Message -----
> From: "Gary Nelson" <gnelson at quantasonics.com>
> To: <users at lists.scilab.org>
> Sent: Tuesday, May 04, 2010 2:12 PM
> Subject: Re: [scilab-Users] lsqrsolve
>
>
> I would like to fit a gaussian to some data samples using least squares.
> The gaussian has two parameters -- amplitude and width (sigma).
>
> I would like to use 6 to 12 samples that span a maximum and provide a first
> guess of the amplitude and width.
>
> After reading the manual on lsqsolve, it seems like it will do the job, but
> I would appreciate some guidance to make it work.
>
> Thanks
>
> Gary Nelson
>
>
> On Apr 7, 2010, at 2:12 AM, Samuel Gougeon wrote:
>
>> ----- Message d'origine -----
>> De : Maso Ricci
>> Date : 31/03/2010 12:18:
>>> Hi,
>>>
>>> I am using the lsqrsolve function to fit some data.
>>> I wonder whether lsqrsolve accepts contrains in order to force the
> solution to be positive.
>>>
>>> thanks in advance for any comments and suggestions
>> Did you check the leastsq() function based on the optim() one ? Its 'b',
> binf, bsup
>> sequence of 3 input arguments allow to specify some boundaries.
>> So, for instance, if the solution you are searching for is a scalar that
> must be positive,
>> just set 'b',0,%inf. see help leastsq()
>>
>> HTH
>> Samuel
>>
>>
>
> Gary Nelson
> gnelson at quantasonics.com
>
>
>
>
>
Gary Nelson
gnelson at quantasonics.com
More information about the users
mailing list