找回密码
 注册
查看: 773|回复: 0

R语言 spdep包 errorsarlm()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 14:37:19 | 显示全部楼层 |阅读模式
errorsarlm(spdep)
errorsarlm()所属R语言包:spdep

                                        Spatial simultaneous autoregressive error model estimation
                                         空间的同时自回归误差模型估计

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Maximum likelihood estimation of spatial simultaneous autoregressive error models of the form:
最大似然估计的空间同时自回归误差模型的形式:

where lambda is found by optimize() first, and beta and other parameters by generalized least squares subsequently. With one of the sparse matrix methods, larger numbers of observations can be handled, but the interval= argument may need be set when the weights are not row-standardised.
其中lambda optimize()第一,和beta和其他参数的广义最小二乘随后发现。稀疏矩阵的方法之一,可以处理大量的观察,但时设置的权重也不行标准化interval=参数可能需要。


用法----------Usage----------


errorsarlm(formula, data=list(), listw, na.action, etype="error",
method="eigen", quiet=NULL, zero.policy=NULL,
interval = NULL, tol.solve=1.0e-10, trs=NULL, control=list())



参数----------Arguments----------

参数:formula
a symbolic description of the model to be fit. The details  of model specification are given for lm()
一个象征性的模型来描述是合适的。型号规格的细节给予lm()


参数:data
an optional data frame containing the variables in the model.  By default the variables are taken from the environment which the function  is called.
一个可选的数据框包含在模型中的变量。默认情况下,变量的环境,被调用的函数。


参数:listw
a listw object created for example by nb2listw
例如创建一个listw对象的nb2listw


参数:na.action
a function (default options("na.action")), can also be na.omit or na.exclude with consequences for residuals and fitted values - in these cases the weights list will be subsetted to remove NAs in the data. It may be necessary to set zero.policy to TRUE because this subsetting may create no-neighbour observations. Note that only weights lists created without using the glist argument to nb2listw may be subsetted.
一个函数(默认options("na.action")),也可以是na.omit或na.exclude残差和拟合值与后果 - 在这些情况下,将子集的权重列表中删除NAS的数据。这可能是必要的设置为TRUE zero.policy子集,因为这可能创建没有邻居观测。需要注意的是只重列表创建时没有使用的glist的参数nb2listw可能是子集。


参数:etype
default "error", may be set to "emixed" to include the spatially lagged independent variables added to X; when "emixed", the lagged intercept is dropped for spatial weights style "W", that is row-standardised weights, but otherwise included
默认的“错误”,可以被设置为的“emixed”包括的空间滞后独立变量附加到X上;当“emixed”,滞后的截距被丢弃的空间权重式的“W”,即是行标准化的权重,但包括在其他


参数:method
"eigen" (default) - the Jacobian is computed as the product  of (1 - rho*eigenvalue) using eigenw, and "spam" or "Matrix_J" for strictly symmetric weights lists of styles "B" and "C", or made symmetric by similarity (Ord, 1975, Appendix C) if possible for styles "W" and "S", using code from the spam package or Matrix package to calculate the determinant; “Matrix” and “spam_update” provide updating Cholesky decomposition methods; "LU" provides an alternative sparse matrix decomposition approach. In addition, there are "Chebyshev" and Monte Carlo "MC" approximate log-determinant methods; the Smirnov/Anselin (2009) trace approximation is available as "moments".
“本征”(默认) - 雅可比计算的产品(1  -  RHO *特征值)eigenw“和”垃圾邮件“或”Matrix_J“严格对称的权重列表样式”B“和“C”,或对称的相似性(条例“,1975年,附录C)如果可能的样式”W“和”S“垃圾包或矩阵代码包,使用计算行列式;黑客帝国“和”spam_update“提供更新Cholesky分解的方法,”LU“提供了另一种稀疏矩阵分解的方法。此外,有“切比雪夫”蒙地卡罗“MC”近似数行列式的方法,是“瞬间”的斯米尔诺夫/ Anselin(2009)的跟踪近似。


参数:quiet
default NULL, use !verbose global option value; if FALSE, reports function values during optimization.
默认为空!详细,使用全局选项值报告;如果为FALSE,函数值在优化过程中。


参数:zero.policy
default NULL, use global option value; if TRUE assign zero to the lagged value of zones without  neighbours, if FALSE assign NA - causing errorsarlm() to terminate with an error
默认为空,请使用全局选项的值,如果是TRUE分配了零的滞后值的区域没有邻居,如果为FALSE分配NA  - 导致errorsarlm()终止与错误


