HELP!!! Trouble using fminsearch for fitting functions to data

Hello Folks!

I have a program that is supposed to fit the sum of two gamma variate functions to a set of data.

The trouble is my solution is only giving one gamma variate function. It is obvious from looking at the graph that the minimization is not correct and that it would be better with a second gamma variate function. I am confused as to why the fminsearch is not converging properly:

Maybe its my initial estimate point?! I doubt its the range of the data I do the fit on, my fit goes form my 13th data point to my 305th data point, this should be sufficient for a good fit of both gamma variates. Worst of all someone else in my research group has done a good fit using my prgram (figure 2_GV_fit.jpg attached)so I know my program shoudl reproduce something fantastic !!

my range of fitting is characterized by:

spt - starting point (13)
ept - ending point (305, if it was up to 312 it would be fine)
spt needs to be 13 or larger because I don't want my data to fit the zeroes in the initial data.

Please HELP!!

I have attached the appropriate files to run my program for the fitting as well as the plot I am getting (with only one gamma variate function) and the plot I am trying to get (with both gamma variate functions)

Once the path has been set fo rth eappropriate files, the command window should be given the following command:


This command will call my function for the fit I want my data to be minimized with respect to


When asked to 'select tissue curve matrix' for an input, you should select the 'Simulated Arterial Input Function.txt ' file I have attached

Then when asked to input the time interval it should be set to : 0.5

I appreciate any light that you folks here can shed on this problem.

thanks again


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion