gharmonic: harmonic analysis test: g-value calculation

Description Usage Arguments Value References See Also Examples

View source: R/gharmonic.R

Description

This function calculates the g-value for the harmonic analysis test developed by R.A. Fisher (1929). Harmonic analysis refers to Fast Fourier Transform (FFT) results. Specifically, g is the proportion (squared modulus of one frequency divided by the sum of all squared moduli). In order for g to be statistically significant in the harmonic analysis test, it needs to be at least g-value at significance level α. Please note that for the rth largest frequency, if any of the previous (r-1) frequencies is not significant, then the rth largest frequency is also non-significant.

Usage

1
gharmonic(n, r, p, tol = 10^-7, init = NULL)

Arguments

n

the total number of frequencies in FFT results.

r

the modulus of the tested frequency is ranked as the rth largest among all frequencies.

p

the FFT result of the tested frequency expressed as the squared modulus divided by the sum of the squared moduli by all frequencies (proportion: m_r^2/(m_1^2+...+m_n^2)).

tol

the tolerance level during calculation. The default is 10^-7.

init

the crude estimate for g-value if known. It is not called to calculate usual g-values.

Value

The g-value calculated by the harmonic test.

References

Fisher, R. A. (1929). Tests of significance in harmonic analysis. Proceedings of the Royal Society of London. Series A, 125(796), 54-59.

See Also

pharmonic

Examples

1
gharmonic(n=100,r=1,p=0.05)

PML documentation built on Feb. 12, 2020, 1:17 a.m.