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

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

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

                                        Fits a max-stable process to data
                                         适合一个最大稳定的过程数据

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

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

This function fits max-stable processes to data using pairwise likelihood. Two max-stable characterisations are available: the Smith and Schlather representations.
此功能适用的数据使用成对的可能性最大稳定过程。稳定,突出两个最大可的史密斯和Schlather表示。


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


shape.form, marg.cov = NULL, temp.cov = NULL, temp.form.loc = NULL,
temp.form.scale = NULL, temp.form.shape = NULL, iso = FALSE, ...,
fit.marge = FALSE, warn = TRUE, method = "Nelder", start, control =
list(), weights = NULL, std.err.type = "score", corr = FALSE, check.grad



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

参数:data
A matrix representing the data. Each column corresponds to one location.
矩阵表示数据。每一列对应于一个位置。


参数:coord
A matrix that gives the coordinates of each location. Each row corresponds to one location.
的矩阵,使每一个位置的坐标。每一行对应于一个位置。


参数:cov.mod
A character string corresponding to the covariance model in the max-stable representation. Must be one of "gauss" for the Smith's model; "whitmat", "cauchy", "powexp", "bessel" or "caugen" for the Whittle-Matern, the Cauchy, the Powered Exponential, the Bessel and the Generalized Cauchy correlation families with the Schlather's model; "brown" for Brown-Resnick processes. The geometric Gaussian and Extremal-t models with a Whittle-Matern correlation function can be fitted by passing respectively "gwhitmat" or "twhitmat". Other correlation function families are considered in a similar way.  
一个字符串对应的协方差模型中的最大稳定表示。必须是史密斯的模型“高斯”“whitmat”,“柯西”中,“powexp”“贝塞耳”或的“caugen”的惠特尔Matern,柯西,动力指数,贝塞尔和广义柯西相关的家庭与的Schlather的模型;“棕色”布朗雷斯尼克过程。几何高斯和的极值-T模型与一个消减的Matern的相关功能,可以安装由通过分别为“gwhitmat”的或“twhitmat”。以类似的方式被认为是其他相关函数家庭。


参数:loc.form, scale.form, shape.form
R formulas defining the spatial linear model for the GEV parameters. May be missing. See section Details.
ŕ公式定义空间的线性模型的GEV参数。可能会丢失。请参见详细信息。


参数:marg.cov
Matrix with named columns giving additional covariates for the GEV parameters. If NULL, no extra covariates are used.
额外的协变量的GEV参数的指定列的矩阵。如果NULL,没有额外的协变量。


参数:temp.cov
Matrix with names columns giving additional *temporal* covariates for the GEV parameters. If NULL, no temporal trend are assume for the GEV parameters — see section Details.
矩阵的列名提供额外的时间*协变量的GEV参数的。如果NULL,没有时间趋势的假设的GEV参数 - 见章节详细信息“。


参数:temp.form.loc, temp.form.scale, temp.form.shape
R formulas defining the temporal trends for the GEV parameters. May be missing. See section Details.
ŕ公式定义的GEV参数的变化趋势。可能会丢失。请参见详细信息。


参数:iso
Logical. If TRUE an isotropic model is fitted to data. Otherwise (default), anisotropy is allowed. Currently, this is only implemented for the Smith's model.
逻辑。如果TRUE各向同性模型嵌合到数据。否则(默认),各向异性是允许的。目前,这是唯一实现为史密斯的模型。


参数:...
Several arguments to be passed to the optim, nlm or nlminb functions. See section details.
几个参数被传递到optim,nlm或nlminb函数。部分细节。


参数:fit.marge
Logical. If TRUE, the GEV parameters are estimated pointwise or using the formulas given by loc.form, scale.form and shape.form. If FALSE, observations are supposed to be unit Frechet distributed. Note that when formulas are given, fit.marge is automatically set to TRUE.
逻辑。如果TRUE,GEV参数估计逐点或使用的公式给出的loc.form,scale.form和shape.form。如果FALSE,观察应该是单位的Frechet分布。请注意,当公式给出,fit.marge被自动设置为TRUE。


参数:warn
Logical. If TRUE (default), users are warned if the log-likelihood is infinite at starting values and/or problems arised while computing the standard errors.
逻辑。 TRUE如果(默认),用户都警告说,如果对数似然是无限的初始值和/或自行拆解的问题,同时计算标准的错误。


参数:method
The method used for the numerical optimisation procedure. Must be one of BFGS, Nelder-Mead, CG, L-BFGS-B, SANN, nlm or nlminb. See optim for details. Please note that passing nlm or nlminb will use the nlm or nlminb functions instead of optim.
所使用的方法的数值优化程序。必须有一个BFGS,Nelder-Mead,CG,L-BFGS-B,SANN,nlm或nlminb。见optim的详细信息。请注意,通过nlm或nlminb使用nlm或nlminb函数,而不是optim。


