Skip to content

Error using nls function

1 message · John Fox

#
Dear David,

I'm afraid that this doesn't make much sense -- that is, I expect that 
you're not doing what you intended.

First, sin(2*pi*t) and cos(2*pi*t) are each invariant:

 > sin(2*pi*t)
  [1] -2.449294e-16 -4.898587e-16 -7.347881e-16 -9.797174e-16 
-1.224647e-15 -1.469576e-15
  [7] -1.714506e-15 -1.959435e-15 -2.204364e-15 -2.449294e-15 
-9.799650e-15 -2.939152e-15
 > cos(2*pi*t)
  [1] 1 1 1 1 1 1 1 1 1 1 1 1

Second, as formulated the model is linear in the parameters.

I hope this helps,
John

John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/
On 2021-03-26 8:31 a.m., David E.S. wrote: