Hello,

 

            I hope this doesn't turn into a statistics question but here I
go. I am using the nls function with a Gaussian distribution, see coding
below. When I run the nls I get an error back saying that I have a linear
gradient. I then, of course am unable to do anything else. The data that I
am using are intensity values from some mass spectrometry data. Is there
something I can do to stop the linear gradient, and I dare to ask why am I
getting a linear gradient. I apologies if I haven't supplied enough
information or I have made some mistake in my coding. The coding below works
on some of the data but not all.

 

            Thank you for your time,

            

            Paul Benton

 

brseq <- seq(-4.0, 4.0, by=0.1)

AB<- A[,1]/A[,2]

lgAB<-log(AB)

freq_AB <-hist(lgAB, type="o", breaks=brseq, plot=F

freq.tab <- as.data.frame(cbind(brseq, freq_AB$counts)

class(fo <- (x ~ (A/(sig*sqrt(2*pi)))* exp(-1*((bin-mu)^2/(2* sig^2)))))

nls.AB <- nls(fo,data=freq.tab, start= list(A=0.1*len, mu=0.01, sig=0.5),
trace=TRUE)

 

 

Research Technician

Mass Spectrometry

   o The

  /

o Scripps

  \

   o Research

  /

o Institute

 


	[[alternative HTML version deleted]]

