smooth.construct.tesmd1.smooth.spec(scam)
smooth.construct.tesmd1.smooth.spec()所属R语言包:scam
Tensor product smoothing constructor for a bivariate function monotone decreasing in the first covariate
张量积平滑构造一个二元函数的单调下降,第一协
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This is a special method function for creating tensor product bivariate smooths monotone decreasing in the first covariate which is built by the mgcv constructor function for smooth terms, smooth.construct. It is constructed from a pair of single penalty marginal smooths. This tensor product is specified by model terms such as s(x1,x2,k=c(q1,q2),bs="tesmd1",m=2).
这是一个特殊的方法,建立张量积二元函数平滑单调递减在第一的协变量是建立在mgcv的构造函数的光滑条款,smooth.construct。这是构建从对单节罚边缘平滑。此张量积指定的模型如s(x1,x2,k=c(q1,q2),bs="tesmd1",m=2)。
用法----------Usage----------
smooth.construct.tesmd1.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 "tesmd1.smooth". In addition to the usual elements of a smooth class documented under smooth.construct of the mgcv library, this object contains:
对象的类"tesmd1.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.
矩阵的可识别性约束。
参数:margin.class
The class of the second unconstrained marginal smooth.
不受约束的边缘平滑的第二类。
(作者)----------Author(s)----------
Natalya Pya <nat.pya@gmail.com>
参考文献----------References----------
参见----------See Also----------
smooth.construct.tesmd2.smooth.spec
smooth.construct.tesmd2.smooth.spec
实例----------Examples----------
## Not run: [#不运行:]
## tensor product `tesmd1' example [#张量积tesmd1“的例子]
## 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 ...[#拟合模型...]
b <- scam(y~s(x1,x2,k=c(10,10),bs="tesmd1",m=2),
family=gaussian(link="identity"), data=dat,sp=NULL)
## plot results ...[#图...]
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:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|