weightsLumley(sandwich)
weightsLumley()所属R语言包:sandwich
Weighted Empirical Adaptive Variance Estimation
加权经验自适应方差估计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A set of functions implementing a class of kernel-based heteroskedasticity and autocorrelation consistent (HAC) covariance matrix estimators as introduced by Andrews (1991).
一组功能,实现一类基于内核的异方差和自相关一致(HAC)推出的安卓(1991)的协方差矩阵估计。
用法----------Usage----------
weave(x, order.by = NULL, prewhite = FALSE, C = NULL,
method = c("truncate", "smooth"), acf = isoacf, adjust = FALSE,
diagnostics = FALSE, sandwich = TRUE, tol = 1e-7, data = list(), ...)
weightsLumley(x, order.by = NULL, C = NULL,
method = c("truncate", "smooth"), acf = isoacf, tol = 1e-7, data = list(), ...)
参数----------Arguments----------
参数:x
a fitted model object.
拟合模型对象。
参数:order.by
Either a vector z or a formula with a single explanatory variable like ~ z. The observations in the model are ordered by the size of z. If set to NULL (the default) the observations are assumed to be ordered (e.g., a time series).
无论是向量z或用一个公式解释变量,如~ z。在模型中的观测是有序的的大小z。如果设置为NULL(默认值)观测值进行排序(例如,时间序列)。
参数:prewhite
logical or integer. Should the estimating functions be prewhitened? If TRUE or greater than 0 a VAR model of order as.integer(prewhite) is fitted via ar with method "ols" and demean = FALSE.
逻辑或整数。应该估计功能是prewhitened的吗?如果TRUE或大于0的VAR模型订单as.integer(prewhite)安装通过ar的方法"ols"和demean = FALSE。
参数:C
numeric. The cutoff constant C is by default 4 for method "truncate" and 1 for method "smooth".
数字。截止不变C默认情况下是4的方法"truncate"和1的方法"smooth"。
参数:method
a character specifying the method used, see details.
一个字符指定所使用的方法,查看详细信息。
参数:acf
a function that computes the autocorrelation function of a vector, by default isoacf is used.
一个函数,计算一个矢量的自相关函数中,默认的isoacf被使用。
参数:adjust
logical. Should a finite sample adjustment be made? This amounts to multiplication with n/(n-k) where n is the number of observations and k the number of estimated parameters.
逻辑。如果一个有限的样本调整呢?这相当于乘法n/(n-k)其中n是一些意见和k估计参数的数量。
参数:diagnostics
logical. Should additional model diagnostics be returned? See vcovHAC for details.
逻辑。额外的模型诊断回来了吗?见vcovHAC的详细信息。
参数:sandwich
logical. Should the sandwich estimator be computed? If set to FALSE only the middle matrix is returned.
逻辑。三明治估计计算?如果设置为FALSE只有中间的矩阵将被返回。
参数:tol
numeric. Weights that exceed tol are used for computing the covariance matrix, all other weights are treated as 0.
数字。超过tol用于计算的协方差矩阵的权重,所有其他的权重被视为0。
参数:data
an optional data frame containing the variables in the order.by model. By default the variables are taken from the environment which the function is called from.
一个可选的数据框包含order.by模型中的变量。默认情况下,变量的环境中,该函数的调用。
参数:...
currently not used.
目前未使用。
Details
详细信息----------Details----------
weave is a convenience interface to vcovHAC using weightsLumley: first a weights function is defined and then vcovHAC is called.
weave是一个方便的接口vcovHAC使用weightsLumley:第一个权重函数的定义,然后vcovHAC被称为。
Both weighting methods are based on some estimate of the autocorrelation function r (as computed by acf) of the residuals of the model x. The weights for the "truncate" method are
这两种加权方法是根据一些估计,自相关函数r(计算acf)的残差的模型x。该权重"truncate"方法是
and the weights for the "smooth" method are
和"smooth"方法的权重
where n is the number of observations in the model an C is the truncation constant C.
其中n为观测值的数量模型中的一个C是截断不变的C。
Further details can be found in Lumley & Heagerty (1999).
进一步的细节可以发现,在拉姆利与Heagerty的(1999年)。
值----------Value----------
weave returns the same type of object as vcovHAC which is typically just the covariance matrix.
weave返回相同类型的对象作为vcovHAC这是典型的协方差矩阵。
weightsLumley returns a vector of weights.
weightsLumley返回一个向量的权重。
参考文献----------References----------
Weighted Empirical Adaptive Variance Estimators for Correlated Data Regression. Journal of the Royal Statistical Society B, 61, 459–477.
参见----------See Also----------
vcovHAC, weightsAndrews,
vcovHAC,weightsAndrews,
实例----------Examples----------
x <- sin(1:100)
y <- 1 + x + rnorm(100)
fm <- lm(y ~ x)
weave(fm)
vcov(fm)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|