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

R语言:ppr()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 19:30:48 | 显示全部楼层 |阅读模式
ppr(stats)
ppr()所属R语言包:stats

                                        Projection Pursuit Regression
                                         投影寻踪回归

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

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

Fit a projection pursuit regression model.
适合投影寻踪回归模型。


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


ppr(x, ...)

## S3 method for class 'formula'[类formula的方法]
ppr(formula, data, weights, subset, na.action,
    contrasts = NULL, ..., model = FALSE)

## Default S3 method:[默认方法]
ppr(x, y, weights = rep(1,n),
    ww = rep(1,q), nterms, max.terms = nterms, optlevel = 2,
    sm.method = c("supsmu", "spline", "gcvspline"),
    bass = 0, span = 0, df = 5, gcvpen = 1, ...)



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

参数:formula
a formula specifying one or more numeric response variables and the explanatory variables.  
指定一个或多个数字的响应变量和解释变量的公式。


参数:x
numeric matrix of explanatory variables.  Rows represent observations, and columns represent variables.  Missing values are not accepted.  
解释变量的数字矩阵。行代表的意见,列代表变量。遗漏值是不能接受的。


参数:y
numeric matrix of response variables.  Rows represent observations, and columns represent variables.  Missing values are not accepted.  
响应变量的数字矩阵。行代表的意见,列代表变量。遗漏值是不能接受的。


参数:nterms
number of terms to include in the final model.
数量条款包括在最终的模型。


参数:data
a data frame (or similar: see model.frame) from which variables specified in formula are preferentially to be taken.  
看到一个数据框(或类似:model.frame)指定formula的变量从哪个优先要采取。


参数:weights
a vector of weights w_i for each case.
一个权重向量w_i每情况件。


参数:ww
a vector of weights for each response, so the fit criterion is the sum over case i and responses j of w_i ww_j (y_ij - fit_ij)^2 divided by the sum of w_i.  
每个响应的权重向量,因此合适的标准是一笔i和响应以上的情况下jw_i ww_j (y_ij - fit_ij)^2分由w_i的总和。


参数:subset
an index vector specifying the cases to be used in the training sample.  (NOTE: If given, this argument must be named.)  
索引向量指定要在训练样本的情况下。 (注:如果给定的,这个参数必须命名)


参数:na.action
a function to specify the action to be taken if NAs are found. The default action is given by getOption("na.action"). (NOTE: If given, this argument must be named.)  
应采取一个函数来指定的动作,如果NAS被发现。默认的动作是由getOption("na.action")。 (注:如果给定的,这个参数必须命名)


参数:contrasts
the contrasts to be used when any factor explanatory variables are coded.  
任何因素解释变量编码时要使用的对比。


参数:max.terms
maximum number of terms to choose from when building the model.  
从建立模型时选择的条款的最大数量。


参数:optlevel
integer from 0 to 3 which determines the thoroughness of an optimization routine in the SMART program. See the "Details" section.  
整数,从0到3,它决定在SMART计划优化程序的完整性。看到“详细资料”一节。


参数:sm.method
the method used for smoothing the ridge functions.  The default is to use Friedman's super smoother supsmu.  The alternatives are to use the smoothing spline code underlying smooth.spline, either with a specified (equivalent) degrees of freedom for each ridge functions, or to allow the smoothness to be chosen by GCV.  
该方法用于平滑脊功能。默认是使用弗里德曼的超平滑supsmu。替代方案是使用平滑样条代码基本smooth.spline,要么指定(相当于)度每个脊功能的自由,或允许平滑GCV的选择。


参数:bass
super smoother bass tone control used with automatic span selection (see supsmu); the range of values is 0 to 10, with larger values resulting in increased smoothing.  
超平滑的低音音调控制,具有自动量程选择(见supsmu)值的范围是0到10,有较大的增加平滑值。


参数:span
super smoother span control (see supsmu).  The default, 0, results in automatic span selection by local cross validation. span can also take a value in (0, 1].  
超平滑跨度控制(见supsmu)。默认情况下,0,在当地交叉验证的自动量程选择的结果。 span还可以在(0, 1]价值。


参数:df
if sm.method is "spline" specifies the smoothness of each ridge term via the requested equivalent degrees of freedom.  
sm.method如果是"spline"指定的每个山脊长期通过平整度要求同等程度的自由。


参数:gcvpen
if sm.method is "gcvspline" this is the penalty used in the GCV selection for each degree of freedom used.  
如果sm.method是"gcvspline"这是在GCV的选择用于每个自由的使用程度的罚款。


参数:...
arguments to be passed to or from other methods.
参数被传递到或从其他方法。


参数:model
logical.  If true, the model frame is returned.
逻辑。如果情况属实,则返回该模型框架。


Details

详情----------Details----------

The basic method is given by Friedman (1984), and is essentially the same code used by S-PLUS's ppreg.  This code is extremely sensitive to the compiler used.
弗里德曼(1984)给出的基本方法,本质上是相同的代码,S-PLUS的ppreg。此代码是极其敏感的编译器使用。

The algorithm first adds up to max.terms ridge terms one at a time; it will use less if it is unable to find a term to add that makes sufficient difference.  It then removes the least important term at each step until nterms terms are left.
该算法首先增加了max.terms脊一次,它会使用较少的,如果它不能找到一个词来补充足够的差异。然后在每一步中删除不重要任期直到nterms条款离开。

