ldTweedie(mgcv)
ldTweedie()所属R语言包:mgcv
Log Tweedie density evaluation
登录特威迪密度评价
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A function to evaluate the log of the Tweedie density for variance powers between 1 and 2, inclusive. Also evaluates first and second derivatives of log density w.r.t. its scale parameter.
函数评估为1和2之间,包容的变异权力的特威迪密度日志。也第一次和第二次评估的记录密度WRT衍生物其规模的参数。
用法----------Usage----------
ldTweedie(y,mu=y,p=1.5,phi=1)
参数----------Arguments----------
参数:y
values at which to evaluate density.
评估密度值。
参数:mu
corresponding means (either of same length as y or a single value).
(任y或一个单一的值相同长度),相应的手段。
参数:p
the variance of y is proportional to its mean to the power p. p must be between 1 and 2. 1 is Poisson like (exactly Poisson if phi=1), 2 is gamma.
的y差异是成正比的平均电源p。 p必须是1和2之间。 1泊松像(完全泊松如果phi=1),二是伽马。
参数:phi
The scale parameter. Variance of y is phi*mu^p.
尺度参数。 y方差phi*mu^p。
Details
详情----------Details----------
A Tweedie random variable with 1<p<2 is a sum of N gamma random variables where N has a Poisson distribution. The p=1 case is a generalization of a Poisson distribution and is a discrete distribution supported on integer multiples of the scale parameter. For 1<p<2 the distribution is supported on the positive reals with a point mass at zero. p=2 is a gamma distribution. As p gets very close to 1 the continuous distribution begins to converge on the discretely supported limit at p=1.
一个特威迪随机变量1 <p <2时是N伽玛随机变量的总和,其中N泊松分布。 p = 1的情况下是一个概括和泊松分布是离散分布的尺度参数的整数倍的支持。 1 <P <2分布在零点质量的积极雷亚尔支持。 P = 2是一个伽玛分布。为P变得非常接近1开始的连续分布收敛谨慎支持的限制,在P = 1。
ldTweedie is based on the series evaluation method of Dunn and Smyth (2005). Without the restriction on p the calculation of Tweedie densities is less straightforward. If you really need this case then the tweedie package is the place to start.
ldTweedie邓恩和史密斯(2005)基于一系列的评估方法。没有限制p的特威迪密度的计算方法是那么直观。如果你真的需要这种情况然后tweedie包开始的地方,。
值----------Value----------
A matrix with 3 columns. The first is the log density of y (log probability if p=1).
一个3列的矩阵。首先是日志密度(日志概率y如果p=1)。
作者(S)----------Author(s)----------
Simon N. Wood <a href="mailto:simon.wood@r-project.org">simon.wood@r-project.org</a>
modified from Venables and Ripley's <code>negative.binomial</code> family.
参考文献----------References----------
Statistics and Computing 15:267-280
some important exponential families. Statistics: Applications and New Directions. Proceedings of the Indian Statistical Institute Golden Jubilee International Conference (Eds. J. K. Ghosh and J. Roy), pp. 579-604. Calcutta: Indian Statistical Institute.
举例----------Examples----------
library(mgcv)
## convergence to Poisson illustrated[#收敛泊松图文并茂]
## notice how p>1.1 is OK[#注意P> 1.1是确定]
y <- seq(1e-10,10,length=1000)
p <- c(1.0001,1.001,1.01,1.1,1.2,1.5,1.8,2)
phi <- .5
fy <- exp(ldTweedie(y,mu=2,p=p[1],phi=phi)[,1])
plot(y,fy,type="l",ylim=c(0,3),main="Tweedie density as p changes")
for (i in 2:length(p)) {
fy <- exp(ldTweedie(y,mu=2,p=p[i],phi=phi)[,1])
lines(y,fy,col=i)
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|