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

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

[复制链接]
发表于 2012-9-30 12:38:22 | 显示全部楼层 |阅读模式
computeV(spatialCovariance)
computeV()所属R语言包:spatialCovariance

                                        Compute Covariance Matrix
                                         计算协方差矩阵

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

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

Observations are averages over congruent rectangular plots that like in a lattice.  For extensive observations one needs to multiply the matrix by the $area^2$ where $area$ is the common area of each plot.
意见是一致的长方形图,喜欢在格的平均值。对于广泛的意见,需要美元的面积乘以矩阵^ 2 $ $区$是每个小区的公共区域。

Various different classes of covariance functions, generalised covariance functions and their derivatives wrt parameters are built into this library.  These include the Cauchy and Mat\'ern covariance functions as well as specific sub models such as the Bessel$_0$, Exponential, Bessel$_1$, spline and logarithmic covariance
各种不同类别的协方差函数,广义协方差函数及其导数相对于参数内置到这个库。这些措施包括柯西和垫\“ERN协方差函数以及具体的子模型,如贝塞尔$ _0元,指数,贝塞尔$ _1,样条曲线和对数方差


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


computeV(info,class="ldt",params,rel.tol =.Machine$double.eps^0.25,abs.tol = rel.tol,cat.level=0,K=NULL)



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

computeV(info,class="matern",params=c(0.2,0.5))  ## matern model with inverse range 0.2 and smoothness 0.5
computeV(info,class="ldt",rel.tol=1e-10,abs.tol=rel.tol,cat.level=1)  ## logarithmic model
computeV(info,class="misc",K=K) ## Pass another function K



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

参数:info
Result of the precompute stage
结果的预先计算阶段


参数:class
The class of covariance functions,"ldt", "bess0", "exp", "bess1", "power", "powerNI", "matern", "spline", "cauchy".  Can also be used to compute the derivatives of the covariance matrices for specific models, for example "dbess0", "dexp", "dexp2", "dbess1", "dpowerNI".  Can also be used for any isotropic function K, simply define a function K in the workspace that has two arguments, distance and a vector of parameters.  Then call computeV with class="special".
类的协方差函数,“LDT”中,“bess0”,“EXP”中,“bess1”,“权力”中,“powerNI”中,“matern”,“曲线”,“柯西”。也可用于计算的协方差矩阵的衍生物的具体型号,例如“dbess0”,“dexp”中,“dexp2”中,“dbess1”,“dpowerNI”。也可用于任何各向同性的函数K,简单地定义一个函数K在工作区中,有两个参数,距离和参数向量。然后调用“computeV:class="special"。


参数:params
Parameters that go with a specific class of models, for the "matern" class it requires an inverse range parameter and a smoothness parameter, for example params=c(1,0.5), this corresponds to the case when class="exp", params=c(1).
一类特殊的车型,为“matern”类,它的参数需要一个逆向范围参数和平滑参数,例如params=c(1,0.5),此相对应的情况下class="exp", params=c(1)。


参数:rel.tol
Relative Tolerance for one dimensional numerical integration
一维数值积分的相对公差


参数:abs.tol
Absolute Tolerance for one dimensional numerical integration
一维数值积分的绝对公差


参数:cat.level
Controls level of time output, takes values 0, 0.5, 1
控制输出的时间,取值0,0.5,1


参数:K
If class="misc" pass your own covariance function K here, see example below
如果class =“杂项”通过自己的协方差函数K,看下面的例子


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


David Clifford



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


## Example for extensive variables - variances of combined plots[#示例广泛的变量 - 方差组合图]
library(spatialCovariance)
nrows <- 1
ncols <- 2
rowwidth <- 1.1
colwidth <- 1.2
rowsep <- 0
colsep <- 0

info <- precompute(nrows,ncols,rowwidth,colwidth,rowsep,colsep)
V <- computeV(info,class="matern",params=c(1,1))

info2 <- precompute(nrows=1,ncols=1,rowwidth=rowwidth,colwidth=colwidth*2,0,0)
V2 <- computeV(info2,class="matern",params=c(1,1))

c(1,1)

(rowwidth * (2*colwidth))^2 * V2

## Bring in anisotropy[#使各向异性]
V
info &lt;- precompute.update(info,aniso=2)  ## geometric anisotropy update[#几何各向异性更新]
V <- computeV(info,class="matern",params=c(1,1))
V
info &lt;- precompute.update(info,aniso=5)  ## geometric anisotropy update[#几何各向异性更新]
V

## Second Example - define your own covariance function, here we use a[#第二个示例 - 定义自己的协方差函数,在这里,我们使用]
## spherical one[#球1]

library(spatialCovariance)

K <- function(d,params) {
  frac <- d/params
  ret <- rep(0,length(d))
  ind <- which(frac<1)
  if(length(ind)) ret[ind] <- (1 - 2/pi*(frac[ind]*sqrt(1 - frac[ind]^2) + asin(frac[ind])))
  return(ret)
}

dVals <- seq(0,10,l=1001)
plot(dVals,K(dVals,8),type="l")
lines(dVals,K(dVals,7),col=2)

nrows <- 1
ncols <- 3
rowwidth <- 2
colwidth <- 2
rowsep <- 0
colsep <- 0

info <- precompute(nrows,ncols,rowwidth,colwidth,rowsep,colsep)
V <- computeV(info,class="misc",params=c(8),K=K)
V

## Now if we have a low value of theta_2 we should see that the first[#现在,如果我们拥有一个低价值的theta_2我们应该看到,第一]
## and third plot are independent as there is a 2 unit gap between[#和第三个图是独立的,有2个装置之间的差距]
## them, so that term in V will be zero[#他们,使术语在V将为零]
V <- computeV(info,class="misc",params=c(1),K=K)
V

## If theta_2 gets a little bigger than 2 then we should see no[#如果theta_2变得有点大于2,那么,我们应该看不到]
## non-zero entries in V[#V中的非零项]
V <- computeV(info,class="misc",params=c(2.005),K=K)
V

## Check V is positive definite[检查V是正定的]
eigen(V)$values ## should all be positive[#都应该是积极的]


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-10 04:24 , Processed in 0.023080 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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