amlnormal(VGAM)
amlnormal()所属R语言包:VGAM
Asymmetric Least Squares Quantile Regression
非对称最小二乘位数回归
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Asymmetric least squares, a special case of maximizing an asymmetric likelihood function of a normal distribution. This allows for expectile/quantile regression using asymmetric least squares error loss.
不对称最小二乘,最大化的不对称的正常分布的似然函数的一种特殊情况。这允许使用非对称最小平方误差损失为expectile /分位数回归。
用法----------Usage----------
amlnormal(w.aml = 1, parallel = FALSE, lexpectile = "identity",
eexpectile = list(), iexpectile = NULL, imethod = 1, digw = 4)
参数----------Arguments----------
参数:w.aml
Numeric, a vector of positive constants controlling the percentiles. The larger the value the larger the fitted percentile value (the proportion of points below the “w-regression plane”). The default value of unity results in the ordinary least squares (OLS) solution.
数字,正数的向量控制的百分。该值越大,拟合的百分位数的值(以下的“w回归平面的点的比例”)越大。在普通最小二乘法(OLS)的默认值统一结果的解决方案。
参数:parallel
If w.aml has more than one value then this argument allows the quantile curves to differ by the same amount as a function of the covariates. Setting this to be TRUE should force the quantile curves to not cross (although they may not cross anyway). See CommonVGAMffArguments for more information.
如果w.aml有一个以上的值,则此参数允许不同的协变量的函数相同数额的位数曲线。设置TRUE应该迫使位数曲线不交叉(尽管他们可能不能跨越反正)。见CommonVGAMffArguments更多信息。
参数:lexpectile, eexpectile, iexpectile
See CommonVGAMffArguments for more information.
见CommonVGAMffArguments更多信息。
参数:imethod
Integer, either 1 or 2 or 3. Initialization method. Choose another value if convergence fails.
整数,1或2或3。初始化方法。选择另一个值,如果收敛失败。
参数:digw
Passed into Round as the digits argument for the w.aml values; used cosmetically for labelling.
传递到Rounddigits参数w.aml的值;用于美容标签。
Details
详细信息----------Details----------
This is an implementation of Efron (1991) and full details can be obtained there. Equation numbers below refer to that article. The model is essentially a linear model (see lm), however, the asymmetric squared error loss function for a residual r is r^2 if r <= 0 and w*r^2 if r > 0. The solution is the set of regression coefficients that minimize the sum of these over the data set, weighted by the weights argument (so that it can contain frequencies). Newton-Raphson estimation is used here.
这是一个实现埃夫隆(1991),和全部细节可以有以下方式获得。下面的公式编号是指该文章。模型基本上是线性模型(见lm),但是,非对称的平方误差损失函数的残留r是r^2如果r <= 0和w*r^2如果r > 0。该解决方案是这些的总和最小化的回归系数,在数据集,由weights参数(因此,它可以包含频率)加权集。这里使用Newton-Raphson法估计。
值----------Value----------
An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm and vgam.
类的一个对象"vglmff"(见vglmff-class)。该对象被用于建模功能如vglm和vgam。
注意----------Note----------
On fitting, the extra slot has list components "w.aml" and "percentile". The latter is the percent of observations below the “w-regression plane”, which is the fitted values.
配件,extra插槽列表组件"w.aml"和"percentile"。后者是%以下的“w回归平面”,这是对于拟合值的观测。
One difficulty is finding the w.aml value giving a specified percentile. One solution is to fit the model within a root finding function such as uniroot; see the example below.
困难之一是寻找w.aml值给指定的百分。一种解决方案是适合的模型,根内发现的功能,如uniroot;见下面的例子。
For amlnormal objects, methods functions for the generic functions qtplot and cdf have not been written yet.
对于amlnormal对象,方法,功能的通用功能qtplot和cdf还没有被写入尚未。
See the note in amlpoisson on the jargon, including expectiles and regression quantiles.
请参阅amlpoisson的术语,包括expectiles和回归位数中的注意事项。
The deviance slot computes the total asymmetric squared error loss (2.5). If w.aml has more than one value then the value returned by the slot is the sum taken over all the w.aml values.
deviance时隙计算的总的非对称的平方误差损失(2.5)。如果w.aml有一个以上的值,然后插槽返回的值是在所有的w.aml值的总和。
This VGAM family function could well be renamed amlnormal() instead, given the other function names amlpoisson, amlbinomial, etc.
这VGAM家庭功能很可能被重新命名amlnormal(),而是考虑到其他的函数名amlpoisson,amlbinomial,等
In this documentation the word quantile can often be interchangeably replaced by expectile (things are informal here).
在本文档中字位数经常被交替更换expectile(这里的东西都是非正式的)。
(作者)----------Author(s)----------
Thomas W. Yee
参考文献----------References----------
Regression percentiles using asymmetric squared error loss. Statistica Sinica, 1, 93–125.
参见----------See Also----------
amlpoisson, amlbinomial, amlexponential, bmi.nz, alaplace1, denorm, lms.bcn and similar variants are alternative methods for quantile regression.
amlpoisson,amlbinomial,amlexponential,bmi.nz,alaplace1,denorm,lms.bcn和相似的变种,分位数回归的替代方法。
实例----------Examples----------
# Example 1[例1]
ooo = with(bmi.nz, order(age))
bmi.nz = bmi.nz[ooo,] # Sort by age[按年龄排序]
(fit = vglm(BMI ~ bs(age), fam=amlnormal(w.aml=0.1), bmi.nz))
fit@extra # Gives the w value and the percentile[给人的W值的百分]
coef(fit, matrix=TRUE)
## Not run: [#不运行:]
# Quantile plot[分量图]
with(bmi.nz, plot(age, BMI, col="blue", main=
paste(round(fit@extra$percentile, dig=1),
"expectile-percentile curve")))
with(bmi.nz, lines(age, c(fitted(fit)), col="black"))
## End(Not run)[#(不执行)]
# Example 2[例2]
# Find the w values that give the 25, 50 and 75 percentiles[25,50和75百分位数的w值,让]
findw = function(w, percentile=50) {
fit2 = vglm(BMI ~ bs(age), fam=amlnormal(w=w), data=bmi.nz)
fit2@extra$percentile - percentile
}
## Not run: [#不运行:]
# Quantile plot[分量图]
with(bmi.nz, plot(age, BMI, col="blue", las=1, main=
"25, 50 and 75 expectile-percentile curves"))
## End(Not run)[#(不执行)]
for(myp in c(25,50,75)) {
# Note: uniroot() can only find one root at a time[注:uniroot()只能找到一个根在]
bestw = uniroot(f=findw, interval=c(1/10^4, 10^4), percentile=myp)
fit2 = vglm(BMI ~ bs(age), fam=amlnormal(w=bestw$root), data=bmi.nz)
## Not run: [#不运行:]
with(bmi.nz, lines(age, c(fitted(fit2)), col="red"))
## End(Not run)[#(不执行)]
}
# Example 3; this is Example 1 but with smoothing splines and[例3,这是例1,但与平滑样条曲线和]
# a vector w and a parallelism assumption.[向量w和假设的平行度。]
ooo = with(bmi.nz, order(age))
bmi.nz = bmi.nz[ooo,] # Sort by age[按年龄排序]
fit3 = vgam(BMI ~ s(age, df=4), fam=amlnormal(w=c(.1,1,10), parallel=TRUE),
bmi.nz, trac=TRUE)
fit3@extra # The w values, percentiles and weighted deviances[w值,百分位值和加权deviances]
# The linear components of the fit; not for human consumption:[非线性元件的契合,而不是供人食用:]
coef(fit3, matrix=TRUE)
## Not run: [#不运行:]
# Quantile plot[分量图]
with(bmi.nz, plot(age, BMI, col="blue", main=
paste(paste(round(fit3@extra$percentile, dig=1), collapse=", "),
"expectile-percentile curves")))
with(bmi.nz, matlines(age, fitted(fit3), col=1:fit3@extra$M, lwd=2))
with(bmi.nz, lines(age, c(fitted(fit )), col="black")) # For comparison[为了便于比较]
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|