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

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

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

                                        Spatial simultaneous autoregressive lag model estimation
                                         空间的同时自回归滞后模型的估计

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

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

Maximum likelihood estimation of spatial simultaneous autoregressive lag and spatial Durbin (mixed) models of the form:
最大似然估计的空间的同时自回归滞后和空间的德宾(混合)模型的形式:

where rho is found by optimize() first, and beta and other parameters by generalized least squares subsequently (one-dimensional search using optim performs badly on some platforms). In the spatial Durbin (mixed) model, the spatially lagged independent variables are added to X. Note that interpretation of the fitted coefficients should use impact measures, because of the feedback loops induced by the data generation process for this model. 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.
其中rhooptimize()第一,和beta和其他参数的广义最小二乘随后(在某些平台上的一维搜索使用Optim表现不好)。在空间杜宾(混合)模型,已加入的空间滞后的独立变量X.请注意,应使用以拟合系数影响措施,因为诱导由数据生成的方法,该模型的反馈回路。稀疏矩阵的方法之一,可以处理大量的观察,但时设置的权重也不行标准化interval=参数可能需要。


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


lagsarlm(formula, data = list(), listw,
        na.action, type="lag", 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可能是子集。


参数:type
default "lag", may be set to "mixed"; when "mixed", the lagged intercept is dropped for spatial weights style "W", that is row-standardised weights, but otherwise included
可设置为默认的“滞后”,“混合”,“混合”,滞后的截距风格的空间权重“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 or Matrix packages 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”,或对称的相似性风格“W”和“S”,使用代码包的垃圾邮件或矩阵计算行列式(条例“,1975年,附录C)如果可能的话,”黑客帝国“和“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 (default) assign NA - causing lagsarlm() to terminate with an error
默认为空,请使用全局选项的值,如果是TRUE分配了零的滞后值的区域没有邻居,如果为FALSE(默认值)指定NA  - 导致lagsarlm()终止错误


参数: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; the use of trs is recommended
默认为空,如果供电的空间权重矩阵的迹输出的向量trW;时,插入到数字的近似值,而不是黑森州的渐近分析值,可用于解决一些问题时提出数值的Hessian矩阵很差空调,产生NaN的,在随后的操作中;建议使用的trs


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


Details

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

The asymptotic standard error of rho 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, and with the elements involving rho 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.
rho的渐近标准误差仅计算方法特征,因为完整的矩阵运算将付出高昂的代价大的n的选择通常与“垃圾邮件”或“黑客帝国”的方法。这同样适用于系数的协方差矩阵。从文献的渐近矩阵取为,它通常是严重缩放,并与元件涉及rho是非常小的,而其他部分的矩阵,可以是非常大的(往往许多差异中的数量级的订单)。经常发生的tol.solve参数需要设置一个默认的值小于或RHS变量可以集中或缩小范围内。

Versions of the package from 0.4-38 include numerical Hessian values where asymptotic standard errors are not available. This change has been introduced to permit the simulation of distributions for impact measures. The warnings made above with regard to variable scaling also apply in this case.
从0.4-38版本的软件包,包括数值的Hessian的渐近标准误差值不可用。这种变化已被引入到允许模拟的分布影响的措施。可变标定方面与上面提出的警告也适用于这种情况。

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
"lag" or "mixed"
“滞后”或“混合”


参数:rho
simultaneous autoregressive lag coefficient
同时自回归滞后系数


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


参数:rest.se
asymptotic standard errors if ase=TRUE, otherwise approximate numeriacal Hessian-based values
如果ASE = TRUE,否则近似numeriacal的黑森州基于值的渐近标准误差


参数: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 rho=0
对数似然的线性模型rho=0


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


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


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


参数:residuals
GLS residuals
GLS残差


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


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


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


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


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


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


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


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


参数:rho.se
if ase=TRUE, the asymptotic standard error of rho, otherwise approximate numeriacal Hessian-based value
如果ASE = TRUE,rho,否则近似numeriacal的黑森州基于价值的渐近标准误差


参数:LMtest
if ase=TRUE, the Lagrange Multiplier test for the absence of spatial autocorrelation in the lag model residuals
如果ASE = TRUE,拉格朗日乘数检验的滞后模型残差的空间自相关的情况下,


参数:resvar
the asymptotic coefficient covariance matrix for (s2, rho, B)
渐近系数的协方差矩阵(s2的,rho沸石,B)的


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


参数:aliased
the aliased explanatory variables (if any)
别名解释性变量(如果有的话)


参数:listw_style
the style of the spatial weights used
使用空间权重的风格


参数:interval
the line search interval used to find rho
间隔线搜索发现rho


参数:fdHess
the numerical Hessian-based coefficient covariance matrix for (rho, B) if computed
Hessian的基于系数的数值协方差矩阵(卢,B)如果计算


参数:optimHess
if TRUE and fdHess returned, optim used to calculate Hessian at optimum
如果返回TRUE和fdHess,optim用于计算黑森州在最佳


参数:insert
if TRUE and fdHess returned, the asymptotic analytical values are inserted into the numerical Hessian instead of the approximated values, and its size increased to include the first row/column for sigma2
,如果TRUE和fdHess返回,渐近分析值的数值的Hessian矩阵的近似的值,而不是插入,和它的大小增加至包括第一行/列sigma2


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


参数:timings
processing timings
处理时序


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

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


控制参数----------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()(默认值=平方根的双精密机械公差,一个较大的根可用于需要的信息,请参阅帮助(波士顿)的一个例子)




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来计算黑森州在最佳




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>, with thanks to Andrew
Bernat for contributions to the asymptotic standard error code.



参考文献----------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, errorsarlm,  eigenw,  predict.sarlm, impacts.sarlm, residuals.sarlm, do_ldet
lm,errorsarlm,eigenw,predict.sarlm,impacts.sarlm,residuals.sarlm,do_ldet


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


data(oldcol)
COL.lag.eig <- lagsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), method="eigen", quiet=FALSE)
summary(COL.lag.eig, correlation=TRUE)
COL.lag.eig$fdHess
COL.lag.eig$resvar
W <- as(as_dgRMatrix_listw(nb2listw(COL.nb)), "CsparseMatrix")
trMatc <- trW(W, type="mult")
COL.lag.eig1 <- lagsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), control=list(fdHess=TRUE), trs=trMatc)
COL.lag.eig1$fdHess
system.time(COL.lag.M <- lagsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb), method="Matrix", quiet=FALSE))
summary(COL.lag.M)
impacts(COL.lag.M, listw=nb2listw(COL.nb))
## Not run: [#不运行:]
system.time(COL.lag.sp <- lagsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb), method="spam", quiet=FALSE))
summary(COL.lag.sp)

