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

R语言 RSAGA包 grid.predict()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-28 21:16:33 | 显示全部楼层 |阅读模式
grid.predict(RSAGA)
grid.predict()所属R语言包:RSAGA

                                        Helper function for applying predict methods to stacks of grids.
                                         助手功能,应用预测方法,以栈的网格。

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

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

This function can be used to apply the predict method of hopefully any fitted predictive model pixel by pixel to a stack of grids  representing the explanatory variables. It is intended to be called
此功能可以用于应用预测方法,希望任何装有预测模型的像素由像素到一个堆栈的网格代表解释变量。它被用于以被称为


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


grid.predict(fit, predfun, trafo, control.predict,



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

参数:fit
a model object for which prediction is desired
需要预测模型对象


参数:predfun
optional prediction function; if missing, the fit's predict method is called. In some cases it may be convenient to define a wrapper function for the predict method that may be passed as predfun argument.
可选的预测功能,如果缺少,fit的predict方法被调用。在某些情况下,它可以方便地定义一个包装函数可能通过predfun参数的预测方法。


参数:trafo
an optional function(x) that takes a data.frame x and returns a data.frame with the same number of rows; this is intended to perform transformations on the input variables, e.g. derive a log-transformed variable from the raw input read from  the grids, or more complex variables such as the NDVI etc.; the data.frame resulting from a call to trafo (if provided) is passed to predfun
一个可选的function(x)需要一个data.framex和返回一个data.frame具有相同的行数,这是为了执行转换的输入变量,例如:得出一个数转换的变量,从原料输入读取网格,或更复杂的变量,如NDVI等; data.frame调用trafo(如果有的话)传递给 predfun


参数:control.predict
an optional list of arguments to be passed on to predfun; this may be e.g. type="response" to obtain probability prediction maps from a logistic regression model
一个可选的参数列表传递给predfun,这可能是例如: type="response"获得logistic回归模型的概率预报图


参数:predict.column
optional character string: Some predict methods (e.g. predict.lda) return a data.frame with several columns, e.g. one column per class in a classification problem. predict.column is used to pick the one that is of interest
可选的字符串:有人预测方法(如:predict.lda)返回一个数据框数列,例如:一列,每类的分类问题。 predict.column是用来挑一个,就是利益


参数:trace
integer >=0: positive values give more (=2) or less (=1) information on predictor variables and predictions
整数> = 0:正确的价值观给予更多的(= 2)或(= 1)信息预测变量和预测


参数:location
optional location data received from multi.focal.function; is added to the newdata object that is passed on to predfun.
可选的位置接收到的数据multi.focal.function;添加到的newdata对象被传递到predfun。


参数:...
these arguments are provided by the calling function, usually multi.local.function or multi.focal.function.  They contain the explanatory  (predictor) variables required by the fit model.
这些参数通过调用函数,通常是multi.local.function或multi.focal.function。它们含有的解释(预测变量)fit模型所要求的。


Details

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

grid.predict is a simple wrapper function. First it binds the arguments in ... together in a data.frame with the raw predictor variables that have been read from their grids by the caller, multi.local.function (or multi.focal.function). Then it calls the optional trafo function to transform or combine predictor variables (e.g. perform log transformations, ratioing, arithmetic operations such as calculating the NDVI). Finally the predfun (or, typically, the default predict method of fit) is called, handing over the fit, the predictor data.frame, and the optional control.predict arguments.
grid.predict是一个简单的包装功能。首先,它的参数绑定...在data.frame与原始预测变量被读出其电网的来电,multi.local.function(multi.focal.function)。然后,它调用可选的trafo函数来转换或合并的预测变量(例如,执行log转换比率,算术运算,如计算NDVI)。最后predfun(或通常情况下,默认predictfit)的方法被调用,移交fit,预测data.frame,和可选的control.predict参数。


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

grid.predict returns the result of the call to predfun or the default predict
grid.predict返回调用的结果predfun或默认predict


注意----------Note----------

Though grid.predict can in principle deal with predict methods returning factor variables, its usual caller multi.local.function / multi.focal.function  cannot; classification models should be dealt with by setting a type="prob" (for rpart) or type="response" (for logistic regression and logistic additive model)
虽然grid.predictpredict方法返回因子变量原则处理,其一贯的来电multi.local.function/multi.focal.function不能分类模型应该设置一个type="prob"处理(为rpart)type="response"(logistic回归分析和逻辑添加剂模型)


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


Alexander Brenning



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

The example of landslide susceptibility analysis with generalized additive models.  In: J. Boehner, T. Blaschke, L. Montanarella (eds.), SAGA - Seconds Out  (= Hamburger Beitraege zur Physischen Geographie und Landschaftsoekologie, 19),

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

focal.function, multi.local.function, multi.focal.function
focal.function,multi.local.function,multi.focal.function


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


## Not run: [#不运行:]
# Assume that d is a data.frame with point observations[假设d是点观测数据框]
# of a numerical response variable y and predictor variables[响应变量y的数值和预测变量]
# a, b, and c.[,b,和c。]
# Fit a generalized additive model to y,a,b,c.[一个广义相加模型拟合Y,A,B,C。]
# We want to model b and c as nonlinear terms:[我们要的非线性模型B和C:]
require(gam)
fit <- gam(y ~ a + s(b) + s(c), data = d)
multi.local.function(in.grids = c("a", "b", "c"),
    out.varnames = "pred",
    fun = grid.predict, fit = fit )
    # Note that the 'grid.predict' uses by default the[需要注意的是默认情况下,使用“grid.predict”]
    # predict method of 'fit'.[适合的预测方法。]
# Model predictions are written to a file named pred.asc[模型的预测被写入到一个文件名为pred.asc]

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

## Not run: [#不运行:]
# A fake example of a logistic additive model:[一个假的MF添加剂模型的例子:]
require(gam)
fit <- gam(cl ~ a + s(b) + s(c), data = d, family = binomial)
multi.local.function(in.grids = c("a", "b", "c"),
    out.varnames = "pred",
    fun = grid.predict, fit = fit,
    control.predict = list(type = "response") )
    # 'control.predict' is passed on to 'grid.predict', which[control.predict被传递到grid.predict,其中]
    # dumps its contents into the arguments for 'fit''s[其内容转储到适合的论点,]
    # 'predict' method.[“预测”的方法。]
# Model predictions are written to a file named pred.asc[模型的预测被写入到一个文件名为pred.asc]

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

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-27 05:25 , Processed in 0.036649 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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