参数:start
A named list giving the initial values for the parameters over which the pairwise likelihood is to be minimized. If start is omitted the routine attempts to find good starting values - but might fail.
命名的列表,给出的参数成对的可能性是最小化的初始值。如果start省略的日常试图找到很好的起点值 - 但可能会失败。


参数:control
A list giving the control parameters to be passed to the optim function.
一个列表,给出的控制参数被传递到optim功能。


参数:weights
A numeric vector specifying the weights in the pairwise likelihood - and so has length the number of pairs. If NULL (default), no weighting scheme is used.
指定一个数值向量中的权重成对的可能性 - 这样的长度的对数。如果NULL(默认),没有权重方案。


参数:std.err.type
Character string. Must be one of "none", "score", "grad". If "none", standard errors are not computed. Otherwise, standard errors are estimated using the sandwich estimates - see section Details.
字符的字符串。必须是“无”,“成绩”,“毕业”。如果“没有”,不计算标准误差。否则,标准误差估计使用夹心估计 - 部分详细。


参数:corr
Logical. If TRUE (non default), the asymptotic correlation matrix is computed.
逻辑。如果TRUE(非默认)的渐近相关矩阵的计算。


参数:check.grad
Logical. If TRUE (non default), the analytic gradient of the pairwise likelihood will be compared to the numerical one. Such a checking might be usefull for ill-conditionned situation diagnosis.
逻辑。如果TRUE(非默认),成对的可能性分析梯度进行比较的数值。这样的检查可能是很有用的的虐待conditionned情况诊断。


Details

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

As spatial data often deal with a large number of locations, it is impossible to write analytically the joint distribution. Consequently, the fitting procedure substitutes the "full likelihood" for the pairwise likelihood.
由于空间数据经常需要处理大量的位置,这是不可能写解析的联合分布。因此,拟合程序代用品“全似然”成对的可能性。

Let define L_{i,j}(x_{i,j}, θ) the likelihood for site i and j, where i = 1, …, N-1, j=i+1, …,    N, N is the number of site within the region and x_{i,j} are the joint observations for site i and j. Then the pairwise likelihood PL(θ) is defined by:
让我们定义L_{i,j}(x_{i,j}, θ)的可能性网站i和j,其中i = 1, …, N-1,j=i+1, …,    N,N是区域内的一些网站和x_{i,j}联合观测网站i和j。然后成对的可能性PL(θ)被定义为:

As pairwise likelihood is an approximation of the “full likelihood”, standard errors cannot be computed directly by the inverse of the Fisher information matrix. Instead, a sandwich estimate must be used to account for model mispecification e.g.
成对可能是一个近似的“完全可能”,标准误差不能直接计算的Fisher信息矩阵的逆。相反,可以使用的夹层估计必须考虑到的模型mispecification,例如

where H is the Fisher information matrix (computed from the misspecified model) and J is the variance of the score function.
H是Fisher信息矩阵的误设模型计算和J的得分函数的差异。

H is easily estimated using the observed Hessian matrix given by the optim function. Estimation of J is much more difficult. Currently, we propose two different strategies to estimate J.
H是很容易估计,用观测到的Hessian矩阵的optim功能。 J估计是困难得多。目前,我们提出了两种不同的策略,估计J。




grad J is estimated from the gradient e.g. <i>J = &sum;_{i=1}^n
gradJ估计的梯度,例如<I> J =Σ_{i = 1} ^ N




score J is estimated directly from the variance of
scoreJ估计直接从方差

There are two different kind of covariates : "spatial" and "temporal".
有两种不同类型的协变量的“空间”和“时间”。

A "spatial" covariate may have different values accross station but does not depend on time. For example the coordinates of the stations are obviously "spatial". These "spatial" covariates should be used with the marg.cov and loc.form, scale.form, shape.form.
“空间”的协变量可能有不同的价值观,对面站,但不依赖于时间。例如站的坐标是明显的“空间”。这些“空间”的协变量,应使用与marg.cov和loc.form, scale.form, shape.form。

A "temporal" covariates may have different values accross time but does not depend on space. For example the years where the annual maxima were recorded is "temporal". These "temporal" covariates should be used with the temp.cov and temp.form.loc,     temp.form.scale, temp.form.shape.
一个“时间”的协变量可能有不同的价值跨越时间,但不依赖于空间。例如,年的年度最大值记录的是“时间”。这些“时间”的协变量,应使用与temp.cov和temp.form.loc,     temp.form.scale, temp.form.shape。

