After many months, I am now banging my head against the wall because I can't find a solution to this seemingly trivial problem.&nbsp; Any help would be appreciated:

I am trying to apply a nonlinear fitting routine to a 3D MR image on a voxel-by-voxel basis.&nbsp; I've tested the routine using simulated data and things went well.&nbsp; As for the real data, the fitting routine works variably.&nbsp; By variably, I mean the following: &nbsp; with a specific set of starting parameters the routine would work for the first 10 voxels, for another set of starting values the routine would work for the first 1000 voxels and so on.&nbsp; NEVER was I able to get starting values that would allow the routine to run entirely!&nbsp; The error I would get after fitting the limited number of voxels is:&nbsp; 

"Error in approx(x, fx, n = 2 * n.pts + 1) : 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; need at least two non-NA values to interpolate"

I think the error is from the library Bolstad since I'm using the sintegral function as part of the fitting equation.&nbsp; I've tried numerous nonlinear functions including: nlm, optim and nlminb, but all stop after performing the fit on a limited number of voxels.&nbsp; I took the values for which the fitting routine stops and I applied different starting values to them and it works!&nbsp; I'm still using the same voxel/parameter values and I am sure they are not NA values as per the error!

Ok, I think the problem is clear.&nbsp; any solutions?&nbsp; I am new to this complex world of statistical analysis.
Your help is very very much appreciated. 

Thanks,
Ayman

Montreal Neurological Institute
Montreal, Canada



      
	[[alternative HTML version deleted]]

