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

R语言 soil.spec包 regr()函数中文帮助文档(中英文对照)

  [复制链接]
发表于 2012-9-30 11:27:33 | 显示全部楼层 |阅读模式
regr(soil.spec)
regr()所属R语言包:soil.spec

                                        Regression functions for soil spectral analysis
                                         回归土壤频谱分析功能

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

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

Different regression functions (partial least-squares, boosted regression trees, support vector machines) can be chosen for calibrations of one or more constituents. Function settings are optimized for soil spectral analysis, but can be varied. Possible spectral transformations are described in the trans function.
可以选择不同的偏最小二乘回归函数(,带动了回归树,支持向量机)的一种或多种成分的校准。功能设置已被优化为土壤频谱分析,但可以是多种多样的。 trans函数中描述的可能的频谱变换。


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


regr(x, y, sav = "NULL", spec.type = "wavelet transformed", reg = "svm", per = "TRUE", per.n = 0.3, num, model.name = "test", drv = 1, bandwidth = 21, validation = "CV", filte = "haar", level = 3, distribution = "gaussian", n.trees = 1000, shrinkage = 0.01, kerne = "radial")

## S3 method for class 'regr':
plot(x,...)

## S3 method for class 'regr':
summary(object,...)

## S3 method for class 'regr':
pred(new,model,output.name="test",sav="NULL")



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

参数:x
a numerical data.frame or matrix containing the raw spectra in regr. An object of class "regr" in plot.regr.
在regr的数值数据框或矩阵中的原始光谱。对象的类"regr"中plot.regr。


参数:y
a numerical data.frame or matrix containing the constituents.
一个数值数据框或矩阵包含的成分。


参数:sav
a character vector giving the path where to save the function output. If "NULL" (default), the current working directory is taken. As well used in pred.regr.
字符向量的路径保存功能输出。如果"NULL"(默认),当前的工作目录。由于在pred.regr很好用的。


参数:spec.type
a character giving the desired spectral transformation. Available are "raw" (raw spectra), "derivative" (derivative spectra), "continuum removed" (continuum removed spectra) and  "wavelet transformed" (wavelet coefficients).
一个字符给予所期望的光谱变换。有"raw"(原始光谱),"derivative"(导数光谱),"continuum removed"(删除连续光谱)和"wavelet transformed"(小波系数)。


参数:reg
a character giving the regression method. Available are "pls" (partial least-squares), "brt" (boosted regression trees) and "svm" (support vector machines).
字符回归方法。有"pls"(偏最小二乘法),"brt"(提升回归树)和"svm"(支持向量机)。


参数:per
a logical indicating whether validation samples should be chosen as a percentage from x (given in per.n). If "FALSE" object num is taken.
一个逻辑验证样品是否应选择的百分比x(per.n)的。如果"FALSE"对象num。


参数:per.n
a numeric between 0 and 1 giving the percentage of validation samples to choose.
数值0和1之间给予验证样品的百分比来选择。


参数:num
an integer giving the number of validation samples when per is "FALSE".
一个整数,验证样品的数量时per是"FALSE"。


参数:model.name
a character naming the model output.
字符命名模型输出。


参数:drv
an integer between 0 and 3 giving the order of derivative. The value 0 performs smoothing based on bandwidth.
给出的顺序的衍生物,在0和3之间的整数。 0值进行平滑的基础上bandwidth。


参数:bandwidth
an integer between 1 and 30 defining the smoothing interval in wavebands.
在1和30之间的整数定义波段的平滑化的时间间隔。


参数:validation
a character defining the type of cross-validation procedure when reg is equal to "pls". Available are "none" (no cross-validation procedure), "CV" (cross-validation in 10 segments) and "LOO" (leave-one-out cross-validation).
字符定义交叉验证程序的类型,当reg是等于"pls"的。有"none"(无交叉验证程序),"CV"(交叉验证中的10个节段)和"LOO"(留一交叉验证)。


参数:filte
a character defining the wavelet filter in dwt function from wavelets package.
一个字符定义dwt功能wavelets包小波滤波器。


参数:level
a character defining the level of wavelet coefficients extraction (1 to 10 possible; 1 yields 512 coefficients, 2 yields 256 coefficients...).
一个字符定义小波系数提取的水平(1~10的可能的; 1产生512个系数,2的产率256个系数...)。


参数:distribution
a character giving in the distribution in the gbm.fit function.
一个字符给分布在gbm.fit功能。


参数:n.trees
an integer giving the total number of trees to fit in the gbm.fit function.
一个整数,总株数,以适应gbm.fit功能。


