View source: R/approx.hotelling.diff.test.R
spectrum0.mvar | R Documentation |
coda
's spectrum0.ar()
.Its return value, divided by nrow(cbind(x))
, is the estimated
variance-covariance matrix of the sampling distribution of the mean
of x
if x
is a multivatriate time series with AR(p
) structure, with
p
determined by AIC.
spectrum0.mvar(
x,
order.max = NULL,
aic = is.null(order.max),
tol = .Machine$double.eps^0.5,
...
)
x |
a matrix with observations in rows and variables in columns. |
order.max |
maximum (or fixed) order for the AR model. |
aic |
use AIC to select the order (up to |
tol |
tolerance used in detecting multicollinearity. See Note below. |
... |
additional arguments to |
A square matrix with dimension equalling to the number of
columns of x
, with an additional attribute "infl"
giving the
factor by which the effective sample size is reduced due to
autocorrelation, according to the Vats, Flegal, and Jones (2015)
estimate for ESS.
ar()
fails if crossprod(x)
is singular. This is
is remedied as follows:
Standardize the variables.
Use the eigenvectors to map the variables onto their principal components.
Use the eigenvalues to standardize the principal components.
Drop those components whose standard deviation differs from 1 by more than tol
. This should filter out redundant components or those too numerically unstable.
Call ar()
and calculate the variance.
Reverse the mapping in steps 1-4 to obtain the variance of the original data.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.