comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » MPFITFUN AND PARINFO
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
MPFITFUN AND PARINFO [message #48702] Wed, 17 May 2006 08:45 Go to previous message
JJMeyers2 is currently offline  JJMeyers2
Messages: 12
Registered: October 2005
Junior Member
Hello,

I am trying to use MPFITFUN to fit the sum of 2 Gaussians to my data. I
need both of the Gaussians to give curves with positive numbers because
a negative value will not make physical sense. When I run the MPFITFUN
it gives me 1 Gaussian that has all positive values and one Gaussian
that some values are negative. I tried to use PARINFO to costrain the
values for the second Gaussian but I think I am using it wrong.
Here is what I did:

guess_2g=[0.70,0.11,0.3,0.13,532.,1.]

parinfo(5).limited(0)=1.
parinfo(5).limits(0)=0.

fit=mpfitfun('twogauss',X,Y,1,guess_2g,PARINFO=parinfo)

and the error message i receive is:
% Expression must be a structure in this context: PARINFO.
% Execution halted at: fit.pro

I am only interested in constraining the last number for the guess
because that number gives the sign of the second Gaussian. I understand
that I will have to make an array like guess_2g for parinfo but I do
not want to do that because I want to the program to take the initial
values from guess_2g and just turn to parinfo only for the constraints
if it is needed.
Any suggestions on how to do that?

Thank you in advance,
JJM
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: MPFITFUN
Next Topic: format control characters

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:26:31 PDT 2025

Total time taken to generate the page: 1.04152 seconds