参数:shrinkage
a character giving in the shrinkage parameter in the gbm.fit function.
一个字符赋予的收缩参数gbm.fit功能。


参数:kerne
a character giving in the kernel used in the svm function.
提供svm函数在内核中使用的字符。


参数:...
additional arguments.
其他参数。


参数:object
an object of class "regr".
对象类"regr"。


参数:new
a numerical data frame or matrix containing the new spectra.
数值数据框或矩阵包含新的光谱。


参数:model
an object of class "regr".
对象类"regr"。


参数:output.name
a character naming the prediction output csv-file in pred.regr.
字符命名的预测输出的CSV文件中pred.regr。


Details

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

Missing values in y are allowed.
缺少y允许的值。

regr uses the mvr function in the pls package for partial least-squares regression, the gbm.fit function in the gbm package for boosted regression trees and the svm function in the e1071 package for support vector machines regression. The number of important PLS latent variables and the svm parameter optimization is done automatically based on experience with soil spectra.
regr使用mvr功能的pls偏最小二乘回归,gbm.fit在gbm推动的回归树包的功能和包svme1071包支持向量机回归的功能。土壤光谱的经验的基础上,一些重要的的PLS潜在变量和SVM参数优化是自动完成的。

spec.type uses for spectral transformation (i) the locpoly function in KernSmooth package for derivative calculation, (ii) the chull and approx functions in "KernSmooth" package for continuum removal and (iii) the dwt function in wavelets package for extraction of wavelet coefficients. Experiences showed for wavelet decomposition that the best ratio of prediction performance and sparse spectral representation is reached when all 128 wavelet coefficients from decomposition level three are taken (which is the default).
spec.type用于谱变换(I)locpoly KernSmooth包导数的计算功能,(ii)本chull和approx函数<X >包连续去除及(iii)"KernSmooth"功能dwt包中提取的小波系数。经验表明小波分解的最佳比例达到预测的性能和稀疏谱表示当所有的128个小波系数分解三级(这是默认值)。

Settings in the used functions for regression and transformation are chosen based on experience with soil spectra calibrations. It is recommended to take the given default values. Nevertheless, the settings can be adapted to a certain degree. In case you want to use complete functionality use the named functions directly. If reg is "brt", the number of samples has to be more than 70.
设置常用的功能,回归和转型的选择是基于与土壤光谱校准经验。建议在给定的默认值。然而,设定,可适应在一定程度上。如果你想使用完整的功能,直接使用命名的功能。如果reg是"brt",样本数超过70。

Column names of x and new must contain the wavebands. Wavebands are made automatically compatible if needed (see details in read.spc)..
列名x和new必须包含波段。波段自动兼容,如果需要的话(详见read.spc).。

Constituent values are not always normally distributed. This can violate prerequisitives for regression methods. Thus, transformation prior regression can solve this problem. The regr function uses log, square root and box-cox transformation aside untransformed values and let the user decide graphically which transformation to take for each constituent.
成份股值并不总是服从正态分布。 ,这可以违反prerequisitives,回归方法。因此,改造前的回归可以解决这个问题。 regr功能使用log,平方根和Box-Cox转换预留未转换的值,让用户决定图形的每个组成部分的改造。

Predictions from pred.regr are given back with the prediction uncertainty for each individual sample (based on the validation set prediction error). The prediction uncertainty is calculated as the root median square error of prediction (RMedianSEP) using a moving window of in maximum 50 samples with similar predicted values. From the RMedianSEP the confidence interval is calculated.
预测从pred.regr,还给每个样品的验证集预测误差的基础上预测的不确定性。预测的不确定性计算的根目录中位数的平方误差的预测(RMedianSEP)使用相似的预测值在最大的50个样本的移动窗口的。从RMedianSEP的置信区间的计算方法。

Predictions are only made if (i) the new spectrum lies within the mahalanobis space of the calibration set, (ii) there is a local neighbor within of 5 and (iii) the predicted value lies within the calibration set range. Otherwise they are set to NA values. Mahalanobis distance can only be calculated when the number of calibration samples is higher than the number of wavebands/variables.
的预测是,如果(i)新的频谱范围内的马氏空间校正集,(二)有当地的邻居内的5及(iii)的预测值范围内的校准设定的范围内。否则,它们被设置为NA值。马哈拉诺比斯距离时,只能计算的校准样品数量是高于波段/变量的数目。

