Learn R Programming

nse (version 1.21)

nse.cos: Long-run variance estimation using low-frequency cosine series.

Description

Function which calculates the numerical standard error with low-frequency cosine weighted averages of the original serie.

Usage

nse.cos(x, q = 12, lag.prewhite = 0)

Value

The NSE estimator.

Arguments

x

A numeric vector.

q

Number of consine series.

lag.prewhite

Prewhite the series before analysis (integer or NULL). When lag.prewhite = NULL this performs automatic lag selection. Default is lag.prewhite = 0 that is no prewhitening.

Author

David Ardia and Keven Bluteau

Details

The method estimate the series with a linear regression using cosine low frequency series. It than derived the NSE from the coefficient of the cosine series (Ulrich and Watson, 2017).

References

Muller, Ulrich K., and Mark W. Watson. (2015) Low-frequency econometrics. National Bureau of Economic Research, No. w21564.

Examples

Run this code
if (FALSE) {
n    = 1000
ar   = 0.9
mean = 1
sd   = 1
set.seed(1234)
x = c(arima.sim(n = n, list(ar = ar), sd = sd) + mean)

nse.cos(x = x, q = 12, lag.prewhite = 0)
nse.cos(x = x, q = 12, lag.prewhite = NULL)
}

Run the code above in your browser using DataLab