参数:interval
default is NULL, search interval for autoregressive parameter
默认值是NULL,搜索的时间间隔自回归参数


参数:tol.solve
the tolerance for detecting linear dependencies in the columns of matrices to be inverted - passed to solve() (default=1.0e-10). This may be used if necessary to extract coefficient standard errors (for instance lowering to 1e-12), but errors in solve() may constitute indications of poorly scaled variables: if the variables have scales differing much from the autoregressive coefficient, the values in this matrix may be very different in scale, and inverting such a matrix is analytically possible by definition, but numerically unstable; rescaling the RHS variables alleviates this better than setting tol.solve to a very small value
检测线性依赖关系被倒置的矩阵中的列 - 通过solve()(默认= 1.0E-10)的公差。这可以用来如果要提取的系数的标准误差(例如降低到1e-12),但错误在solve()可能构成缩放差变量的指示:如果变量多不同的尺度从自回归系数,此矩阵中的值可能是非常不同的规模,和反相这样一个矩阵分析可以通过定义,但数值不稳定;重新缩放的RHS变量缓解这一优于设置tol.solve到一个非常小的值


参数:trs
default NULL, if given, a vector of powered spatial weights matrix traces output by trW; when given, insert the asymptotic analytical values into the numerical Hessian instead of the approximated values; may be used to get around some problems raised when the numerical Hessian is poorly conditioned, generating NaNs in subsequent operations. When using the numerical Hessian to get the standard error of lambda, it is very strongly advised that trs be given, as the parts of fdHess corresponding to the regression coefficients are badly approximated, affecting the standard error of lambda; the coefficient correlation matrix is unusable
默认为空,如果供电的空间权重矩阵的迹输出的向量trW;时,插入到数字的近似值,而不是黑森州的渐近分析值,可用于解决一些问题时提出数值Hessian是很难空调,在后续操作中产生NaN的。当使用的数值的Hessian矩阵得到的标准误差的lambda,它是非常强烈建议的trs给予,作为fdHess份的相应于回归系数的严重近似,影响的标准误差的lambda;相关系数矩阵是不可用的


参数:control
list of extra control arguments - see section below
额外的控制参数列表 - 见下文


Details

详细信息----------Details----------

The asymptotic standard error of lambda is only computed when method=eigen, because the full matrix operations involved would be costly for large n typically associated with the choice of method="spam" or "Matrix".  The same applies to the coefficient covariance matrix. Taken as the asymptotic matrix from the literature, it is typically badly scaled, being block-diagonal, and with the elements involving lambda being very small, while other parts of the matrix can be very large (often many orders of magnitude in difference). It often happens that the tol.solve argument needs to be set to a smaller value than the default, or the RHS variables can be centred or reduced in range.
lambda的渐近标准误差仅计算方法特征,因为完整的矩阵运算将付出高昂的代价大的n的选择通常与“垃圾邮件”或“黑客帝国”的方法。这同样适用于系数的协方差矩阵。从文献中的渐近矩阵取为,它通常是严重缩放,块的对角,并与元件涉及lambda是非常小的,而其他部分的矩阵,可以是非常大(通常许多量级在差异)。经常发生的tol.solve参数需要设置一个默认的值小于或RHS变量可以集中或缩小范围内。

Note that the fitted() function for the output object assumes that the response  variable may be reconstructed as the sum of the trend, the signal, and the noise (residuals). Since the values of the response variable are known, their spatial lags are used to calculate signal components (Cressie 1993, p. 564). This differs from other software, including GeoDa, which does not use knowledge of the response  variable in making predictions for the fitting data.
需要注意的是拟合()函数的输出对象的假定响应变量可重构的趋势,所述信号的总和,和噪声(残差)。由于响应变量的值是已知的,它们的空间被用来计算滞后的信号分量(经验Cressie 1993年,第564页)。这不同于其他软件,包括GeoDa,其中不使用的响应变量知识为嵌合的数据进行预测。


值----------Value----------

A list object of class sarlm
一个List对象的类sarlm


参数:type
"error"
“错误”


参数:lambda
simultaneous autoregressive error coefficient
同时自回归误差系数


参数:coefficients
GLS coefficient estimates
GLS估计系数


参数:rest.se
GLS coefficient standard errors (are equal to asymptotic standard errors)
GLS系数的标准误(等于渐近标准误差)


参数:LL
log likelihood value at computed optimum
对数似然值计算最佳