## End(Not run)[#(不执行)]
COL.lag.B <- lagsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="B"))
summary(COL.lag.B, correlation=TRUE)
COL.mixed.B <- lagsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="B"), type="mixed", tol.solve=1e-9)
summary(COL.mixed.B, correlation=TRUE)
COL.mixed.W <- lagsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
nb2listw(COL.nb, style="W"), type="mixed")
summary(COL.mixed.W, correlation=TRUE)
NA.COL.OLD <- COL.OLD
NA.COL.OLD$CRIME[20:25] <- NA
COL.lag.NA <- lagsarlm(CRIME ~ INC + HOVAL, data=NA.COL.OLD,
nb2listw(COL.nb), na.action=na.exclude,
control=list(tol.opt=.Machine$double.eps^0.4))
COL.lag.NA$na.action
COL.lag.NA
resid(COL.lag.NA)
data(boston)
gp2mM <- lagsarlm(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) +
I(RM^2) +  AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B + log(LSTAT),
data=boston.c, nb2listw(boston.soi), type="mixed", method="Matrix")
summary(gp2mM)
W <- as(as_dgRMatrix_listw(nb2listw(boston.soi)), "CsparseMatrix")
trMatb <- trW(W, type="mult")
gp2mMi <- lagsarlm(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) +
I(RM^2) +  AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B + log(LSTAT),
data=boston.c, nb2listw(boston.soi), type="mixed", method="Matrix",
trs=trMatb)
summary(gp2mMi)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-18 01:50 , Processed in 0.028545 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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