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

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

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

                                        Constructor for concave P-splines in SCAMs
                                         P-样条曲线的构造凹诈骗

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

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

This is a special method function for creating smooths subject to concavity constraint which is built by  the mgcv constructor function for smooth terms, smooth.construct.  It is constructed using concave P-splines. This smooth is specified via model terms such as  s(x,k,bs="cv",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="cv",m=2),这里k为基础尺寸和m+1是B样条基的顺序。


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


smooth.construct.cv.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 "cv.smooth".
对象的类"cv.smooth"。


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



Natalya Pya <nat.pya@gmail.com>




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



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

smooth.construct.cx.smooth.spec,  smooth.construct.mpi.smooth.spec, smooth.construct.mdcv.smooth.spec,  smooth.construct.mdcx.smooth.spec, smooth.construct.micx.smooth.spec,  smooth.construct.mpd.smooth.spec
smooth.construct.cx.smooth.spec,smooth.construct.mpi.smooth.spec,smooth.construct.mdcv.smooth.spec,smooth.construct.mdcx.smooth.spec,smooth.construct.micx.smooth.spec,smooth.construct.mpd.smooth.spec


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


## Not run: [#不运行:]
## Concave P-splines example [#凹P-样条曲线的例子]
  ## simulating data...[#模拟数据...]
   set.seed(1)
   n <- 100
   x <- sort(2*runif(n)-1)
   f <- -4*x^2
   y <- f + rnorm(n)*0.45
   dat <- data.frame(x=x,y=y)
   b <- scam(y~s(x,k=15,bs="cv",m=2),family=gaussian,data=dat)
   # UNCONSTRAINED FIT *****************[无约束FIT *****************]
   b1 <- scam(y~s(x,k=15,bs="cr",m=2),family=gaussian, data=dat)

## plot results ...[#图...]
   plot(x,y,xlab="x",ylab="y")
   lines(x,f)      ## the true function[#真正的功能]
   lines(x,b$fitted,col=2)  ## constrained fit [#制约适合]
   lines(x,b1$fitted,col=3) ## unconstrained fit [#不受约束的契合]

## Poisson version...[#泊松版本...]
   y <- rpois(n,15*exp(f))
   dat <- data.frame(x=x,y=y)
## fit model ...[#拟合模型...]
   b <- scam(y~s(x,k=15,bs="cv",m=2),family=poisson(link="log"),data=dat)

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

## plot results ...[#图...]
   plot(x,y,xlab="x",ylab="y")
   lines(x,15*exp(f))      ## the true function[#真正的功能]
   lines(x,b$fitted,col=2)  ## constrained fit [#制约适合]
   lines(x,b1$fitted,col=3) ## unconstrained fit [#不受约束的契合]

## plotting on log scale...[#对数刻度上绘制...]
   plot(x,log(15*exp(f)),type="l")      ## the true function[#真正的功能]
   lines(x,log(b$fitted),col=2)  ## constrained fit [#制约适合]
   lines(x,log(b1$fitted),col=3) ## unconstrained fit [#不受约束的契合]
  
## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-14 12:20 , Processed in 0.030207 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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