Calibration statistics contains for each constituents (i) n the number of samples used in calibration, (ii) r2 the coefficient of determination for the linear regression of measured against predicted values, (iii) a the slope of the regression line, (iv) bias the bias, (v) RMSEC the root means square error of calibration, (vi) RPD the ratio of constituent standard deviation to RMSEC, (vii) n LV the number of latent variables used when reg is equal to "pls", (viii) n bc out the number of backtransformed values being NA values after box-cox transformation and (ix) n trees the number of trees when reg is equal to "brt". Validation statistics contains for each constituents points (i) to (vi). The RMSEC is logically the RMSEP.
校准统计数据中包含的每个成分(ⅰ)n校准中使用的样本的数目,(ⅱ)r2对预测值的测量的线性回归系数的测定,(ⅲ)<X >的回归直线的斜率,(ⅳ)a的偏压,(ⅴ)bias根装置的校准方误差,(ⅵ)RMSEC的成分的标准偏差的比率RMSEC,(七)RPD的潜变量的数量,当n LV是reg,(八)"pls"逆转换值的数量是n bc out的Box-Cox转换后的值及(ix)NA的树木数量,当n trees是等于reg的。验证统计数据中包含的每个成分点(i)至(vi)。 RMSEC在逻辑上是RMSEP。

The calibration and validation regressions of all constituents are plotted and the statistics printed in the Console.
绘制的校准和验证所有成分的回归和统计打印到控制台上。

