Relating Spectral Density to Chi-Square distribution
I had some confusion regarding what function too use in order too relate
results from spec.pgram() too a chi-square distribution. The documentation
indicates that the PSD estimate can be approximated by a chi-square
distribution with 2 degrees of freedom, but I am having trouble figuring out
how to do it in R, and figuring out what specifically that statement in the
documentation means. I have very little exposure to distribution functions
I have started with a signal that is simply a sine function, with a visible
periodicity within the nyquist range.
>a <- sin(2*pi *(0:127)/16)
I then get the raw power spectrum using, for instance:
>PSD <- spec.pgram(a, spans=NULL, detrend=F)
Next I did a search for information on chi-square.
. provided a list of potentials, of which Chisquare() seemed to fit because
it mentioned the distribution.
. provided the documentation, which shows four functions and their
descriptions. I've assumed that I need too use dchisq() for my purposes, so
that the fitted distribution would be: [assuming the power returned by
spec.pgram() ARE regarded as quantiles.]
Please clarify how to fit the PSD estimate to a chi-square distribution and
any transforms that may be needed to get the quantiles from the PSD. Is what
I tried what the documentation 'had in mind' when it says "df: The
distribution of the spectral density estimate can be approximated by a chi
square distribution with 'df' degrees of freedom." ? If so, what is the
appropriate function call too use (pchisq(), dchisq(), or qchisq())? If not,
what function should I consider?