smooth.construct.tedmd.smooth.spec(scam)
smooth.construct.tedmd.smooth.spec()所属R语言包:scam
Tensor product smoothing constructor for bivariate function subject to double monotone decreasing constraint
张量积的平滑构造函数为二元函数的主体一倍单调递减的约束
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This is a special method function for creating tensor product bivariate smooths subject to double monotone decreasing constraints which is built by the mgcv constructor function for smooth terms, smooth.construct. It is constructed from a pair of single penalty marginal smooths which are represented using the B-spline basis functions. This tensor product is specified by model terms such as s(x1,x2,k=c(q1,q2),bs="tedmd",m=c(2,2)),
这是一个特殊的方法,建立张量积二元函数平滑受到双重单调递减是建立在mgcv的构造函数的光滑条款的约束,smooth.construct。这单罚款边缘平滑使用的B-样条基函数是表示从对构成。张量积指定的模型如s(x1,x2,k=c(q1,q2),bs="tedmd",m=c(2,2)),
用法----------Usage----------
smooth.construct.tedmd.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 values of the elements of object$term, with names given by object$term.
一个数据框或列表,其中包含的值的元素object$term,的名字的object$term。
参数:knots
An optional list containing the knots corresponding to object$term. If it is NULL then the knot locations are generated automatically.
一个可选的列表,其中包含对应的结object$term。如果是NULL然后结位置自动生成。
值----------Value----------
An object of class "tedmd.smooth". In addition to the usual elements of a smooth class documented under smooth.construct of the mgcv library, this object contains:
对象的类"tedmd.smooth"。除了通常的记录下顺利类元素smooth.constructmgcv图书馆,此对象包含:
参数:p.ident
A vector of 0's and 1's for model parameter identification: 1's indicate parameters which will be exponentiated, 0's - otherwise.
0和1的模型参数识别的矢量:1表示这将是指数化的参数,0 - 否则。
参数:Zc
A matrix of identifiability constraints.
矩阵的可识别性约束。
(作者)----------Author(s)----------
Natalya Pya <nat.pya@gmail.com>
参考文献----------References----------
参见----------See Also----------
smooth.construct.tedmi.smooth.spec
smooth.construct.tedmi.smooth.spec
实例----------Examples----------
## Not run: [#不运行:]
## tensor product `tedmd' example [#张量积tedmd“的例子]
## 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*exp(x2[j]-0.5)}
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 ...[#拟合模型...]
b <- scam(y~s(x1,x2,k=c(10,10),bs="tedmd",m=2),
family=gaussian(link="identity"), data=dat)
## plot results ...[#图...]
par(mfrow=c(2,2),mar=c(4,4,2,2))
plot(b,se=TRUE)
plot(b,pers=TRUE,theta = 80, 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:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|