pgramFourier: Periodogram computation, Fourier method

Description Usage Arguments Details Value Author(s) Examples

Description

The periodogram is computed at either Fourier or non-Fourier frequencies

Usage

1
pgramFourier(z, numFreq = "default", demean = TRUE)

Arguments

z

time series vector of length n, say.

numFreq

use "default" for usual Fourier frequencies, 1/n, ..., floor(n/2)/n. Set fr = N, to evaluate the periodogram at the Fourier frequencies corresponding to a time series of length N. The frequencies are in cycles per unit time.

demean

whether the sample mean is subtracted from the series.

Details

Uses FFT. So if the length of z is a highly composite number, the computation is very efficient. Otherwise the usual DFT is used.

Value

Periodogram

Author(s)

A.I. McLeod and Yuanhao Lai

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
z<-sunspot.year
n<-length(z) 
I<-pgramFourier(z)
f<-I[,1]
I <- I[,2]
plot(f, I, xlab="f", ylab="f", type="l") 
title(main="Periodogram for Annual Sunpots, 1700-1988") 
#
z<-c(0.42, 0.89, 1.44, 1.98, 2.21, 2.04, 0.82, 0.62, 0.56, 0.8, 1.33)
pgramFourier(z)
ans <- pgramFourier(z, numFreq=101)
plot(ans[,1], ans[,2], type="l", xlab="frequency", ylab=
 "periodogram")
  
                                                        

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