Description Usage Arguments Details Value References Examples
Calculate the variance of the mean with the spectrum at zero estimator.
1 2 |
x |
A numeric vector. |
type |
A character string denoting the method to use in estimating the spectral density function |
lag.prewhite |
Prewhite the serie before analysis (integer or NULL, i.e. automatic selection) |
This is a wrapper around spectrum0.ar from the CODA package and mcsefrom the mcmcse package.
The variance estimator.
Plummer, Martyn, et al. "CODA: Convergence diagnosis and output analysis for MCMC." R news 6.1 (2006): 7-11.
D.B. Percival and A. Walden "Spectral Analysis for Physical Applications: Multitaper and Conventional Univariate Techniques". Cambridge University Press (1993).
Barbour, A. J. and R. L. Parker (2014), "psd: Adaptive, sine multitaper power spectral density estimation for R", Computers & Geosciences Volume 63 February 2014 : 1-8
James M. Flegal, John Hughes and Dootika Vats. (17-08-2015). mcmcse: Monte Carlo Standard Errors for MCMC. R package version 1.1-2. Riverside, CA and Minneapolis, MN.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | n = 1000
ar = 0.9
mean = 1
sd = 1
set.seed(1234)
x = as.vector(arima.sim(n = n, list(ar = ar), sd = sd) + mean)
nse.spec0(x = x, type = "ar", lag.prewhite = 0)
nse.spec0(x = x, type = "ar", lag.prewhite = 1)
nse.spec0(x = x, type = "ar", lag.prewhite = NULL)
nse.spec0(x = x, type = "glm", lag.prewhite = 0)
nse.spec0(x = x, type = "glm", lag.prewhite = 1)
nse.spec0(x = x, type = "glm", lag.prewhite = NULL)
nse.spec0(x = x, type = "wosa", lag.prewhite = 0)
nse.spec0(x = x, type = "wosa", lag.prewhite = 1)
nse.spec0(x = x, type = "wosa", lag.prewhite = NULL)
nse.spec0(x = x, type = "bartlett", lag.prewhite = 0)
nse.spec0(x = x, type = "bartlett", lag.prewhite = 1)
nse.spec0(x = x, type = "bartlett", lag.prewhite = NULL)
nse.spec0(x = x, type = "tukey", lag.prewhite = 0)
nse.spec0(x = x, type = "tukey", lag.prewhite = 1)
nse.spec0(x = x, type = "tukey", lag.prewhite = NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.