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

R语言 scam包 smooth.construct.mpd.smooth.spec()函数中文帮助文档(中英文对照)

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

                                        Constructor for monotone decreasing P-splines in SCAMs
                                         构造函数单调递减的P-样条诈骗

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

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

This is a special method function for creating smooths subject to monotone decreasing constraints which is built by  the mgcv constructor function for smooth terms, smooth.construct.  It is constructed using monotonic P-splines. This smooth is specified via model terms such as  s(x,k,bs="mpd",m=2),  where k denotes the basis dimension and m+1 is the order of the B-spline basis.
这是一种特殊的方法,用于创建平滑功能单调递减是建立在mgcv的构造函数的光滑条款的约束,smooth.construct。这是构建使用单调的P-样条。这种平稳的规定,通过模型计算,如s(x,k,bs="mpd",m=2),这里k为基础尺寸和m+1是B样条基的顺序。


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


smooth.construct.mpd.smooth.spec(object, data, knots)



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

参数:object
A smooth specification object, generated by an s term in a GAM formula.  
光滑的规范对象,产生的s术语一个GAM公式中。


参数:data
A data frame or list containing the data required by this term, with names given by object$term. The by variable is the last element.
一个数据框或列表,其中包含这个词所需要的数据,的名字的object$term。 by变量的最后一个元素。


参数:knots
An optional list containing the knots supplied for basis setup.   If it is NULL then the knot locations are generated automatically.
一个可选的列表,其中包含基础设置中提供的疙瘩。如果是NULL然后结位置自动生成。


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

An object of class "mpd.smooth".
对象的类"mpd.smooth"。


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



Natalya Pya <nat.pya@gmail.com>




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



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

smooth.construct.mpi.smooth.spec, smooth.construct.cx.smooth.spec,  smooth.construct.cv.smooth.spec,  smooth.construct.mdcv.smooth.spec,  smooth.construct.mdcx.smooth.spec, smooth.construct.micv.smooth.spec,  smooth.construct.micx.smooth.spec
smooth.construct.mpi.smooth.spec,smooth.construct.cx.smooth.spec,smooth.construct.cv.smooth.spec,smooth.construct.mdcv.smooth.spec,smooth.construct.mdcx.smooth.spec,smooth.construct.micv.smooth.spec,smooth.construct.micx.smooth.spec


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


  ## Not run: [#不运行:]
## Monotone decreasing P-splines example [#单调递减的P-样条曲线的例子]
  ## simulating data...[#模拟数据...]
   set.seed(3)
   n <- 100
   x <- runif(n)*3-1
   f <- exp(-1.3*x)
   y <- rpois(n,exp(f))
   dat <- data.frame(x=x,y=y)
## fit model ...[#拟合模型...]
   b <- scam(y~s(x,k=15,bs="mpd",m=2),family=poisson(link="log"),
       data=dat,sp=NULL)

# UNCONSTRAINED FIT *****************[无约束FIT *****************]
   b1 <- scam(y~s(x,k=15,bs="ps",m=2),family=poisson(link="log"),
         data=dat,sp=NULL)

## plot results ...[#图...]
   plot(x,y,xlab="x",ylab="y")
   x1 <- sort(x,index=TRUE)
   lines(x1$x,exp(f)[x1$ix])      ## the true function[#真正的功能]
   lines(x1$x,b$fitted.values[x1$ix],col=2)  ## monotone fit [#单调适合]
   lines(x1$x,b1$fitted.values[x1$ix],col=3) ## unconstrained fit [#不受约束的契合]
  
## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-14 12:31 , Processed in 0.022013 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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