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

R语言 scam包 plot.scam()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-29 22:37:09 | 显示全部楼层 |阅读模式
plot.scam(scam)
plot.scam()所属R语言包:scam

                                        SCAM plotting
                                         SCAM策划

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

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

The function is a clone of the plot.gam of the mgcv package with the differences in the construction of the Bayesian confidence intervals of the shape constrained smooth terms. The function takes a fitted scam object produced by scam() and plots the  component smooth functions that make it up, on the scale of the linear predictor. Optionally produces term plots for parametric model components
该功能是克隆的plot.gam的mgcv包建设的贝叶斯置信区间平滑的形状约束的条款的差异。该函数将一个装有scam对象scam()和图的组成部分平滑功能,使起来,上规模的线性预测。参数化模型组件可选产生术语的图


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


## S3 method for class 'scam'
plot(x,residuals=FALSE,rug=TRUE,se=TRUE,pages=0,select=NULL,scale=-1,
         n=100,n2=40,pers=FALSE,theta=30,phi=30,jit=FALSE,xlab=NULL,
         ylab=NULL,main=NULL,ylim=NULL,xlim=NULL,too.far=0.1,
         all.terms=FALSE,shade=FALSE,shade.col="gray80",
         shift=0,trans=I,seWithMean=FALSE,by.resids=FALSE,...)



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

参数:x
a fitted gam object as produced by gam().
一个装有gam对象产生的gam()。


参数:residuals
If TRUE then partial residuals are added to plots of 1-D smooths. If FALSE  then no residuals are added. If this is an array of the correct length then it is used as the array of  residuals to be used for producing partial residuals. If TRUE then the residuals are the working residuals from the IRLS iteration weighted by the IRLS weights. Partial residuals for a smooth term are the residuals that would be obtained by dropping the term concerned from the model, while leaving all other  estimates fixed (i.e. the estimates for the term plus the residuals).
如果TRUE那部分残余物会被添加到图1-D平滑。如果FALSE然后没有任何残留物。如果这是一个阵列的正确的长度,然后它被用作要使用的制造部分的残差残差阵列。如果TRUE然后的残差是工作的IRLS迭代IRLS的权重加权残差。部分残差的平稳术语是通过降低术语关注的模型,而所有其他估计固定的(即在术语的预算,加上残差)将得到的残差。


参数:rug
when TRUE (default) then the covariate to which the plot applies is displayed as a rug plot at the foot of each plot of a 1-d smooth, and the locations of the covariates are plotted as points on the contour plot representing a 2-d smooth.  
TRUE(默认值)的协的图显示在脚下的地毯小区,每个小区的一维光滑,协变量的位置被绘制成点的等高线图2  - ð顺利。


参数:se
when TRUE (default) upper and lower lines are added to the 1-d plots at 2 standard errors above and below the estimate of the smooth being plotted while for 2-d plots, surfaces at +1 and -1 standard errors are contoured and overlayed on the contour plot for the estimate. If a positive number is supplied then this number is multiplied by the standard errors when calculating standard error curves or surfaces. See also shade, below.  
当TRUE(默认值)上下行添加到的1-D图,在2个以上的标准误差和低于预期的顺利被绘制,而2-D图形的轮廓,表面+1和-1的标准误差覆盖在估计的等高线图。如果为正数被供给,然后,这个数目乘以计算标准误差曲线或曲面时的标准误差。 shade,下面。


参数:pages
(default 0) the number of pages over which to spread the output. For example,  if pages=1 then all terms will be plotted on one page with the layout performed automatically.  Set to 0 to have the routine leave all graphics settings as they are.  
(默认为0)的网页数量在其上传播的输出。例如,如果pages=1然后所有条款将被绘制在一个页面上的布局自动执行。如果设置为0的日常离开,因为他们是所有图形设置。


参数:select
Allows the  plot for a single model term to be selected for printing. e.g. if you just want the plot for the second smooth term set select=2.  
允许一个模型项被选中用于打印的图。例如如果你只是想术语设置select=2第二平滑的图。


参数:scale
set to -1 (default) to have the same y-axis scale for each plot, and to 0 for a  different y axis for each plot. Ignored if ylim supplied.
设置为-1(默认值),拥有相同的Y轴刻度,每个小区,每个小区不同的y轴为0。如果忽略ylim提供。


参数:n
number of points used for each 1-d plot - for a nice smooth plot this needs to be several times the estimated  degrees of freedom for the smooth. Default value 100.
1-D图形的每个点 - 一个不错的流畅的图,这需要几次估计的自由度顺利。默认值为100。


参数:n2
Square root of number of points used to grid estimates of 2-d functions for contouring.
格估计为轮廓的2-D功能点的数量的平方根。


参数:pers
Set to TRUE if you want perspective plots for 2-d terms.
设置为TRUE,如果你想要的角度图的2-D。


参数:theta
One of the perspective plot angles.
之一的角度图角。


参数:phi
The other perspective plot angle.
另一个角度图角度。


参数:jit
Set to TRUE if you want rug plots for 1-d terms to be jittered.
如果你想设置为TRUE地毯图1-D将抖动。


参数:xlab
If supplied then this will be used as the x label for all plots.
如果提供,那么这将被用来作为X标签的所有图。


参数:ylab
If supplied then this will be used as the y label for all plots.
如果提供,那么这将被用来作为y标签的所有图。


