SEL(SEL)
SEL()所属R语言包:SEL
Semiparametric Elicitation of a bounded parameter
有界参数半参数启发式
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Fits a distribution to quantiles (stated for example by an expert) using B-splines with a Brier entropy penalty.
适合分配给位数(例如专家表示),使用B样条与石南木熵处罚。
There exists a print and a summary method to display details of the fitted SEL object. The fitted density (or cdf) can be displayed with the plot method. Different SEL objects can be displayed in one plot with the comparePlot function. The fitted density (or cdf) can be evaluated with the predict method. The coef method extracts the coefficients of the fitted B-spline basis. The quantSEL function calculates quantiles of the fitted distribution and the rvSEL function generates random variables from a fitted SEL object.
存在一个print和summary方法的装SEL对象的显示细节。装密度(CDF)可显示与plot方法。与comparePlot功能积于一身,可以显示不同的SEL对象。装密度(CDF)与predict方法,可以评估。 coef方法提取的装B样条基的系数。 quantSEL函数计算位数的拟合分布,,和rvSEL功能生成随机变量从一个装有SEL对象。
用法----------Usage----------
SEL(x, alpha, bounds = c(0, 1), d = 4, inknts = x, N, gamma, Delta,
fitbnds = c(1e-8, 10)*diff(bounds), pistar = NULL,
constr = c("none", "unimodal", "decreasing", "increasing"),
mode)
参数----------Arguments----------
参数:x
Numeric vector of quantiles.
数字矢量位数。
参数:alpha
Numeric vector determining the levels of the quantiles specified in x.
数字矢量确定在x指定位数的水平。
参数:bounds
Vector containing the bounds for the expert's density.
Vector,其中包含专家的密度范围。
参数:N
Number of equally spaced inner knots (ignored if inknts is specified).
同样间隔内结数(忽略inknts指定)。
参数:d
Degree of the spline (the order of the spline is d+1), values larger than 20 are to be avoided; they can lead to numerical instabilities.
值大于20度的样条曲线(样条曲线的顺序是D +1),要避免,可能会导致数值不稳定性。
参数:inknts
Vector specifying the inner knots. If equal to NULL, the B-spline basis reduces to the Bernstein polynomial basis. Per default the inner knots are located on the values specified via x.
矢量指定的内部结。如果等于NULL,B样条的基础上降低了的Bernstein多项式为基础的。每默认情况下,位于内结通过x指定的值。
参数:gamma
Parameter controlling the weight of the negative entropy in the objective function to be optimized (see Bornkamp and Ickstadt (2009)).
参数控制在要优化的目标函数的负熵的重量(见Bornkamp和Ickstadt(2009))。
参数:Delta
The code calculates the gamma parameter achieving a certain overall L2 distance between the specified quantiles and the fitted distribution function (only if gamma is not specified).
的代码计算gamma参数达到一定的整体拟合分布函数(只有gamma未指定)指定的位数和L2之间的距离。
参数:fitbnds
Numeric of length 2 for the bisection search algorithm searching for gamma giving the error Delta (only relevant if gamma is missing).
数字的长度为2分搜索算法,搜索的伽玛给错误Delta(只有相关的,如果缺少伽玛)。
参数:pistar
Prior density function used in Brier divergence (see Bornkamp and Ickstadt (2009). If NULL Brier entropy is used.
在石南木分歧之前使用的密度函数(见Bornkamp Ickstadt(2009年)。NULL如果石南木熵。
参数:constr
Character vector specifying, which shape constraint should be used, should be one of "none", "unimodal", "decreasing", "increasing".
字符向量确定,应使用形状约束,应该是一个“无”,“单峰”,“减少”,“增加”。
参数:mode
Numerical value needed when constraint = "unimodal". The code selects the knot average closest to mode as the location of the mode for the finite dimensional constraints on the coefficients of the B-spline in the optimization (note that the final density will only have a mode close to the value specified via mode).
数值时,需要constraint = "unimodal"。代码选择结平均最接近mode的模式的位置的B-样条曲线的最优化(注意,只会有一个模式的最终密度接近的值的系数的有限维约束规定通过mode)。
值----------Value----------
An SEL object containing the following entries <table summary="R valueblock"> <tr valign="top"><td>constr</td> <td> Character determining the shape constraint used.</td></tr> <tr valign="top"><td>inknts </td> <td> Inner knots.</td></tr> <tr valign="top"><td>nord</td> <td> Order of the spline.</td></tr> <tr valign="top"><td>bounds</td> <td> Bounds for the elicited quantity.</td></tr> <tr valign="top"><td>xalpha</td> <td> List containing the specified quantiles.</td></tr> <tr valign="top"><td>Omega</td> <td> Penalty matrix used for calculating Brier entropy.</td></tr> <tr valign="top"><td>coefs</td> <td> Fitted coefficients of the B-spline basis.</td></tr> <tr valign="top"><td>pistar</td> <td> Function handed over to SEL via the pistar argument (if any).</td></tr> <tr valign="top"><td>dplus</td> <td> The d vector, only necessary when pistar is specified (see Bornkamp and Ickstadt (2009).) </td></tr> </table>
SEL对象,其中包含下列项目的<table summary="R valueblock"> <tr valign="top"> <TD> constr</ TD> <TD>字符确定所使用的形状约束。</ TD> </ TR> <tr valign="top"> <TD> inknts </ TD>内结<TD>。</ TD> </ TR> <tr valign="top"> <TD> nord </ TD>样条曲线<TD>订购。</ TD> </ TR> <tr valign="top"> <TD>bounds </ TD> <TD>界。引起数量。</ TD> </ TR> <tr valign="top"> <TD>xalpha </ TD> <TD>列表,其中包含指定的位数。</ TD> </ TR> <TR VALIGN =“”> <TD> Omega </ TD> <TD>罚款矩阵石南木熵的计算。</ TD> </ TR> <tr valign="top"> <TD> X> </ TD> <TD>的B样条基的拟合系数。</ TD> </ TR> <tr valign="top"> <TD> coefs</ TD> <TD>功能交给了pistar,通过SEL参数(如果有的话)。</ TD> </ TR> <tr valign="top"> <TD>pistar</ TD> <TD> D矢量,只需要在pistar指定(见Bornkamp和Ickstadt(2009))</ TD> </ TR> </表>
(作者)----------Author(s)----------
Bjoern Bornkamp
参考文献----------References----------
Bornkamp, B. and Ickstadt, K. (2009). A Note on B-Splines for Semiparametric Elicitation. The American Statistician, 63, 373–377
O'Hagan A., Buck C. E., Daneshkhah, A., Eiser, R., Garthwaite, P., Jenkinson, D., Oakley, J. and Rakow, T. (2006), Uncertain Judgements: Eliciting Expert Probabilities, John Wiley and Sons Inc.
Dierckx, P. (1993), Curve and Surface Fitting with Splines, Clarendon Press
参见----------See Also----------
plot.SEL, comparePlot, quantSEL, rvSEL
plot.SEL,comparePlot,quantSEL,rvSEL
实例----------Examples----------
### example from O'Hagan et al. (2006)[##例如从奥黑根等人。 (2006)]
### 1st example in Bornkamp and Ickstadt (2009)[##第一个例子中Bornkamp和Ickstadt(2009年)]
x <- c(177.5, 183.75, 190, 205, 220)
y <- c(0.175, 0.33, 0.5, 0.75, 0.95)
I <- SEL(x, y, d = 1, Delta = 0.015, bounds = c(165, 250), inknts = x)
II <- SEL(x, y, d = 14, N = 0, Delta = 0.015, bounds = c(165, 250))
III <- SEL(x, y, d = 4, Delta = 0.015, bounds = c(165, 250), inknts = x)
IV <- SEL(x, y, d = 4, Delta = 0.015, bounds = c(165, 250), inknts = x,
constr = "u", mode = 185)
comparePlot(I, II, III, IV, type = "cdf")
comparePlot(I, II, III, IV, type = "density")
### bimodal example [##双峰的例子]
x2 <- c(0.1, 0.2, 0.5, 0.8, 0.9)
y2 <- c(0.2, 0.4, 0.45, 0.85, 0.99)
fit1 <- SEL(x2, y2, Delta=0.05, d = 4, inknts = x2)
fit2 <- SEL(x2, y2, Delta=0.05, d = 15, N = 0)
comparePlot(fit1, fit2, superpose = TRUE)
### sample from SEL object and evaluate density[##的样品从SEL对象和评估密度]
xxx <- rvSEL(50000, fit1)
hist(xxx, breaks=100, freq=FALSE)
curve(predict(fit1, newdata=x), add=TRUE)
### illustrate shrinkage against uniform dist.[##说明收缩对均匀区。]
gma01 <- SEL(x2, y2, gamma = 0.1)
gma02 <- SEL(x2, y2, gamma = 0.2)
gma04 <- SEL(x2, y2, gamma = 0.4)
gma10 <- SEL(x2, y2, gamma = 1.0)
comparePlot(gma01, gma02, gma04, gma10, superpose = TRUE)
### including shape constraints[##包括形状的限制]
x <- c(177.5, 183.75, 190, 205, 220)
y <- c(0.175, 0.33, 0.5, 0.75, 0.95)
unconstr1 <- SEL(x, y, Delta = 0.05, bounds = c(165, 250))
unconstr2 <- SEL(x, y, d = 10, N = 0, Delta = 0.05, bounds = c(165,250))
unimod1 <- SEL(x, y, Delta = 0.05, bounds = c(165, 250),
constr = "unimodal", mode = 185)
unimod2 <- SEL(x, y, d = 10, N = 0, Delta = 0.05, bounds = c(165, 250),
constr = "unimodal", mode = 185)
comparePlot(unconstr1, unconstr2, unimod1, unimod2)
### shrinkage against another distribution[##分布收缩对另一]
pr <- function(x) dbeta(x, 2, 2)
pr01 <- SEL(x2, y2, gamma = 0.1, d = 3, pistar = pr)
pr03 <- SEL(x2, y2, gamma = 0.3, d = 3, pistar = pr)
pr12 <- SEL(x2, y2, gamma = 1.2, pistar = pr)
comparePlot(pr01, pr03, pr12, superpose = TRUE)
### 2nd example from Bornkamp and Ickstadt (2009)[##第二个示例从Bornkamp和Ickstadt(2009年)]
# theta[THETA]
# "true" density[“true”的密度]
pmixbeta <- function(x, a1, b1, a2, b2){
0.3*pbeta(x/20,a1,b1)+0.7*pbeta(x/20,a2,b2)
}
dmixbeta <- function(x, a1, b1, a2, b2){
out <- 0.3*dbeta(x/20,a1,b1)+0.7*dbeta(x/20,a2,b2)
out/20
}
x <- c(2,10,15)
a1 <- 1;a2 <- 10;b1 <- 15;b2 <- 5
mu <- pmixbeta(x, a1, b1, a2, b2)
set.seed(1) # simulate experts statements[模拟专家陈述]
y <- rnorm(length(mu), mu, sqrt(mu*(1-mu)*0.05^2))
thet <- SEL(x, y, d = 4, Delta = 0.03, bounds = c(0, 20), inknts = x)
plot(thet, ylim = c(0,0.25))
curve(dmixbeta(x, a1, b1, a2, b2), add=TRUE, col="red")
abline(h=0.05, lty = 2)
legend("topright", c("true density", "elicited density", "uniform density"),
col=c(2,1,1), lty=c(1,1,2))
# sigma[西格玛]
# "true" density[“true”的密度]
dtriang <- function(x,m,a,b){
inds <- x < m;res <- numeric(length(x))
res[inds] <- 2*(x[inds]-a)/((b-a)*(m-a))
res[!inds] <- 2*(b-x[!inds])/((b-a)*(b-m))
res
}
ptriang <- function(x,m,a,b){
inds <- x < m;res <- numeric(length(x))
res[inds] <- (x[inds]-a)^2/((b-a)*(m-a))
res[!inds] <- 1-(b-x[!inds])^2/((b-a)*(b-m))
res
}
x <- c(1,2,4)
mu <- ptriang(x, 1, 0, 5)
set.seed(1) # simulate experts statements[模拟专家陈述]
y <- rnorm(length(mu), mu, sqrt(mu*(1-mu)*0.05^2))
sig <- SEL(x, y, d = 4, Delta = 0.03, bounds = c(0, 5),
inknts = x, mode = 1, constr="unimodal")
plot(sig, ylim=c(0,0.4))
curve(dtriang(x, 1, 0, 5), add=TRUE, col="red")
abline(h=0.2, lty = 2)
legend("topright", c("true density", "elicited density", "uniform density"),
col=c(2,1,1), lty=c(1,1,2))
## Not run: [#不运行:]
### generate some random elicitations[##产生一些随机的推算]
numb <- max(rnbinom(1, mu = 4, size = 1), 1)
x0 <- runif(1, -1000, 1000)
x1 <- x0+runif(1, 0, 1000)
xs <- sort(runif(numb, x0, x1))
y <- runif(numb+1)
ys <- (cumsum(y)/sum(y))[1:numb]
fit1 <- SEL(xs, ys, bounds = c(x0, x1))
fit2 <- SEL(xs, ys, d = 1, inknts = xs, bounds = c(x0, x1))
fit3 <- SEL(xs, ys, d = 15, N = 0, bounds = c(x0, x1))
comparePlot(fit1, fit2, fit3, type="cdf")
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|