lrvar(sandwich)
lrvar()所属R语言包:sandwich
Long-Run Variance of the Mean
术语运行的平均方差
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Convenience function for computing the long-run variance (matrix) of a (possibly multivariate) series of observations.
从术语来看(可能是多元的)一系列的观测方差(矩阵)计算的便利功能。
用法----------Usage----------
lrvar(x, type = c("Andrews", "Newey-West"), prewhite = TRUE, adjust = TRUE, ...)
参数----------Arguments----------
参数:x
numeric vector, matrix, or time series.
数值向量,矩阵,或时间序列。
参数:type
character specifying the type of estimator, i.e., whether kernHAC for the Andrews quadratic spectral kernel HAC estimator is used or NeweyWest for the Newey-West Bartlett HAC estimator.
字符,指定类型的估计,即是否kernHAC安德鲁斯二次谱内核HAC估计使用或NeweyWest的的纽维西巴特利特HAC估计。
参数:prewhite
logical or integer. Should the series be prewhitened? Passed to kernHAC or NeweyWest.
逻辑或整数。是否应该该系列是prewhitened的?传递kernHAC或NeweyWest。
参数:adjust
logical. Should a finite sample adjustment be made? Passed to kernHAC or NeweyWest.
逻辑。如果一个有限的样本调整呢?传递kernHAC或NeweyWest。
参数:...
further arguments passed on to kernHAC or NeweyWest.
进一步的参数传递给kernHAC或NeweyWest。
Details
详细信息----------Details----------
lrvar is a simple wrapper function for computing the long-run variance (matrix) of a (possibly multivariate) series x. First, this simply fits a linear regression model x ~ 1 by lm. Second, the corresponding variance of the mean(s) is estimated either by kernHAC (Andrews quadratic spectral kernel HAC estimator) or by NeweyWest (Newey-West Bartlett HAC estimator).
lrvar是一个简单的包装函数,用于计算从长远来看方差(矩阵)(可能是多元)系列x。首先,这是符合线性回归模型x ~ 1lm。其次,相应的方差的平均值()通过估计kernHAC:(安卓二次光谱的内核HAC估计)或由NeweyWest(的纽维西巴特利特估计)HAC。
值----------Value----------
For a univariate series x a scalar variance is computed. For a
对于一个单变量序列x一个标量方差的计算方法。对于
参见----------See Also----------
kernHAC, NeweyWest, vcovHAC
kernHAC,NeweyWest,vcovHAC
实例----------Examples----------
set.seed(1)
## iid series (with variance of mean 1/n)[#IID系列(方差的均值为1 / N)]
## and Andrews kernel HAC (with prewhitening)[#安德鲁斯内核:HAC(与prewhitening中)]
x <- rnorm(100)
lrvar(x)
## analogous multivariate case with Newey-West estimator (without prewhitening)[#类似的多元与纽维方估计的情况下(不prewhitening)]
y <- matrix(rnorm(200), ncol = 2)
lrvar(y, type = "Newey-West", prewhite = FALSE)
## AR(1) series with autocorrelation 0.9[#AR(1)自相关0.9系列]
z <- filter(rnorm(100), 0.9, method = "recursive")
lrvar(z)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|