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

R语言 VGAM包 fsqrt()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 15:35:12 | 显示全部楼层 |阅读模式
fsqrt(VGAM)
fsqrt()所属R语言包:VGAM

                                         Folded Square Root Link Function
                                         倍数平方根链接功能

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

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

Computes the folded square root transformation, including its inverse and the first two derivatives.
计算倍数的平方根变换,包括其逆和前两个衍生物。


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


fsqrt(theta, earg = list(min = 0, max = 1, mux = sqrt(2)),
      inverse = FALSE, deriv = 0, short = TRUE, tag = FALSE)



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

参数:theta
Numeric or character. See below for further details.  
数字或字符。请参阅下面进一步的细节。


参数:earg
List with components min, max and mux. These are called L, U and K below.  
的组件列表min,max和mux。这些被称为L,U和K下面。


参数:inverse
Logical. If TRUE the inverse function is computed.  
逻辑。如果TRUE的逆函数计算。


参数:deriv
Order of the derivative. Integer with value 0, 1 or 2.  
订购的衍生工具。值0,1或2的整数,带。


参数:short
Used for labelling the blurb slot of a vglmff-class object.  
用于标签blurb插槽的vglmff-class对象。


参数:tag
Used for labelling the linear/additive predictor in the initialize slot of a vglmff-class object. Contains a little more information if TRUE.  
用于标注线性/对添加剂的预测在initialize插槽的vglmff-class对象。如果TRUE包含了一些信息。


Details

详细信息----------Details----------

The folded square root link function can be applied to parameters that lie between L and U inclusive. Numerical values of theta out of range result in NA or NaN.
倍数的平方根链接功能可以应用到参数介于L和U包容性。数值theta出范围NA或NaN。

The arguments short and tag are used only if theta is character.
的参数short和tag只有theta是字符。


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

For fsqrt with deriv = 0: K *  (sqrt(theta-L) - sqrt(U-theta)) or mux * (sqrt(theta-min) - sqrt(max-theta)) when inverse = FALSE, and if inverse = TRUE then some more complicated function that returns a NA unless theta is between -mux*sqrt(max-min) and mux*sqrt(max-min).
对于fsqrt与deriv = 0:K *  (sqrt(theta-L) - sqrt(U-theta))或mux * (sqrt(theta-min) - sqrt(max-theta))inverse = FALSE,而如果inverse = TRUE然后一些更复杂的函数,返回一个NA 除非theta是在-mux*sqrt(max-min)和mux*sqrt(max-min)之间。

For deriv = 1, then the function returns d theta / d eta as a function of theta if inverse = FALSE, else if inverse = TRUE then it returns the reciprocal.
对于deriv = 1,则该函数返回Dtheta / Deta的函数,theta如果inverse = FALSE如果inverse = TRUE然后它返回的倒数。


注意----------Note----------

The default has, if theta is 0 or 1, the link function value is -sqrt(2) and +sqrt(2) respectively. These are finite values, therefore one cannot use this link function for general modelling of probabilities because of numerical problem, e.g., with binomialff, cumulative. See the example below.
默认情况下,如果theta是0或1,链接函数值是-sqrt(2)和+sqrt(2)分别。这些值是有限的,因此,一个不能使用这个链接功能,对于一般的概率模型,因为数值的问题,例如,用binomialff,cumulative。请看下面的例子。


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


Thomas W. Yee



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

Links.
Links。


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


p = seq(0.01, 0.99, by = 0.01)
fsqrt(p)
max(abs(fsqrt(fsqrt(p), inverse = TRUE) - p)) # Should be 0[应为0]

p = c(seq(-0.02, 0.02, by = 0.01), seq(0.97, 1.02, by = 0.01))
fsqrt(p)  # Has NAs[有来港定居]

## Not run: [#不运行:]
p = seq(0.01, 0.99, by = 0.01)
par(mfrow = c(2, 2), lwd = (mylwd <- 2))
y = seq(-4, 4, length = 100)
for(d in 0:1) {
  matplot(p, cbind(logit(p, deriv = d), fsqrt(p, deriv = d)),
          type = "n", col = "purple", ylab = "transformation", las = 1,
          main = if (d == 0) "Some probability link functions"
          else "First derivative")
  lines(p, logit(p, deriv = d), col = "limegreen")
  lines(p, probit(p, deriv = d), col = "purple")
  lines(p, cloglog(p, deriv = d), col = "chocolate")
  lines(p, fsqrt(p, deriv = d), col = "tan")
  if (d == 0) {
    abline(v = 0.5, h = 0, lty = "dashed")
    legend(0, 4.5, c("logit", "probit", "cloglog", "fsqrt"), lwd = 2,
           col = c("limegreen","purple","chocolate", "tan"))
  } else
    abline(v = 0.5, lty = "dashed")
}

for(d in 0) {
  matplot(y, cbind(logit(y, deriv = d, inverse = TRUE),
                   fsqrt(y, deriv = d, inverse = TRUE)),
          type = "n", col = "purple", xlab = "transformation", ylab = "p",
          lwd = 2, las = 1,
          main = if (d == 0) "Some inverse probability link functions"
          else "First derivative")
  lines(y, logit(y, deriv = d, inverse = TRUE), col = "limegreen")
  lines(y, probit(y, deriv = d, inverse = TRUE), col = "purple")
  lines(y, cloglog(y, deriv = d, inverse = TRUE), col = "chocolate")
  lines(y, fsqrt(y, deriv = d, inverse = TRUE), col = "tan")
  if (d == 0) {
    abline(h = 0.5, v = 0, lty = "dashed")
    legend(-4, 1, c("logit", "probit", "cloglog", "fsqrt"), lwd = 2,
           col = c("limegreen","purple","chocolate", "tan"))
  }
}
par(lwd = 1)

## End(Not run)[#(不执行)]

# This is lucky to converge[这是幸运的收敛]
earg = list(min = 0, max = 1, mux = 5)
fit.h = vglm(agaaus ~ bs(altitude),
             fam =  binomialff(link = "fsqrt", earg = earg),
             data = hunua, trace = TRUE)
## Not run: [#不运行:]
plotvgam(fit.h, se = TRUE, lcol = "orange", scol = "orange",
         main = "Orange is Hunua, Blue is Waitakere")
## End(Not run)[#(不执行)]
head(predict(fit.h, hunua, type = "response"))


## Not run: [#不运行:]
# The following fails.[下面的失败。]
pneumo = transform(pneumo, let = log(exposure.time))
earg = list(min = 0, max = 1, mux = 10)
fit = vglm(cbind(normal, mild, severe) ~ let,
           cumulative(link = "fsqrt", earg = earg, par = TRUE, rev = TRUE),
           data = pneumo, trace = TRUE, maxit = 200)
## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 19:24 , Processed in 0.020458 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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