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

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

[复制链接]
发表于 2012-9-30 15:08:43 | 显示全部楼层 |阅读模式
gwr(spgwr)
gwr()所属R语言包:spgwr

                                        Geographically weighted regression
                                         GEO加权回归

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

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

The function implements the basic geographically weighted regression approach to exploring spatial non-stationarity for given global bandwidth and chosen weighting scheme.
该函数实现了基本的GEO加权回归的方法来探索空间的非平稳性,鉴于全球带宽和选择权计划。


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


gwr(formula, data=list(), coords, bandwidth, gweight=gwr.Gauss,
        adapt=NULL, hatmatrix = FALSE, fit.points, longlat=NULL,
        se.fit=FALSE, weights, cl=NULL, predictions = FALSE,
        fittedGWRobject = NULL, se.fit.CCT = TRUE)
## S3 method for class 'gwr'
print(x, ...)



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

参数:formula
regression model formula as in lm
回归模型公式lm


参数:data
model data frame, or SpatialPointsDataFrame or SpatialPolygonsDataFrame as defined in package sp
模型的数据框,或SpatialPointsDataFrame或SpatialPolygonsDataFrame在包sp


参数:coords
matrix of coordinates of points representing the spatial positions of the observations; may be omitted if the object passed through the data argument is from package sp
矩阵的空间位置的观测点的坐标可以省略,如果通过数据参数传递的对象是从包装sp


参数:bandwidth
bandwidth used in the weighting function, possibly calculated by gwr.sel
权重函数中使用的带宽,可能计算的gwr.sel


参数:gweight
geographical weighting function, at present  gwr.Gauss() default, or gwr.gauss(), the previous default or gwr.bisquare()
GEO加权函数,目前gwr.Gauss()默认情况下,或gwr.gauss(),以前的默认或gwr.bisquare()


参数:adapt
either NULL (default) or a proportion between 0 and 1 of observations to include in weighting scheme (k-nearest neighbours)
NULL(默认)或比例介于0和1之间的观测中的权重方案,包括(k-最近邻居)


参数:hatmatrix
if TRUE, return the hatmatrix as a component of the result, ignored if fit.points given
如果为TRUE,返回结果的一个组成部分,忽略,如果fit.points给定的hatmatrix


参数:fit.points
an object containing the coordinates of fit points; often an object from package sp; if missing, the coordinates given through the data argument object, or the coords argument are used
一个对象,它包含拟合点的坐标;对象往往从包装sp;如果缺失,所表示的坐标,通过数据参数对象,或坐标参数使用


参数:longlat
TRUE if point coordinates are longitude-latitude decimal degrees, in which case distances are measured in kilometers; if x is a SpatialPoints object, the value is taken from the object itself
TRUE,如果点坐标的经纬度小数度,在这种情况下,测量距离(公里),如果x是一个SpatialPoints,对象,对象本身的价值是从


参数:se.fit
if TRUE, return local coefficient standard errors - if hatmatrix is TRUE and no fit.points are given, two effective degrees of freedom sigmas will be used to generate alternative coefficient standard errors
如果为TRUE,返回本地系数的标准误差 - 如果hatmatrix是TRUE和给出没有fit.points,两个有效程度的自由逐步改善将用于生成替代系数的标准误差


参数:weights
case weights used as in weighted least squares, beware of scaling issues, probably unsafe
使用的情况下,权重加权最小二乘,谨防扩展性问题,可能是不安全的


参数:cl
if NULL, ignored, otherwise cl must be an object describing a “cluster” created using makeCluster in the snow package. The cluster will then be used to hand off the calculation of local coefficients to cluster nodes, if fit points have been given as an argument, and hatmatrix=FALSE
如果为null,则忽略,否则cl必须是一个对象,它描述了“聚类”使用makeCluster的在雪包创建的。该聚类将被交给局部系数的计算聚类节点,如果拟合点,已经作为一个参数,和hatmatrix=FALSE


参数:predictions
default FALSE; if TRUE and no fit points given, return GW fitted values at data points, if fit points given and are a Spatial*DataFrame object containing the RHS variables in the formula, return GW predictions at the fit points
默认为false,如果为true,没有合适的点,返回GW数据点的拟合值,如果拟合点和RHS公式中的变量空间*数据框对象,其中包含的,返回GW预测在拟合点


参数:fittedGWRobject
a fitted gwr object with a hatmatrix (optional), if given, and if fit.points are given and if se.fit is TRUE, two effective degrees of freedom sigmas will be used to generate alternative coefficient standard errors
一个配备gwr对象与hatmatrix(可选),如果给定的,并且如果fit.points的,并给出了如果se.fit是TRUE时,两种有效程度的自由逐步改善将用于生成替代系数的标准误差


参数:se.fit.CCT
default TRUE, compute local coefficient standard errors using formula (2.14), p. 55, in the GWR book
默认为true,计算系数标准误差,利用公式(2.14),P。 55,在GWR书


参数:x
an object of class "gwr" returned by the gwr function
一个类的对象“GWR”返回gwr功能的