As a consequence note that marg.cov must have K rows (K being the number of sites) while temp.cov must have n rows (n being the number of observations).
因此说明这marg.cov必须有K行(K的网站数量),而temp.cov必须有n行(n为观测值的数量)。


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

This function returns a object of class maxstab. Such objects are list with components:
这个函数返回一个对象类maxstab。这样的对象是与组件的列表:


参数:fitted.values
A vector containing the estimated parameters.
一个向量,包含参数的估计。


参数:std.err
A vector containing the standard errors.
一个向量,包含标准的错误。


参数:fixed
A vector containing the parameters of the model that have been held fixed.
一个向量,包含的模式,已举办了固定的参数。


参数:param
A vector containing all parameters (optimised and fixed).
一个向量,包含所有参数(优化和修复)。


参数:deviance
The (pairwise) deviance at the maximum pairwise likelihood estimates.
(两两成对的可能性最大)偏差估计。


参数:corr
The correlation matrix.
的相关矩阵。


参数:convergence, counts, message
Components taken from the list returned by optim - for the mle method.
从列表中的组件optim“ - 为mle方法。


参数:data
The data analysed.
分析的数据。


参数:model
The max-stable characterisation used.
稳定的最大特征。


参数:fit.marge
A logical that specifies if the GEV margins were estimated.
的逻辑指定GEV利润估计。


参数:cov.fun
The estimated covariance function - for the Schlather model only.
估计协方差函数 - 的Schlather模型中。


参数:extCoeff
The estimated extremal coefficient function.
估计极值系数函数。


参数:cov.mod
The covariance model for the spatial structure.
协方差模型的空间结构。


警告----------Warning----------

When using reponse surfaces to model spatially the GEV parameters, the likelihood is pretty rough so that the general purpose optimization routines may fail. It is your responsability to check if the numerical optimization succeeded or not. I tried, as best as I can, to provide warning messages if the optimizers failed but in some cases, no warning will appear!  
当使用总应答曲面模型空间的GEV参数,使通用的优化程序可能会失败的可能性是相当粗糙。这是你的责任,以检查是否成功与否的数值优化。作为最好的,我可以,我试过了,提供优化器的警告信息,如果失败,但在某些情况下,没有将出现警告!


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


Mathieu Ribatet



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

from marginal densities. Biometrika 91, 729&ndash;737.
International Statistical Review 73, 111-129.
likelihood. PhD Thesis. Ecole Polytechnique Federale de Lausanne.
max-stable fields associated to negative definite functions Annals of Probability 37:5, 2042&ndash;2065.
Extreme Value Theory. PhD Thesis. University of Padova.
inference for max-stable processes. Journal of the American Statistical Association (Theory and Methods) 105:489, 263-277.
Fields. Extremes 5:1, 33&ndash;44.
extremes. Unpublished.

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


## Not run: [#不运行:]
##Define the coordinate of each location[#定义的每个位置的坐标]
n.site <- 30
locations <- matrix(runif(2*n.site, 0, 10), ncol = 2)
colnames(locations) <- c("lon", "lat")

##Simulate a max-stable process - with unit Frechet margins[#模拟一个最大稳定的过程 - 与单位的Frechet空间]
data <- rmaxstab(40, locations, cov.mod = "whitmat", nugget = 0, range = 30,
smooth = 0.5)

##Now define the spatial model for the GEV parameters[#GEV参数定义的空间模型]
param.loc <- -10 + 2 * locations[,2]
param.scale <- 5 + 2 * locations[,1] + locations[,2]^2
param.shape <- rep(0.2, n.site)

##Transform the unit Frechet margins to GEV [#变换单位的Frechet空间GEV]
for (i in 1:n.site)
  data[,i] <- frech2gev(data[,i], param.loc[i], param.scale[i],
param.shape[i])

##Define a model for the GEV margins to be fitted[#定义一个模型,的GEV利润的安装]
##shape ~ 1 stands for the GEV shape parameter is constant[#的形状~1的看台为GEV形状参数是常数]
##over the region[#以上的区域]
loc.form <- loc ~ lat
scale.form <- scale ~ lon + I(lat^2)
shape.form <- shape ~ 1

##Fit a max-stable process using the Schlather's model[#适合使用的Schlather的模型的一个最大稳定的过程]
fitmaxstab(data, locations, "whitmat", loc.form, scale.form,
           shape.form)

## Model without any spatial structure for the GEV parameters[#型号GEV参数没有任何空间结构]
## Be careful this could be *REALLY* time consuming[#小心,这可能是真的耗时]
fitmaxstab(data, locations, "whitmat")

