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

R语言:formula.gam()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 20:41:19 | 显示全部楼层 |阅读模式
formula.gam(mgcv)
formula.gam()所属R语言包:mgcv

                                        GAM formula
                                         自由亚齐运动公式

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

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

Description of gam formula (see Details), and how to extract it from a fitted gam object.
说明gam公式(见详情),以及如何提取它从一个装有gam对象。


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


## S3 method for class 'gam'
formula(x,...)



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

参数:x
fitted model objects of class gam (see gamObject) as produced by gam().
拟合模型对象类gam(见gamObject)gam()生产。


参数:...
un-used in this case  
在这种情况下,未使用


Details

详情----------Details----------

The formula supplied to gam is exactly like that supplied to  glm except that smooth terms, s and te can be added to the right hand side (and . is not supported in gam formulae).
公式提供的gam完全一样,提供的除了顺利条款,glms和te可以添加到右边的(和.的gam公式)不支持。

Smooth terms are specified by expressions of the form: <br> s(x1,x2,...,k=12,fx=FALSE,bs="tp",by=z,id=1)<br> where x1, x2, etc. are the covariates which the smooth is a function of, and k is the dimension of the basis used to represent the smooth term. If k is not specified then basis specific defaults are used.   fx is used to indicate whether or not this term should be unpenalized,  and therefore have a fixed number of degrees of freedom set by k  (almost always k-1). bs indicates the basis to use for the smooth: the built in options are described in smooth.terms, and user defined  smooths can be added (see user.defined.smooth). If bs is not supplied  then the default "tp" (tprs) basis is used.  by can be used to specify a variable by which the smooth should be multiplied. For example gam(y~s(x,by=z)) would specify a model E(y)=f(x)z where f(.) is a smooth function. The by  option is particularly useful for models in which different functions of the same variable are required for each level of a factor and for "varying coefficient models": see gam.models.  id is used to give smooths identities: smooths with the same identity have the same basis, penalty and smoothing parameter (but different coefficients, so they are  different functions).
光滑的条款指定的形式表达:参考s(x1,x2,...,k=12,fx=FALSE,bs="tp",by=z,id=1)x1,x2等的协变量,这是顺利的功能,k是用来代表顺利长期的基础维度。如果k不指定,则依据特定的默认。 ,fx用于指示应unpenalized与否这个词,因此有一个固定的自由度设置k(几乎总是k-1)。 bs表示的基础上顺利使用:内置期权smooth.terms,可以添加用户定义的平滑(见user.defined.smooth)。 bs如果没有提供,则默认的"tp"(tprs)的基础上使用。 by可用于指定变量,其中应乘以顺利。例如gam(y~s(x,by=z))指定一个模型E(y)=f(x)z其中f(.)是一个光滑函数。在同一变量的不同功能需要为每一个因素的水平,并为变系数模型“模型:见bygam.models选项是特别有用。 id用来给平滑的身份:具有相同标识的平滑有相同的基础上,罚款和平滑参数(但不同的系数,所以他们不同的功能)。

An alternative for specifying smooths of more than one covariate is e.g.: <br> te(x,z,bs=c("tp","tp"),m=c(2,3),k=c(5,10))<br> which would specify a tensor product  smooth of the two covariates x and z constructed from marginal t.p.r.s. bases  of dimension 5 and 10 with marginal penalties of order 2 and 3. Any combination of basis types is  possible, as is any number of covariates. te provides further information.
指定替代平滑如多个协变量:参考te(x,z,bs=c("tp","tp"),m=c(2,3),k=c(5,10))参考这两个变项x和z构造的边际TPRS顺利将指定张量积5维基地和10 2和第3阶的边际处罚。基础类型的任何组合是可能的,是任何数量的协变量。 te提供进一步的信息。

Both s and te terms accept an sp argument of supplied smoothing parameters: positive  values are taken  as fixed values to be used, negative to indicate that the parameter should be estimated. If sp is supplied then it over-rides whatever is in the sp argument to gam, if it is not supplied  then it defaults to all negative, but does not over-ride the sp argument to gam.
既s和te条款接受sp提供平滑参数的参数:要使用的固定值,负,表明该参数应估计采取正面的价值观。如果sp然后它提供过度的游乐设施,无论是在sp参数gam,如果它没有提供,则默认均为阴性,但并不比坐 spgam的说法。

Formulae can involve nested or &ldquo;overlapping&rdquo; terms such as <br> y~s(x)+s(z)+s(x,z) or y~s(x,z)+s(z,v):<br> see gam.side for further details and examples.
公式可以涉及嵌套或“重叠”等方面作为参考y~s(x)+s(z)+s(x,z)或y~s(x,z)+s(z,v):参考见gam.side为进一步的细节和例子。

Smooth terms in a gam formula will accept matrix arguments as covariates (and corresponding by variable),  in which case a "summation convention" is invoked. Consider the example of s(X,Z,by=L) where X, Z and L are n by m matrices. Let F be the n by m matrix that results from evaluating the smooth at the values in  X and Z. Then the contribution to the linear predictor from the term will be rowSums(F*L) (note the element-wise multiplication). This convention allows the linear predictor of the GAM to depend on (a discrete approximation to) any linear functional of a smooth: see linear.functional.terms for more information and examples (including functional linear models/signal regression).
gam公式顺利接受矩阵参数作为协变量(和对应的by变量),在这种情况下,“求和约定”被调用。考虑s(X,Z,by=L)其中X,Z和LM矩阵n个例子。让Fm矩阵列印,在值X和Z的顺利评估的结果。然后线性预测从长远的贡献将是rowSums(F*L)(注意元素的乘法)。该公约允许“自由亚齐运动的线性预测取决于(离散近似)任何一个平稳的线性泛函:linear.functional.terms更多的信息和例子(包括功能的线性模型/信号回归)。

Note that gam allows any term in the model formula to be penalized (possibly by multiple penalties),  via the paraPen argument. See  gam.models for details and example code.
请注意,gam允许任何模型公式中的长期受到惩罚(可能是由多个处罚),通过paraPen参数。看到gam.models细节和示例代码。


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

Returns the model formula, x$formula. Provided so that anova methods print an appropriate description of the model.
返回的模型公式,x$formula。 anova方法,使打印一个适当的模型描述。


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


Simon N. Wood <a href="mailto:simon.wood@r-project.org">simon.wood@r-project.org</a>



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

gam
gam

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 11:46 , Processed in 0.023292 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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