The levels of optimization (argument optlevel) differ in how thoroughly the models are refitted during this process. At level 0 the existing ridge terms are not refitted.  At level 1 the projection directions are not refitted, but the ridge functions and the regression coefficients are.  Levels 2 and 3 refit all the terms and are equivalent for one response; level 3 is more careful to re-balance the contributions from each regressor at each step and so is a little less likely to converge to a saddle point of the sum of squares criterion.
优化水平(参数optlevel)如何彻底改装模型,在此过程中有所不同。在0级,现有的山脊条款不改装。第1级的投影方向不改装,但脊功能和回归系数。级别2和3改装的所有条款,并有相当于一个响应; 3级是从每个回归量在每一个步骤,以重新平衡的贡献更加小心,所以是有点不太可能收敛到鞍点的平方和标准。


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

A list with the following components, many of which are for use by the method functions.
以下组件列表,其中许多是为使用该方法的功能。


参数:call
the matched call
匹配的呼叫


参数:p
the number of explanatory variables (after any coding)
解释变量的数目(任何编码后)


参数:q
the number of response variables
响应变量的数量


参数:mu
the argument nterms
参数nterms


参数:ml
the argument max.terms
参数max.terms


参数:gof
the overall residual (weighted) sum of squares for the selected model
整体剩余平方和(加权)所选模型


参数:gofn
the overall residual (weighted) sum of squares against the number of terms, up to max.terms.  Will be invalid (and zero) for less than nterms.
整体残余(加权)的总和,对一些条款的平方max.terms。将是无效的(零),比nterms少。


参数:df
the argument df
参数df


参数:edf
if sm.method is "spline" or "gcvspline" the equivalent number of degrees of freedom for each ridge term used.
sm.method如果是"spline"或"gcvspline"同等数量的自由度为每个脊长期使用。


参数:xnames
the names of the explanatory variables
解释变量的名称


参数:ynames
the names of the response variables
响应变量的名称


参数:alpha
a matrix of the projection directions, with a column for each ridge term
矩阵的投影方向,为每个山脊长期的列与


参数:beta
a matrix of the coefficients applied for each response to the ridge terms: the rows are the responses and the columns the ridge terms
系数矩阵应用于每个脊条款:该行的反应和列脊条款


参数:yb
the weighted means of each response
每个响应的加权方法


参数:ys
the overall scale factor used: internally the responses are divided by ys to have unit total weighted sum of squares.
整体规模的因素:国内的反应分为ys有单位的总平方加权总和。


参数:fitted.values
the fitted values, as a matrix if q > 1.
如果q > 1的拟合值,作为基质。


参数:residuals
the residuals, as a matrix if q > 1.
残差,如果q > 1作为一个矩阵。


参数:smod
internal work array, which includes the ridge functions evaluated at the training set points.
内部工作阵列,其中包括脊功能评估在训练集点。


参数:model
(only if model=TRUE) the model frame.
(仅当model=TRUE)模型框架。


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

Projection pursuit regression. Journal of the American Statistical Association, 76, 817–823.
SMART User's Guide. Laboratory for Computational Statistics, Stanford University Technical Report No. 1.
Modern Applied Statistics with S.  Springer.

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

plot.ppr, supsmu, smooth.spline
plot.ppr,supsmu,smooth.spline


举例----------Examples----------


require(graphics)

# Note: your numerical values may differ[注:您的数值可能会有所不同]
attach(rock)
area1 <- area/10000; peri1 <- peri/10000
rock.ppr <- ppr(log(perm) ~ area1 + peri1 + shape,
                data = rock, nterms = 2, max.terms = 5)
rock.ppr
# Call:[致电:]
# ppr.formula(formula = log(perm) ~ area1 + peri1 + shape, data = rock,[ppr.formula(公式=日志(烫发)&#12316;AREA1 + peri1 +形状,数据=岩石,]
#     nterms = 2, max.terms = 5)[nterms = 2,max.terms = 5)]
#[]
# Goodness of fit:[拟合优度:]
#  2 terms  3 terms  4 terms  5 terms[2方面3方面4方面5方面]
# 8.737806 5.289517 4.745799 4.490378[8.737806 5.289517 4.745799 4.490378]

summary(rock.ppr)
# .....  (same as above)[..... (同上)]
# .....[.....]
#[]
# Projection direction vectors:[投影方向向量:]
#       term 1      term 2[长期1长期2]
# area1  0.34357179  0.37071027[AREA1 0.34357179 0.37071027]
# peri1 -0.93781471 -0.61923542[peri1 -0.93781471 -0.61923542]
# shape  0.04961846  0.69218595[塑造0.04961846 0.69218595]
#[]
# Coefficients of ridge terms:[系数脊条款:]
#    term 1    term 2[长期1长期2]
# 1.6079271 0.5460971[1.6079271 0.5460971]

par(mfrow=c(3,2))# maybe: , pty="s")[也许,PTY =“S”)]
plot(rock.ppr, main="ppr(log(perm)~ ., nterms=2, max.terms=5)")
plot(update(rock.ppr, bass=5), main = "update(..., bass = 5)")
plot(update(rock.ppr, sm.method="gcv", gcvpen=2),
     main = "update(..., sm.method=\"gcv\", gcvpen=2)")
cbind(perm=rock$perm, prediction=round(exp(predict(rock.ppr)), 1))
detach()

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 16:29 , Processed in 0.023132 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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