参数:main
Used as title (or z axis label) for plots if supplied.
标题(或Z轴标签)的图,提供使用。


参数:ylim
If supplied then this pair of numbers are used as the y limits for each plot.
如果提供,则这个数字对每个小区为y限制。


参数:xlim
If supplied then this pair of numbers are used as the x limits for each plot.
如果提供,则这个数字对所使用的X限制为每个图。


参数:too.far
If greater than 0 then this is used to determine when a location is too far from data to be plotted when plotting 2-D smooths. This is useful since smooths tend to go wild away from data. The data are scaled into the unit square before deciding what to exclude, and too.far is a distance  within the unit square.
如果大于0,那么,这是用来确定何时从数据中的位置是太多要绘制绘图时的2-D平滑。这是非常有用的,因为平滑倾向于去野外,远离数据。的数据缩放到单位正方形,然后才决定要排除的,too.far是单位面积内的距离。


参数:all.terms
if set to TRUE then the partial effects of parametric model components are also plotted, via a call to termplot. Only terms of order 1 can be plotted in this way.
如果设置为TRUE那部分的参数化模型组件的绘制,通过调用termplot。这种方式可以被绘制在只有1阶。


参数:shade
Set to TRUE to produce shaded regions as confidence bands for smooths (not avaliable for parametric terms, which are plotted using termplot).
设置为TRUE产生阴影区域的置信区间平滑(不avaliable的参数,使用termplot)绘制。


参数:shade.col
define the color used for shading confidence bands.
定义的阴影置信区间使用的颜色。


参数:shift
constant to add to each smooth (on the scale of the linear predictor) before plotting. Can be useful for some diagnostics, or with trans.
常数,以加至各平滑(线性预测的规模上)之前绘制。可以为一些诊断是有用的,或者使用trans。


参数:trans
function to apply to each smooth  (after any shift), before plotting. shift and trans are occasionally useful as a means for getting plots on the response scale, when the model consists only of a single smooth.
适用于各平滑后的任何变化,前绘制的功能。 shift和trans偶尔有用的手段获得的响应规模的图上,当模型只包含一个平滑的。


参数:seWithMean
if TRUE the component smooths are shown with confidence  intervals that include the uncertainty about the overall mean. If FALSE then the  uncertainty relates purely to the centred smooth itself. An extension of the argument presented in Nychka (1988) suggests that TRUE results in better coverage performance, and this is also suggested by simulation.
如果TRUE组件平滑,其中包括不确定性的总体平均的置信区间。如果FALSE那么的不确定性纯粹是有关中心的光滑。的扩展在Nychka(1988年)提出的论点表明,TRUE更好的覆盖性能,还建议通过模拟。


参数:by.resids
Should partial residuals be plotted for terms with by variables?  Usually the answer is no, they would be meaningless.
部分残差绘制by变量?通常情况下,答案是否定的,他们是没有意义的。


参数:...
other graphics parameters to pass on to plotting commands.
其他的图形参数传递到绘图命令。


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

The function generates plots.
该函数产生的图。


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



Natalya Pya &lt;nat.pya@gmail.com&gt; based partly on <code>mgcv</code> by Simon Wood




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




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

scam
scam


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


## simulating data...[#模拟数据...]
n <- 200
set.seed(1)
x1 <- runif(n)*6-3
f1 &lt;- 3*exp(-x1^2) # unconstrained smooth term[无约束光滑期]
x2 <- runif(n)*4-1;
f2 &lt;- exp(4*x2)/(1+exp(4*x2)) # monotone increasing smooth[单调递增光滑]
x3 <- runif(n)*5;
f3 &lt;- -log(x3)/5  # monotone decreasing smooth[单调递减的平滑]
f <- f1+f2+f3
y <- f + rnorm(n)*0.3
dat <- data.frame(x1=x1,x2=x2,x3=x3,y=y)
## fit model and plot ...[#拟合模型和图...]
b <- scam(y~s(x1,k=15,bs="cr",m=2)+s(x2,k=30,bs="mpi",m=2)+s(x3,k=30,bs="mpd",m=2),
     data=dat)
plot(b,pages=1)   

## Not run: [#不运行:]
## example with bivariate plot...[#例如与二元图...]
## simulating data...[#模拟数据...]
   set.seed(2)
   n <- 30
   x1 <- sort(runif(n)*4-1)
   x2 <- sort(runif(n))
   f1 <- matrix(0,n,n)
   for (i in 1:n) for (j in 1:n)
       { f1[i,j] <- -exp(4*x1[i])/(1+exp(4*x1[i]))+2*sin(pi*x2[j])}
   f <- as.vector(t(f1))
   y <- f+rnorm(length(f))*0.1
   x11 <-  matrix(0,n,n)
   x11[,1:n] <- x1
   x11 <- as.vector(t(x11))
   x22 <- rep(x2,n)
   dat <- list(x1=x11,x2=x22,y=y)
## fit model  and plot ...[#拟合模型和图...]
   b <- scam(y~s(x1,x2,k=c(10,10),bs=c("tesmd1","ps"),m=2),
            family=gaussian(link="identity"), data=dat,sp=NULL)
   par(mfrow=c(2,2),mar=c(4,4,2,2))
   plot(b,se=TRUE)
   plot(b,pers=TRUE,theta = 30, phi = 40)
   plot(y,b$fitted.values,xlab="Simulated data",ylab="Fitted data")
  
## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-29 18:22 , Processed in 0.019424 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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