Nearly each run of regr yields following warning message: &ldquo;1: in optimize(f = function(lambda)...&rdquo;. Its related with the box-cox transformation, but does not have any impact or negative side effects.
几乎每个regr执行产生以下警告消息:“1:在优化(F =函数(lambda)...”。相关的Box-Cox转换,但不会有任何影响或负副作用。


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

regr returns a list with class "regr" containing the following components excluding the last four ones. pred.regr returns a list with class "pred.regr" containing the last four components output.name,  predicted.values,  method, and  spectral.transformation (see below):
regr返回一个列表,与类"regr"含有下列成分的除最后四个一。 pred.regr返回一个列表类"pred.regr"在过去的四个组成部分output.name,predicted.values,method和spectral.transformation(见下文):

<table summary="R valueblock"> <tr valign="top"><td>model.name</td> <td> a character naming how the model output was named.</td></tr> <tr valign="top"><td>model</td> <td> a list containing the regression output of class "mvr", "gbm" or "svm".</td></tr> <tr valign="top"><td>x.tr</td> <td> a matrix containing the transformed spectra.</td></tr> <tr valign="top"><td>spectral.transformation</td> <td> a character naming the spectral transformation.</td></tr> <tr valign="top"><td>constituents</td> <td> a character naming the constituents.</td></tr> <tr valign="top"><td>constituents.transformation</td> <td> a character naming the constituent transformations. Needed for pred.regr.</td></tr> <tr valign="top"><td>lambda</td> <td> a numeric giving the lambda values in case the box-cox transformation was chosen as constituents transformation. Needed for pred.regr.</td></tr> <tr valign="top"><td>method</td> <td> a character naming the used regression method.</td></tr> <tr valign="top"><td>cal.samples</td> <td> a list containing the row names of the calibration samples for each soil constituent.</td></tr> <tr valign="top"><td>val.samples</td> <td> a list containing the row names of the validation samples for each soil constituent.</td></tr> <tr valign="top"><td>cal.statistics</td> <td> a matrix containing the calibration statistics for all constituents. See details.</td></tr> <tr valign="top"><td>cal.mea.pre</td> <td> a data frame containing the calibration set measured and predicted values for all constituents.</td></tr> <tr valign="top"><td>val.statistics</td> <td> a matrix containing the validation statistics for all constituents. See details.</td></tr> <tr valign="top"><td>val.mea.pre</td> <td> a data frame containing the validation set measured and predicted values for all constituents.</td></tr> <tr valign="top"><td>cal.pca</td> <td> a list containing objects of the class "prcomp" for each constituent calibration set. Needed for pred.regr.</td></tr> <tr valign="top"><td>mahalanobis</td> <td> a list containing numeric vectors having the spectral mahalanobis distance of the constituents calibration sets. Needed for pred.regr.</td></tr> <tr valign="top"><td>cal.range</td> <td> a list containing numeric vectors having the ranges of the constituents calibration sets. Needed for pred.regr.</td></tr> <tr valign="top"><td>rmsep</td> <td> a list containing numeric vectors having for each constituent the root median square error of prediction for each validation set sample. See details for further explanation.  Needed for pred.regr.</td></tr> <tr valign="top"><td>lm</td> <td> a list containing numeric vectors having for each constituent validation set the fitted values calculated by linear regression of measured against predicted values. Needed for pred.regr.</td></tr> <tr valign="top"><td>wavebands</td> <td> a numeric vector containing the wavebands of x. Needed for pred.regr.</td></tr> <tr valign="top"><td>drv</td> <td> an integer giving the order of derivative. Needed for pred.regr.</td></tr> <tr valign="top"><td>bandwidth</td> <td> an integer defining the smoothing interval in wavebands. Needed for pred.regr.</td></tr> <tr valign="top"><td>filter</td> <td> a character defining the wavelet filter. Needed for pred.regr.</td></tr> <tr valign="top"><td>level</td> <td> a character defining the level of wavelet coefficients extraction. Needed for pred.regr.</td></tr> <tr valign="top"><td>output.name</td> <td> a character string giving the name of the saved csv-file from pred.regr.</td></tr> <tr valign="top"><td>predicted.values</td> <td> a matrix containing the predicted values and its respective confidence interval limits.</td></tr> <tr valign="top"><td>method</td> <td> a character naming the used regression method.</td></tr> <tr valign="top"><td>spectral.transformation</td> <td> a character naming the used spectral transformation method.</td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD>model.name</ TD> <TD>一个字符命名模式输出如何被命名为。</ TD> </ TR> <tr valign="top"> <TD> model</ TD> <td>一个列表,其中包含的回归输出的类"mvr","gbm"或"svm"。< / TD> </ TR> <tr valign="top"> <TD> x.tr</ TD> <td>一个包含转换后的光谱矩阵。</ TD> </ TR> <TR VALIGN =“顶“<TD> spectral.transformation </ TD> <td>一个字符命名的谱变换。</ TD> </ TR> <tr valign="top"> <TD>constituents / TD> <td>一个字符命名的成分。</ TD> </ TR> <tr valign="top"> <TD>constituents.transformation</ TD> <td>一个字符命名的成分变换。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>lambda </ TD> <td>一个数字给lambda值的情况下箱Cox变换选择了作为选民转型。 pred.regr。</ TD> </ TR> <tr valign="top"> <TD>method</ TD> <td>一个字符命名采用回归方法。</ TD所需> </ TR> <tr valign="top"> <TD> cal.samples</ TD> <td>一个列表,其中包含行的校准样品名称为各土壤成分。</ TD> </ TR > <tr valign="top"> <TD> val.samples </ TD> <td>一个列表,其中包含行的验证样品的名称为每个土壤成分。</ TD> </ TR> <TR VALIGN =“”> <TD>cal.statistics</ TD> <td>一个基质中含有的所有成分的校准统计。查看详细信息。</ TD> </ TR> <tr valign="top"> <TD>cal.mea.pre </ TD> <td>一个数据框包含校准测量值与预测值的所有成分。 / TD> </ TR> <tr valign="top"> <TD>val.statistics</ TD> <td>一个基质中含有的所有成分确认的统计。查看详细信息。</ TD> </ TR> <tr valign="top"> <TD>val.mea.pre </ TD> <td>一个数据框包含验证所有成分的测量值与预测值。 / TD> </ TR> <tr valign="top"> <TD> cal.pca</ TD> <td>一个列表,其中包含类的对象"prcomp"每个组成校正集。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>mahalanobis </ TD> <td>一个列表,其中包含的数字矢量的光谱马氏距离校准设置的成分。 pred.regr。</ TD> </ TR> <tr valign="top"> <TD>cal.range </ TD> <td>一个列表,其中包含的数字矢量的范围的成分所需要的校正集。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>rmsep </ TD> <td>一个列表,其中包含数字矢量的各组成部分的根每个验证集样本中位数的平方预测误差。查看详细资料作进一步的解释。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>lm </ TD> <td>一个列表,其中包含每个组成验证组数字矢量计算拟合值对预测值的测量的线性回归。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>wavebands </ TD> <td>一个数字向量的波段x的。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>drv</ TD> <TD>一个整数,衍生金融工具的顺序。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>bandwidth</ TD> <TD>整数定义的平滑间隔波段。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>filter</ TD> <td>一个字符定义小波滤波器。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>level</ TD> <td>一个字符定义的小波系数提取。所需的pred.regr。</ TD> </ TR> <tr valign="top"> <TD>output.name </ TD> <td>一个字符串的名称保存的CSV文件pred.regr。</ TD> </ TR> <tr valign="top"> <TD>predicted.values </ TD> <td>一个矩阵的预测值和其相应的置信区间限制。</ TD> </ TR> <tr valign="top"> <TD>method </ TD> <td>一个字符命名采用回归方法。</ TD> </ TR> < TR VALIGN =“顶”> <TD>spectral.transformation </ TD> <TD>一个字符命名所使用的频谱变换方法。</ TD> </ TR> </ TABLE>


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


Thomas Terhoeven-Urselmans

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-23 20:34 , Processed in 0.031368 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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