Thanks. I will do a trial first. Also, is it okay to have the datasets that
have only part of the cycle, or better to have equal or more than one
cycle? That is to say, I cannot have the complete datasets sometimes.

On Tue, Jun 20, 2017 at 7:37 PM, Don Cohen <don-r-h...@isis.cs3-inc.com>
wrote:

>
> If you know the period and want to fit phase and amplitude, this is
> equivalent to fitting a * sin + b * cos
>
>  > >>> > I don't know how to set the approximate starting values.
>
> I'm not sure what you meant by that, but I suspect it's related to
> phase and amplitude.
>
>  > >>> > Besides, does the method work for sine curve as well?
>
> sin is the same as cos with a different phase
> Any combination of a and b above = c * sin (theta + d) for
> some value of c and d and = e * cos (theta + f) for some value
> of e and f.
> Also for any c,d and for any e,f there is an a,b.
> the c and e are what I'm calling amplitude, the d and f are what
> I'm calling phase.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to