Re: [R] nls start values

2011-12-16 Thread Nick Fankhauser
Hi! thanks a lot for this suggestion! I tried to implement it like this, and it worked nicely. I used the method suggested by Gabor Grothendieck for simplification: frml <- gene_expression ~ sin(tpoints * afreq + phase) * amp + shift gridfit <- nls2(frml, algorithm = "grid-search", data=gendat, s

Re: [R] nls start values

2011-12-13 Thread Gabor Grothendieck
On Tue, Dec 13, 2011 at 10:53 AM, Hans W Borchers wrote: > Niklaus Fankhauser cell.biol.ethz.ch> writes: > >> I'm using nls to fit periodic gene-expression data to sine waves. I need >> to set the upper and lower boundaries, because I do not want any >> negative phase and amplitude solutions. Thi

Re: [R] nls start values

2011-12-13 Thread Bert Gunter
Niklaus: 1. First, you mat not need to use nls at all, although I am not familiar with the "port" algorithm, so I could very well be wrong about this. Generally speaking, one uses time series methods (e.g. fourier analysis) to fit periodic sine waves, so you may wish to check out CRAN's TimeSerie

Re: [R] nls start values

2011-12-13 Thread Hans W Borchers
Niklaus Fankhauser cell.biol.ethz.ch> writes: > I'm using nls to fit periodic gene-expression data to sine waves. I need > to set the upper and lower boundaries, because I do not want any > negative phase and amplitude solutions. This means that I have to use > the "port" algorithm. The problem i

[R] nls start values

2011-12-11 Thread Niklaus Fankhauser
I'm using nls to fit periodic gene-expression data to sine waves. I need to set the upper and lower boundaries, because I do not want any negative phase and amplitude solutions. This means that I have to use the "port" algorithm. The problem is, that depending on what start value I choose for phase