lagmess(spdep)
lagmess()所属R语言包:spdep
Matrix exponential spatial lag model
矩阵指数空间滞后模型
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The function fits a matrix exponential spatial lag model, using optim to find the value of alpha, the spatial coefficient.
该功能适用矩阵指数的空间滞后模型,使用optim找到alpha,空间系数的价值。
用法----------Usage----------
lagmess(formula, data = list(), listw, zero.policy = NULL, na.action = na.fail, q = 10, start = -2.5, control=list(), method="BFGS", verbose=NULL)
## S3 method for class 'lagmess'
summary(object, ...)
## S3 method for class 'lagmess'
print(x, ...)
## S3 method for class 'summary.lagmess'
print(x, digits = max(5, .Options$digits - 3),
signif.stars = FALSE, ...)
## S3 method for class 'lagmess'
residuals(object, ...)
## S3 method for class 'lagmess'
deviance(object, ...)
## S3 method for class 'lagmess'
coef(object, ...)
## S3 method for class 'lagmess'
fitted(object, ...)
## S3 method for class 'lagmess'
logLik(object, ...)
参数----------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
参数: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 lagmess() to terminate with an error
默认为空,请使用全局选项的值,如果是TRUE分配了零的滞后值的区域没有邻居,如果为FALSE分配NA - 导致lagmess()终止与错误
参数: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可能是子集。
参数:q
default 10; number of powers of the spatial weights to use
默认为10;的权力使用的空间权重
参数:start
starting value for numerical optimization, should be a small negative number
从数值优化的价值,应该是一个小的负数
参数:control
control parameters passed to optim
控制参数传递给optim
参数:method
default BFGS, method passed to optim
默认BFGS,方法传递optim的
参数:verbose
default NULL, use global option value; if TRUE report function values during optimization
默认为空,请使用全局选项的值;在优化过程中如果的TRUE报告函数值
参数:x,object
Objects of classes lagmess or summary.lagmess to be passed to methods
要传递给方法的对象的类lagmess或summary.lagmess
参数:digits
the number of significant digits to use when printing
打印时所使用的数量显著位数
参数:signif.stars
logical. If TRUE, "significance stars" are printed for each coefficient.
逻辑。如果是TRUE,“意义明星”打印每个系数。
参数:...
further arguments passed to or from other methods
进一步的参数传递给其他方法
Details
详细信息----------Details----------
The underlying spatial lag model:
基础空间滞后模型:
where rho is the spatial parameter may be fitted by maximum likelihood. In that case, the log likelihood function includes the logartithm of cumbersome Jacobian term |I - rho W|. If we rewrite the model as:
其中rho是可以安装的空间参数的最大似然法。在这种情况下,对数似然函数包括logartithm的繁琐的雅可比术语|I - rho W|。如果我们重写了模型如下:
we see that in the ML case S y = (I - rho W) y. If W is row-stochastic, S may be expressed as a linear combination of row-stochastic matrices. By pre-computing the matrix [y Wy, W^2y, ..., W^{q-1}y], the term S y (alpha) can readily be found by numerical optimization using the matrix exponential approach. alpha and rho are related as rho = 1 - exp(alpha), conditional on the number of matrix power terms taken q.
我们可以看到,在ML的情况下S y = (I - rho W) y。如果W是行随机,S可表示为行随机矩阵的线性组合。通过预先计算矩阵[y Wy, W^2y, ..., W^{q-1}y],S y (alpha)可以很容易地被发现使用矩阵指数的方法,通过数值优化。 alpha和rho关系rho = 1 - exp(alpha),条件数矩阵动力方面,q。
值----------Value----------
The function returns an object of class lagmess with components:
该函数返回一个对象类lagmess组件:
参数:lmobj
the lm object returned after fitting alpha
lm返回的对象后装修alpha
参数:alpha
the spatial coefficient
空间系数
参数:alphase
the standard error of the spatial coefficient using the numerical Hessian
使用的数值的Hessian矩阵的空间系数的标准误差
参数:rho
the value of rho implied by alpha
的价值rho的alpha暗示
参数:bestmess
the object returned by optim
返回的对象optim
参数:q
the number of powers of the spatial weights used
权力的使用空间权重的数量
参数:start
the starting value for numerical optimization used
数值优化使用的起始值
参数:na.action
(possibly) named vector of excluded or omitted observations if non-default na.action argument used
(可能)命名为向量的排除或省略的观察,如果使用非默认na.action参数
参数:nullLL
the log likelihood of the aspatial model for the same data
对于相同的数据的非空间模型的对数似然
(作者)----------Author(s)----------
Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a> and Eric Blankmeyer
参考文献----------References----------
<h3>See Also</h3>
实例----------Examples----------
data(baltimore)
baltimore$AGE <- ifelse(baltimore$AGE < 1, 1, baltimore$AGE)
lw <- nb2listw(knn2nb(knearneigh(cbind(baltimore$X, baltimore$Y), k=7)))
obj1 <- lm(log(PRICE) ~ PATIO + log(AGE) + log(SQFT) + lag(lw, log(AGE)),
data=baltimore)
lm.morantest(obj1, lw)
lm.LMtests(obj1, lw, test="all")
obj2 <- lagmess(log(PRICE) ~ PATIO + log(AGE) + log(SQFT) +
lag(lw, log(AGE)), data=baltimore, listw=lw)
summary(obj2)
obj3 <- lagsarlm(log(PRICE) ~ PATIO + log(AGE) + log(SQFT) +
lag(lw, log(AGE)), data=baltimore, listw=lw)
summary(obj3)
data(boston)
lw <- nb2listw(boston.soi)
gp2 <- 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, lw, method="Matrix")
summary(gp2)
gp2a <- lagmess(CMEDV ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) + I(RM^2)
+ AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B + log(LSTAT),
data=boston.c, lw)
summary(gp2a)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|