参数:s2
GLS residual variance
GLS剩余方差


参数:SSE
sum of squared GLS errors
总和平方GLS错误的


参数:parameters
number of parameters estimated
估计的参数的数量


参数:logLik_lm.model
Log likelihood of the linear model for lambda=0
对数似然的线性模型lambda=0


参数:AIC_lm.model
AIC of the linear model for lambda=0
AIC的线性模型lambda=0


参数:coef_lm.model
coefficients of the linear model for lambda=0
系数的线性模型lambda=0


参数:tarX
model matrix of the GLS model
GLS模型的模型矩阵


参数:tary
response of the GLS model
GLS模型的响应


参数:y
response of the linear model for lambda=0
响应的线性模型lambda=0


参数:X
model matrix of the linear model for lambda=0
模型矩阵的线性模型lambda=0


参数:method
the method used to calculate the Jacobian
所使用的方法来计算的雅可比


参数:call
the call used to create this object
用于创建此对象的调用


参数:residuals
GLS residuals
GLS残差


参数:opt
object returned from numerical optimisation
返回的对象从数值优化


参数:fitted.values
Difference between residuals and response variable
残差和响应变量之间的差异


参数:ase
TRUE if method=eigen
TRUE如果方法特征


参数:se.fit
Not used yet
尚未使用


参数:lambda.se
if ase=TRUE, the asymptotic standard error of lambda
如果ASE = TRUE,渐近标准误差lambda


参数:LMtest
NULL for this model
这种模式为NULL


参数:aliased
if not NULL, details of aliased variables
如果不为NULL,细节的别名变量


参数:LLNullLlm
Log-likelihood of the null linear model
空的线性模型的对数似然


参数:Hcov
Spatial DGP covariance matrix for Hausman test if available
空间的DGP协方差矩阵Hausman检验,如果有


参数:interval
line search interval
网上搜索的时间间隔


参数:fdHess
finite difference Hessian
有限差分黑森州


参数:optimHess
optim or fdHess used
optim或fdHess使用


参数:insert
logical; is TRUE, asymptotic values inserted in fdHess where feasible
TRUE,渐近值逻辑;在可行的情况下,插入fdHess


参数:timings
processing timings
处理时序


参数:zero.policy
zero.policy for this model
zero.policy此模型


参数:na.action
(possibly) named vector of excluded or omitted observations if non-default na.action argument used
(可能)命名为向量的排除或省略的观察,如果使用非默认na.action参数

The internal sar.error.* functions return the value of the log likelihood function at lambda.
的内部sar.error。*函数返回值的对数似然函数lambda。


控制参数----------Control arguments----------




tol.opt: the desired accuracy of the optimization - passed to optimize() (default=square root of double precision machine tolerance, a larger root may be used needed, see help(boston) for an example)
tol.opt所需的精度的优化 - 通过optimize()(默认值=平方根的双精密机械公差,一个较大的根可用于需要的信息,请参阅帮助(波士顿)的一个例子)




returnHcov: default TRUE, return the Vo matrix for a spatial Hausman test
returnHcov:默认为true,则返回武矩阵空间Hausman检验




pWOrder: default 250, if returnHcov=TRUE and the method is not “eigen”, pass this order to powerWeights as the power series maximum limit
所有pWOrder:250,如果returnHcov = TRUE,该方法是“本征”,通过这个以powerWeights为动力系列最高限额




fdHess: default NULL, then set to (method != "eigen") internally; use fdHess to compute an approximate Hessian using finite differences when using sparse matrix methods; used to make a coefficient covariance matrix when the number of observations is large; may be turned off to save resources if need be
(方法=“特征”)fdHess:默认为空,则设置为内部,使用fdHess计算近似Hessian的使用稀疏矩阵的方法用有限差分时,使用系数协方差矩阵的当数观察大;可能会被关闭,以节约资源,如果需要的话




optimHess: default FALSE, use fdHess from nlme, if TRUE, use optim to calculate Hessian at optimum
optimHess:默认为false,使用fdHessnlme,如果为TRUE,使用optim来计算黑森州在最佳




LAPACK: default FALSE; logical value passed to qr in the SSE log likelihood function
LAPACK:默认为false;逻辑值传递给qr在上证所数似然函数




compiled_sse: default FALSE; logical value used in the log likelihood function to choose compiled code for computing SSE
逻辑值,用于对数似然函数来选择编译代码的计算上证compiled_sse:默认为false;




