Description Usage Arguments Value References See Also Examples
View source: R/test.harmonic.R
This function conducts harmonic test sequentially based on observations or Fast Fourier Transform (FFT) results.
1 | test.harmonic(ob, p, fft = FALSE, maxfreq = 10)
|
ob |
Either the original observation or FFT results. See parameter |
p |
The p-value to be considered statistically significant. |
fft |
If TRUE, |
maxfreq |
To conduct test on at most |
A list of two elements:
sig |
The significant frequencies plus the first insignificant frequency. |
fft |
The FFT results expressed in standardized proportions. |
Fisher, R. A. (1929). Tests of significance in harmonic analysis. Proceedings of the Royal Society of London. Series A, 125(796), 54-59.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(pa3)
#### test on individuals
ob <- do.call("c",pa3$activity[1:4])
re <- test.harmonic(ob,p=0.05/(length(ob)-1)/2)
re$sig;head(re$fft) ## no harmonic is significant
ob2 <- do.call("c",pa3$activity[11:13])
re2 <- test.harmonic(ob2,p=0.05/(length(ob2)-1)/2)
re2$sig;head(re2$fft) ## 3 significant harmonics
#### test on the population average
re0 <- bandSelect(df=pa3,Nlength=1440*3,Nlambda=100,alpha=1,Ntop=3,
cross=FALSE,Ncross=NULL,plot=TRUE)
freq <- data.frame(Frequency=re0$freq,Proportion=colMeans(re0$xprop))
re3 <- test.harmonic(freq,p=0.05/nrow(freq),fft=TRUE)
print(re3$sig,digits=3,row.names=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.