period: Compute a Periodogram

View source: R/period.R

periodR Documentation

Compute a Periodogram

Description

Compute a periodogram of the univariate time series.

Usage

period(y, window = 1, lag = NULL, minmax = c(-1.0e+30, 1.0e+30),
       plot = TRUE, ...)

Arguments

y

a univariate time series.

window

smoothing window type. (0: box-car, 1: Hanning, 2: Hamming)

lag

maximum lag of autocovariance. If NULL (default),
window = 0 : lag = n - 1,
window > 0 : lag = 2 \sqrt{n},
where n is the length of data.

minmax

bound for outliers in low side and high side.

plot

logical. If TRUE (default), smoothed periodogram is plotted.

...

graphical arguments passed to plot.spg.

Details

Hanning Window : W_0 = 0.5 W_1 = 0.25
Hamming Window : W_0 = 0.54 W_1 = 0.23

Value

An object of class "spg", which is a list with the following components:

period

periodogram(or raw spectrum).

smoothed.period

smoothed log-periodogram. Smoothed periodogram is given if there is a negative value in the smoothed periodogram.

log.scale

if TRUE "smooth the periodogram on log scale.

tsname

the name of the univariate time series y.

References

Kitagawa, G. (2020) Introduction to Time Series Modeling with Applications in R. Chapman & Hall/CRC.

Examples

## BLSALLFOOD data
data(BLSALLFOOD)
period(BLSALLFOOD)

## seismic Data
data(MYE1F)

# smoothed periodogram 
period(MYE1F)

# periodogram
period(MYE1F, window = 0)

# raw spectrum
period(MYE1F, window = 0, lag = 200)

# Hamming window
period(MYE1F, window = 2)

TSSS documentation built on Sept. 29, 2023, 9:07 a.m.