参数:...
arguments to be passed to other functions
参数被传递到其他功能


Details

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

The function applies the weighting function in turn to each of the  observations, or fit points if given, calculating a weighted regression
该函数应用于反过来每个的观察,或者如果给定的拟合点的加权函数,计算一个加权回归


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

A list of class “gwr”:
类“的名单GWR”:


参数:SDF
a SpatialPointsDataFrame (may be gridded) or SpatialPolygonsDataFrame object (see package "sp") with fit.points, weights, GWR coefficient estimates, R-squared, and coefficient standard errors in its "data" slot.
一个SpatialPointsDataFrame(可能是网格)或SpatialPolygonsDataFrame对象(见包装“SP”)与fit.points,重量,GWR系数估计值,R-平方,在其“数据”老虎系数的标准误差。


参数:lhat
Leung et al. L matrix
Leung等人。 L矩阵


参数:lm
Ordinary least squares global regression on the same model formula, as returned by lm.wfit().
普通最小二乘全球回归,在相同的模型公式,返回由lm.wfit()。


参数:bandwidth
the bandwidth used.
使用的带宽。


参数:this.call
the function call used.
所使用的函数调用。


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


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



参考文献----------References----------

Geographically Weighted Regression, Chichester: Wiley;

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

gwr.sel, gwr.gauss,
gwr.sel,gwr.gauss,


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


data(columbus)
col.lm <- lm(crime ~ income + housing, data=columbus)
summary(col.lm)
col.bw <- gwr.sel(crime ~ income + housing, data=columbus,
  coords=cbind(columbus$x, columbus$y))
col.gauss <- gwr(crime ~ income + housing, data=columbus,
  coords=cbind(columbus$x, columbus$y), bandwidth=col.bw, hatmatrix=TRUE)
col.gauss
col.d <- gwr.sel(crime ~ income + housing, data=columbus,
  coords=cbind(columbus$x, columbus$y), gweight=gwr.bisquare)
col.bisq <- gwr(crime ~ income + housing, data=columbus,
  coords=cbind(columbus$x, columbus$y), bandwidth=col.d,
  gweight=gwr.bisquare, hatmatrix=TRUE)
col.bisq
data(georgia)
g.adapt.gauss <- gwr.sel(PctBach ~ TotPop90 + PctRural + PctEld + PctFB +
PctPov + PctBlack, data=gSRDF, adapt=TRUE)
res.adpt <- gwr(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + PctPov +
PctBlack, data=gSRDF, adapt=g.adapt.gauss)
res.adpt
pairs(as(res.adpt$SDF, "data.frame")[,2:8], pch=".")
brks <- c(-0.25, 0, 0.01, 0.025, 0.075)
cols <- grey(5:2/6)
plot(res.adpt$SDF, col=cols[findInterval(res.adpt$SDF$PctBlack, brks,
all.inside=TRUE)])
data(meuse)
coordinates(meuse) <- c("x", "y")
meuse$ffreq <- factor(meuse$ffreq)
data(meuse.grid)
coordinates(meuse.grid) <- c("x", "y")
meuse.grid$ffreq <- factor(meuse.grid$ffreq)
gridded(meuse.grid) <- TRUE
xx <- gwr(cadmium ~ dist, meuse, bandwidth = 228, hatmatrix=TRUE)
xx
x <- gwr(cadmium ~ dist, meuse, bandwidth = 228, fit.points = meuse.grid,
predict=TRUE, se.fit=TRUE, fittedGWRobject=xx)
x
spplot(x$SDF, "pred")
spplot(x$SDF, "pred.se")
## Not run: [#不运行:]
  g.bw.gauss <- gwr.sel(PctBach ~ TotPop90 + PctRural + PctEld + PctFB +
    PctPov + PctBlack, data=gSRDF)
  res.bw <- gwr(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + PctPov +
    PctBlack, data=gSRDF, bandwidth=g.bw.gauss)
  res.bw
  pairs(as(res.bw$SDF, "data.frame")[,2:8], pch=".")
  plot(res.bw$SDF, col=cols[findInterval(res.bw$SDF$PctBlack, brks,
    all.inside=TRUE)])
  g.bw.gauss <- gwr.sel(PctBach ~ TotPop90 + PctRural + PctEld + PctFB +
    PctPov + PctBlack, data=gSRDF, longlat=TRUE)
  data(gSRouter)
  SG <- GE_SpatialGrid(gSRouter, maxPixels = 100)
  SPxMASK0 <- over(SG$SG, gSRouter)
  SGDF <- SpatialGridDataFrame(slot(SG$SG, "grid"),
    data=data.frame(SPxMASK0=SPxMASK0),
    proj4string=CRS(proj4string(gSRouter)))
  SPxDF <- as(SGDF, "SpatialPixelsDataFrame")
  res.bw <- gwr(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + PctPov +
    PctBlack, data=gSRDF, bandwidth=g.bw.gauss, fit.points=SPxDF,
    longlat=TRUE)
  res.bw
  spplot(res.bw$SDF, "PctBlack")

## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-18 22:46 , Processed in 0.041655 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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