tweedie.profile(tweedie)
tweedie.profile()所属R语言包:tweedie
Tweedie Distributions: mle estimation of p
特威迪分布:MLE估计的p
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Maximum likelihood estimation of the Tweedie index parameter power.
最大似然估计的特威迪指标参数power。
用法----------Usage----------
data, weights, offset, fit.glm=FALSE,
do.smooth=TRUE, do.plot=FALSE, do.ci=do.smooth,
eps=1/6, do.points=do.plot, method="inversion", conf.level=0.95,
phi.method=ifelse(method == "saddlepoint", "saddlepoint", "mle"),
参数----------Arguments----------
参数:formula
a formula expression as for other regression models and generalized linear models, of the form response ~ predictors. For details, see the documentation for lm, glm and formula
其他回归模型和广义线性模型,公式表达形式response ~ predictors。有关详细信息,请参阅文档lm,glm和formula
参数:p.vec
a vector of p values for consideration. The values must all be larger than one (if the response variable has exact zeros, the values must all be between one and two). If NULL (the default), p.vec is set to seq(1.2, 1.8, by=0.1) if the response contains any zeros, or seq(1.5, 5, by=0.5) if the response contains no zeros. See the DETAILS section below for further details.
p值考虑的向量。值都必须是大于1(如果响应变量的值有确切的零,都必须在1和2之间)。如果响应中包含任何零或如果NULL(默认值),p.vec设置为seq(1.2, 1.8, by=0.1) seq(1.5, 5, by=0.5)如果响应不包含零。请参阅下面的细节部分进一步的细节。
参数:xi.vec
the same as p.vec; some authors use the p notation for the index parameter, and some use xi; this function detects which is used and then uses that notation throughout
一样的p.vec;一些作者使用p符号的索引参数,和一些使用xi;使用此功能检测,然后使用该符号在整个
参数:link.power
the power link function to use. These link functions g() are of the form g(eta) = eta^link.power, and the special case of link.power=0 (the default) refers to the logarithm link function. See the documentation for tweedie also.
使用的电源连接功能。这些链接功能g()的形式g(eta) = eta^link.power,的特殊情况下,link.power=0(默认值)是指对数链接的功能。请参阅文档tweedie也。
参数:data
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which glm is called.
一个可选的数据框,列表或环境(或as.data.frame到数据框的对象强制转换),其中包含在模型中的变量。如果没有找到data,变量environment(formula),通常是glm被称为环境。
参数:weights
an optional vector of weights to be used in the fitting process. Should be NULL or a numeric vector.
在嵌合过程中要使用可选的权重向量。应该是NULL或数字向量。
参数:offset
this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length either one or equal to the number of cases. One or more offset terms can be included in the formula instead or as well, and if both are specified their sum is used. See model.offset.
这可以被用来指定一个先验已知的组件被包括在配合期间的线性预测。这应该是NULL或或一方的情况下的数量等于一个数值向量的长度。 offset条款一个或多个可以包括在公式中,而不是或以及,如果两者都指定使用它们的总和。见model.offset。
参数:fit.glm
logical flag. If TRUE, the Tweedie generalized linear model is fitted using the value of p found by the profiling function. If FALSE (the default), no model is fitted.
逻辑标志。如果TRUE,特威迪广义线性模型安装使用的价值p找到的分析功能。如果FALSE(默认值),没有模型拟合。
参数:do.smooth
logical flag. If TRUE (the default), a spline is fitted to the data to smooth the profile likelihood plot. If FALSE, no smoothing is used (and the function is quicker). Note that p.vec must contain at least five points for smoothing to be allowed.
逻辑标志。如果TRUE(默认值),样条拟合数据,顺利的档案可能性图。如果FALSE,不进行平滑处理(和功能是更快)。请注意p.vec必须包含至少5个点的平滑就可以了。
参数:do.plot
logical flag. If TRUE, a plot of the profile likelihood is produce. If FALSE (the default), no plot is produced.
逻辑标志。如果TRUE,一个图的配置文件的可能性产生。如果FALSE(默认值),没有图的生产。
参数:do.ci
logical flag. If TRUE, the nominal 100*conf.level is computed. If FALSE, no confidence interval is computed. By default, do.ci is the same value as do.smooth, since a confidence interval will only be accurate if smoothing has been performed. Indeed, if do.smooth=FALSE, confidence intervals are never computed and do.ci is forced to FALSE if it is given as TRUE.
逻辑标志。如果TRUE,面值100 *conf.level计算。如果FALSE,不置信区间的计算。默认情况下,do.ci是相同的值do.smooth,因为只会是准确的,如果已进行平滑的置信区间。事实上,如果do.smooth=FALSE,置信区间是从来没有计算和do.ci被迫FALSE,如果TRUE。
参数:eps
the offset in computing the variance function. The default is eps=1/6 (as suggested by Nelder and Pregibon, 1987). Note eps is ignored unless the method="saddlepoint" as it makes no sense otherwise.
中的偏移量计算方差函数。默认值是eps=1/6(如建议通过内尔德Pregibon,1987)。注意eps被忽略,除非method="saddlepoint",因为它是没有意义的,否则。
参数:do.points
plot the points on the plot where the (log-) likelihood is computed for the given values of p; defaults to the same value as do.plot
绘制的点的上图(log)的可能性是计算给定值的p默认为相同的值do.plot
参数:method
the method for computing the (log-) likelihood. One of "series", "inversion" (the default), "interpolation" or "saddlepoint". If there are any troubles using this function, often a change of method will fix the problem. Note that method="saddlepoint" is only an approximate method for computing the (log-) likelihood. Using method="interpolation" may produce a jump in the profile likelihood as it changes computational regimes.
用于计算(log)的可能性的方法。之一"series","inversion"(默认值),"interpolation"或"saddlepoint"。如果有任何麻烦,使用此功能时,往往是一个变化的方法将解决这个问题。请注意,method="saddlepoint"只是一个近似方法计算(log)的可能性。使用method="interpolation"可能会产生跳配置文件中的可能性,因为它改变了计算制度。
参数:conf.level
the confidence level for the computation of the nominal confidence interval. The default is conf.level=0.95.
的置信水平为计算的标称的置信区间。默认的conf.level=0.95。
参数:phi.method
the method for estimating phi, one of "saddlepoint" or "mle". A maximum likelihood estimate is used unless method="saddlepoint", when the saddlepoint approximation method is used. Note that using phi.method="saddlepoint" is equivalent to using the mean deviance estimator of phi.
方法推定phi,1"saddlepoint"或"mle"。最大似然估计的使用,除非method="saddlepoint",鞍点近似方法。注意使用phi.method="saddlepoint"是等价的平均偏差估计phi。
参数:verbose
the amount of feedback requested: 0 or FALSE means minimal feedback (the default), 1 or TRUE means some feedback, or 2 means to show all feedback. Since the function can be slow and sometimes problematic, feedback can be good; but it can also be unnecessary when one knows all is well.
反馈量要求:0或FALSE是指反馈最小的(默认值),1或TRUE是指一些反馈,或2是指显示所有反馈意见。由于该函数可以是缓慢的,有时也会出现问题,反馈可以是良好的,但它也可以是不必要的,当一个人知道一切都很好。
参数:add0
if TRUE, the value p=0 is used in forming the profile lohg-likelihood (corresponding to the normal distribution); the default value is add0=FALSE
如果TRUE,值p=0使用中形成的档案lohg似然(对应于正态分布),默认值是add0=FALSE
Details
详细信息----------Details----------
For each value in p.vec, the function computes an estimate of phi and then computes the value of the log-likelihood for these parameters. The plot of the log-likelihood against p.vec allows the maximum likelihood value of p to be found. Once the value of p is found, the distribution within the class of Tweedie distribution is identified.
在p.vec对于每一个值,该函数计算估计phi,然后计算这些参数的值的对数似然。对数似然p.vec的图允许的最大似然值p被发现。 p的值一旦发现,Tweedie分布的类内的分布被确定。
值----------Value----------
The main purpose of the function is to estimate the value of the Tweedie index parameter, p, which is produced by the output list as p.max. Optionally (if do.plot=TRUE), a plot is produced that shows the profile log-likelihood computed at each value in p.vec (smoothed if do.smooth=TRUE). This function can be tempermental (for theoretical reasons involved in numerically computing the density), and this plot shows the values of p requested on the horizontal axis (using rug); there may be fewer points on the plot, since the likelihood some values of p requested may have returned NaN, Inf or NA.
该函数的主要目的,是估计值的的特威迪索引参数,p,它是通过在输出列表作为p.max。可选的(如果do.plot=TRUE),有一个图是显示配置文件中的每个值计算对数似然p.vec(如果do.smooth=TRUE平滑)。这个功能可以tempermental的理论原因,涉及数值计算密度,图中显示的值p要求的水平轴(rug);有可能是少点图的可能性,因为一些值p要求可能会返回NaN,Inf或NA。
A list containing the components: y and x (such that plot(x,y) (partially) recreates the profile likelihood plot); ht (the height of the nominal confidence interval); L (the estimate of the (log-) likelihood at each given value of p); p (the p-values used); phi (the computed values of phi at the values in p); p.max (the estimate of the mle of p); L.max (the estimate of the (log-) likelihood at p.max); phi.max (the estimate of phi at p.max); ci (the lower and upper limits of the confidence interval for p); method (the method used for estimation: series, inversion, interpolation or saddlepoint); phi.method (the method used for estimation of phi: saddlepoint or phi).
一个列表,其中包含的组件:y和x(如plot(x,y)(部分)重新创建配置文件的可能性图); ht(高度的名义置信区间); L(在每个给定值(log)的可能性的估计p)p(p值); phi( phi中的值p)p.max(估计的极大似然估计p),“L.max(估计(计算值数)在p.max);phi.max(估计phip.max);ci(的置信区间的下限和上限的可能性p)method(该方法用于估算:series,inversion,interpolation或saddlepoint)phi.method(所采用的方法估计phi:saddlepoint或phi的)。
If glm.fit is TRUE, the list also contains a component glm.obj, a glm object for the fitted Tweedie generalized linear model.
如果glm.fit是TRUE,名单中还含有一种成分glm.obj,glm对象为拟合的的特威迪广义线性模型。
注意----------Note----------
The estimates of p and phi are printed. The result is printed invisibly.
p和phi打印的估计。打印的结果是不可见的。
If the response variable has any exact zeros, the values in p.vec must all be between one and two.
如果响应变量具有任何确切零,中p.vec的值必须在1和2之间。
The function is sometimes unstable and may fail. It may also be very slow. One solution is to change the method. The default is method="inversion" (the default); then try method="series", method="interpolation" and method="saddlepoint" in that order. Note that method="saddlepoint" is an approximate method only. Also make sure the values in p.vec are suitable for the data (see above paragraph).
的功能有时是不稳定的,并可能会失败。它也可能是很慢的。一种解决方案是改变的方法。默认值是method="inversion"(默认值),然后尝试method="series",method="interpolation"和method="saddlepoint"的顺序。需要注意的是method="saddlepoint"仅是一种近似方法。另外,还要确保中的值p.vec适合的数据(参见上段)。
It is recommended that for the first use with a data set, use p.vec with only a small number of values and set do.smooth=FALSE, do.ci=FALSE. If this is successful, a larger vector p.vec and smoothing can be used.
它建议,对于第一次使用的数据集,使用p.vec只有一小数量的值,并设置do.smooth=FALSE,do.ci=FALSE。如果这是成功的,一个更大的向量p.vec和平滑可以使用。
(作者)----------Author(s)----------
Peter Dunn (<a href="mailto:pdunn2@usc.edu.au">pdunn2@usc.edu.au</a>)
参考文献----------References----------
Evaluation of Tweedie exponential dispersion model densities by Fourier inversion. Statistics and Computing, 18, 73–86.
Tweedie family densities: methods of evaluation. Proceedings of the 16th International Workshop on Statistical Modelling, Odense, Denmark, 2–6 July
Exponential dispersion models. Journal of the Royal Statistical Society, B, 49, 127–162.
Theory of Dispersion Models. Chapman and Hall, London.
An extended quasi-likelihood function. Biometrika 74(2), 221–232.
An index which distinguishes between 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.
参见----------See Also----------
dtweedie, dtweedie.saddle, tweedie
dtweedie,dtweedie.saddle,tweedie
实例----------Examples----------
library(statmod) # Needed to use tweedie.profile[需要使用tweedie.profile的]
# Generate some fictitious data[生成一些虚拟的数据]
test.data <- rgamma(n=200, scale=1, shape=1)
# The gamma is a Tweedie distribution with power=2;[伽马是一个Tweedie分布与功率= 2;]
# let's see if p=2 is suggested by tweedie.profile:[让我们来看看,如果p = 2,建议由tweedie.profile:]
## Not run: [#不运行:]
out <- tweedie.profile( test.data ~ 1,
p.vec=seq(1.5, 2.5, by=0.2) )
out$p.max
out$ci
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|