|
From: | Hinxx |
Subject: | [Help-gsl] fitting 3-peak gauss |
Date: | Mon, 21 Mar 2016 16:26:07 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
Hi all,I'm new to GSL and numerical methods so please bear with me. I'm using GSL-2.1.
I'm trying to fit a 3-peak gaussian curve onto experiment data that I have (800W5-95kv_ROI.txt). I started from expfit.c and nlfit.c and modified the code to handle gauss curve. For my initial tests I also used code/data from test_gaussian.c. I've played around with the test set and managed to get proper amplitude, sigma and peak location(s), also when extending test set to hold three peaks (copies of first) and code to handle three peaks.
When using the real data of some 240 points, I'm seeing weird behavior. Solver bails out after 1st iteration and I get my initial guessed parameters back, unchanged.
If I fiddle with the data set a bit to make all the points between the peaks near zero I get better results, bat still good enough.
Maybe it is worth noting that I also have some sample Matlab code that manages to find the fit on the presented data set. It is using code from http://www2.imm.dtu.dk/projects/immoptibox/.
I'm attaching the modified GSL code and real data set if someone might be able to help out.
Thanks in advance, Hinko
800W5-95kv_ROI.txt
Description: Text document
expfit.c
Description: Text Data
Makefile
Description: Text document
nlfit.c
Description: Text Data
output.txt
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |