I try to write a script to fit 1 column with two peaks (gauss). I have got some results but if I compare the results ( xc1 and xc2 ) I have never got the same as from the fit made usig the normal origin features. Where is my mistake? I use this script:
B=390; E=450; S=1;
for (j=0;j<=S-1;j+=1)
{ nlsf.init(); // initialize fit
nlsf.dataBegin=B; // Fitbereich begin nlsf.dataEnd=E; // Fitbereich ende
nlsf.func$=Gauss; // define function to be used during fitting nlsf.fitData$=Data1_c$(j); // define data to be fitted nlsf.numReplica=1; // =1 implies 2 peaks nlsf.p1=0; // initialize y0 nlsf.p2=1.266; // init xc1(center 1) nlsf.p5=1.277; // init xc2 (center 2) nlsf.funcX$=data1_a; // X data to be used to create fit dataset nlsf.funcCol$=Data1_c$(j); // fit dataset
for(ii=1;ii<=2;ii+=1) // Parameterbestimmung
{
nlsf.p$(3*ii)=0,01124; // initialize widths p3 (w1), and p6 (w2) nlsf.p$((3*ii)+1)=0.001; // initialize Areas p4 (A1), and p7 (A2);
};
nlsf.fit(50); // perform 20 iterations Can anybody help me? Thanks!!
Does increasing the number of iterations in your script help? Depending on your data, you may have a rather broad/flat chi-sq surface and if that is the case, you may get different parameters based on how many iterations, because the chi-sq may not be changing when the parameters change slightly.
If the above does not help, you should send your data to your local tech support representative so that they can run your script and see what the problem could be.