##  Fixing the smooth parameter of the Whittle-Matern family[#固定的惠特尔Matern家庭的平滑参数]
##  to 0.5 - e.g. considering exponential family. We suppose the data[#0.5  - 例如,考虑指数的家人。我们假设数据]
##  are unit Frechet here.[#单位的Frechet这里。]
fitmaxstab(data, locations, "whitmat", smooth = 0.5, fit.marge = FALSE)

##  Fitting a penalized smoothing splines for the margins with the[#拟合处罚的边缘平滑样条线]
##     Smith's model[#史密斯的模型]
data <- rmaxstab(40, locations, cov.mod = "gauss", cov11 = 100, cov12 =
                 25, cov22 = 220)

##     And transform it to ordinary GEV margins with a non-linear[#并将它转换为普通GEV利润率与非线性]
##     function[#函数]
fun <- function(x)
  2 * sin(pi * x / 4) + 10
fun2 <- function(x)
  (fun(x) - 7 ) / 15

param.loc <- fun(locations[,2])
param.scale <- fun(locations[,2])
param.shape <- fun2(locations[,1])

##Transformation from unit Frechet to common GEV margins[#转换单元导数常见的GEV利润]
for (i in 1:n.site)
  data[,i] <- frech2gev(data[,i], param.loc[i], param.scale[i],
param.shape[i])

##Defining the knots, penalty, degree for the splines[#疙瘩,罚款,度的样条线]
n.knots <- 5
knots <- quantile(locations[,2], prob = 1:n.knots/(n.knots+1))
knots2 <- quantile(locations[,1], prob = 1:n.knots/(n.knots+1))

##Be careful the choice of the penalty (i.e. the smoothing parameter)[#小心罚款(即平滑参数的选择)]
##may strongly affect the result Here we use p-splines for each GEV[#可能会强烈影响的结果,在这里,我们使用P-样条曲线的每个GEV]
##parameter - so it's really CPU demanding but one can use 1 p-spline[#参数 - 这是真的CPU要求很高,但可以使用1个P-样条]
##and 2 linear models.[#和2线性模型。]
##A simple linear model will be clearly faster...[#一个简单的线性模型将清楚地快...]
loc.form <- y ~ rb(lat, knots = knots, degree = 3, penalty = .5)
scale.form <- y ~ rb(lat, knots = knots, degree = 3, penalty = .5)
shape.form <- y ~ rb(lon, knots = knots2, degree = 3, penalty = .5)

fitted <- fitmaxstab(data, locations, "gauss", loc.form, scale.form, shape.form,
                     control = list(ndeps = rep(1e-6, 24), trace = 10),
                     std.err.type = "none", method = "BFGS")
fitted
op <- par(mfrow=c(1,3))
plot(locations[,2], param.loc, col = 2, ylim = c(7, 14),
     ylab = "location parameter", xlab = "latitude")
plot(fun, from = 0, to = 10, add = TRUE, col = 2)
points(locations[,2], predict(fitted)[,"loc"], col = "blue", pch = 5)
new.data <- cbind(lon = seq(0, 10, length = 100), lat = seq(0, 10, length = 100))
lines(new.data[,1], predict(fitted, new.data)[,"loc"], col = "blue")
legend("topleft", c("true values", "predict. values", "true curve", "predict. curve"),
       col = c("red", "blue", "red", "blue"), pch = c(1, 5, NA, NA), inset = 0.05,
       lty = c(0, 0, 1, 1), ncol = 2)

plot(locations[,2], param.scale, col = 2, ylim = c(7, 14),
     ylab = "scale parameter", xlab = "latitude")
plot(fun, from = 0, to = 10, add = TRUE, col = 2)
points(locations[,2], predict(fitted)[,"scale"], col = "blue", pch = 5)
lines(new.data[,1], predict(fitted, new.data)[,"scale"], col = "blue")
legend("topleft", c("true values", "predict. values", "true curve", "predict. curve"),
       col = c("red", "blue", "red", "blue"), pch = c(1, 5, NA, NA), inset = 0.05,
       lty = c(0, 0, 1, 1), ncol = 2)

plot(locations[,1], param.shape, col = 2,
     ylab = "shape parameter", xlab = "longitude")
plot(fun2, from = 0, to = 10, add = TRUE, col = 2)
points(locations[,1], predict(fitted)[,"shape"], col = "blue", pch = 5)
lines(new.data[,1], predict(fitted, new.data)[,"shape"], col = "blue")
legend("topleft", c("true values", "predict. values", "true curve", "predict. curve"),
       col = c("red", "blue", "red", "blue"), pch = c(1, 5, NA, NA), inset = 0.05,
       lty = c(0, 0, 1, 1), ncol = 2)
par(op)

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

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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