RPhaseToAB: Convert harmonic regression parameters to R*cos(2*pi*f*t+phi)...

Description Usage Arguments Value Author(s) Examples

Description

The harmonic regression is usually fitted as z(t) = mu + A*cos(2*pi*f*t) + B*sin(2*pi*f*t) but is more meaningfully expressed as z(t) = mu + R*cos(2*pi*f*t + phi), where R and phi are the amplitude and phase. This function converts the parameters in the R-phase form to the AB form.

Usage

1
RPhaseToAB(RPhi)

Arguments

RPhi

Vector containing the R and phi coefficients respectively.

Value

vector c(A, B)

Author(s)

Yuanhao Lai and A. I. McLeod

Examples

1
2
3
#check by back-transform
harper:::RPhaseToAB(harper:::ABToRPhase(c(-4.205,1.075)))
                                                        

CliffordLai/harper documentation built on May 8, 2019, 1:53 p.m.