Fits Three Parameter Harmonic Regression

Description

Estimates A, B and f in the harmonic regression, y(t)=mu+A*cos(2*pi*f*t)+B*sin(2*pi*f*t)+e(t) using LS.

Usage

1
FitHReg(y, t = 1:length(y), nf=150)

Arguments

y

series

t

time points

nf

nf, number of frequencies to enumerate

Details

Program is interfaced to C for efficient computation.

Value

Object of class "HReg" produced. This is a list with components: 'coefficients', 'residuals', 'Rsq', 'fstatistic', 'sigma', 'freq', 'LRStat' corresponding to the 3 regression coefficients, residuals, R-squared, F-statistic, residual sd, optimal frequency and LR-test statistic for null hypothesis white noise.

References

Islam, M.S. (2008). Peridocity, Change Detection and Prediction in Microarrays. Ph.D. Thesis, The University of Western Ontario.

See Also

GetFitHReg

Examples

1
2
z<-SimulateHReg(10, f=2.5/10, 1, 2)
FitHReg(z)