Learn R Programming

TSSS (version 1.3.1)

unicor: Autocovariance and Autocorrelation

Description

Compute autocovariance and autocorrelation function of the univariate time series.

Usage

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

Value

An object of class "unicor" which has a plot method. This is a list with the following components:

acov

autocovariances.

acor

autocorrelations.

acov.err

error bound for autocovariances.

acor.err

error bound for autocorrelations.

mean

mean of y.

tsname

the name of the univariate time series y.

Arguments

y

a univariate time series.

lag

maximum lag. Default is \(2 \sqrt{n}\), where \(n\) is the length of the time series y.

minmax

thresholds for outliers in low side and high side.

plot

logical. If TRUE (default), autocorrelations are plotted.

...

graphical arguments passed to the plot method.

References

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

Examples

Run this code
# Yaw rate, rolling, pitching and rudder angle of a ship
data(HAKUSAN)
Yawrate <- HAKUSAN[, 1]
unicor(Yawrate, lag = 50)

# seismic data
data(MYE1F)
unicor(MYE1F, lag = 50)

Run the code above in your browser using DataLab