Imult: default 2; used for preparing the Cholesky decompositions for updating in the Jacobian function
IMULT:默认的Cholesky分解更新的雅可比函数准备




super: if NULL (default), set to FALSE to use a simplicial decomposition for the sparse Cholesky decomposition and method “Matrix_J”, set to  as.logical(NA) for method “Matrix”, if TRUE, use a supernodal decomposition
超:如果NULL(默认值),设置为FALSE稀疏Cholesky分解和方法“Matrix_J”,设置为as.logical(NA)方法“黑客帝国”,如果使用的单纯分解TRUE,使用supernodal的分解




cheb_q: default 5; highest power of the approximating polynomial for the Chebyshev approximation
cheb_q 5:默认情况下,最高功率近似多项式的切比雪夫逼近




MC_p: default 16; number of random variates
mc_P的:默认16号的随机变数




MC_m: default 30; number of products of random variates matrix and spatial weights matrix
MC_m:默认为30;随机变数矩阵和空间权重矩阵的产品




spamPivot: default “MMD”, alternative “RCM”
spamPivot:默认的“MMD”,替代“RCM”




in_coef default 0.1, coefficient value for initial Cholesky decomposition in “spam_update”
in_coef默认0.1,系数的值在初始Cholesky分解“spam_update”




type default “MC”, used with method “moments”; alternatives “mult” and “moments”, for use if trs is missing, trW
类型默认的“MC”使用方法“瞬间”替代品“多个”和“时刻”,为使用trs的丢失,trW




correct default TRUE, used with method “moments” to compute the Smirnov/Anselin correction term
正确的默认TRUE,用于计算的斯米尔诺夫/ Anselin修正项的方法“瞬间”




trunc default TRUE, used with method “moments” to truncate the Smirnov/Anselin correction term
TRUNC默认为true,使用方法“瞬间”截断斯米尔诺夫/ Anselin修正项


(作者)----------Author(s)----------


Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>



----------References----------

Ord, J. K. 1975 Estimation methods for models of spatial interaction, Journal of the American Statistical Association, 70, 120-126; Anselin, L. 1988 Spatial econometrics: methods and models. (Dordrecht: Kluwer); Anselin, L. 1995 SpaceStat, a software program for the analysis of spatial data, version 1.80. Regional Research Institute, West Virginia University, Morgantown, WV (www.spacestat.com); Anselin L, Bera AK (1998) Spatial dependence in linear regression models with an introduction to spatial econometrics. In: Ullah A, Giles DEA (eds) Handbook of applied economic statistics. Marcel Dekker, New York,

参见----------See Also----------

lm, lagsarlm, similar.listw, predict.sarlm, residuals.sarlm, do_ldet
lm,lagsarlm,similar.listw,predict.sarlm,residuals.sarlm,do_ldet


实例----------Examples----------


data(oldcol)
COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="eigen", quiet=FALSE)
summary(COL.errW.eig, correlation=TRUE)
COL.errB.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="B"), method="eigen", quiet=FALSE)
summary(COL.errB.eig, correlation=TRUE)
W <- as(as_dgRMatrix_listw(nb2listw(COL.nb)), "CsparseMatrix")
trMatc <- trW(W, type="mult")
COL.errW.M <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="Matrix", quiet=FALSE, trs=trMatc)
summary(COL.errW.M, correlation=TRUE)
NA.COL.OLD <- COL.OLD
NA.COL.OLD$CRIME[20:25] <- NA
COL.err.NA <- errorsarlm(CRIME ~ INC + HOVAL, data=NA.COL.OLD,
nb2listw(COL.nb), na.action=na.exclude)
COL.err.NA$na.action
COL.err.NA
resid(COL.err.NA)
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="eigen"))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="eigen", control=list(LAPACK=TRUE)))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="eigen", control=list(compiled_sse=TRUE)))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="Matrix_J", control=list(super=TRUE)))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="Matrix_J", control=list(super=FALSE)))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="Matrix_J", control=list(super=as.logical(NA))))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="Matrix", control=list(super=TRUE)))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="Matrix", control=list(super=FALSE)))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="Matrix", control=list(super=as.logical(NA))))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="spam", control=list(spamPivot="MMD")))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="spam", control=list(spamPivot="RCM")))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="spam_update", control=list(spamPivot="MMD")))
system.time(COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="spam_update", control=list(spamPivot="RCM")))
COL.merrW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="eigen", etype="emixed")
summary(COL.merrW.eig, correlation=TRUE)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-17 22:22 , Processed in 0.021904 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表