tiltMean(tau, L, tilt="exponential", weights=NULL, group=NULL, lambda = NULL, tol=1e-06, maxiter=50) tiltMeanSolve(q, L, tilt="exponential", weights=NULL, group=NULL, initial, tol=1e-06, tol.tau=tol, maxiter=50)
L
,
if the discrete distribution has unequal probabilities
on the values (before tilting).
L
; unique values of this vector determine
groups, for multiple-sample applications or stratified sampling.
tau
containing normalizing constants for maximum
likelihood tilting with groups (see DETAILS below, and
).
These are computed if not provided.
q
, initial values used in iteratively
solving for
tau
.
tiltMeanSolve
, find
tau
so the tilted mean is within
tol
of
q
.
For
tiltMean
, find
lambda
values such
that tilting weights sum within each group to within
tol
of 1.
tau
on the scale of
tau
.
tau
which
bracket the solution for each
q
(after the root is bracketed additional
iterations may be performed).
tiltMean
, a list with components
tau
,
containing weighted means for the tilted distributions.
tau
and number of rows (or length) equal to the unique values of
group
.
This is present only if
tilt="ml"
and there are multiple groups.
For
tiltMeanSolve
, the returned list has component
q
, tilting parameters
that give the desired tilted mean.
tilt="ml"
.
tiltMean
;
present only if
tilt="ml"
and there are multiple groups.
In the univariate case (
L
a vector and
tau
a scalar) with only one
group, exponential
tilting places probability proportional to
weights * exp((L-Lbar) * tau)on the values in
L
, where
Lbar
is the weighted mean of
L
.
Maximum likelihood tilting places probabilities proportional to
weights / (1 - (L-Lbar) * tau)For further details, and formulae in the group case (multiple samples, or stratified sampling), see .
Hesterberg, T.C. (2003), "Tilting Calculations for Resampling Inferences and Approximations", Research Report No. 103, Research Department, Insightful Corp., 1700 Westlake Ave. N., Suite 500, Seattle, WA 98109.
# Hypothesis testing; find a weighted empirical distribution # for which the weighted mean is 0.0: x <- rnorm(20) tau <- tiltMeanSolve(0.0, x, tilt="ml")$tau.ml wt <- tiltWeights(tau, x, tilt="ml") mean(x, weights=wt) # equal to zero, within given tolerance # likelihood ratio statistic for empirical likelihood test -2 * sum(log(20 * wt)) # stratified data: tilt so weighted mean is average of the group # medians. set.seed(0) gs <- c(10,20,10) L1 <- rnorm(gs[1],mean=0,sd=1) L2 <- rnorm(gs[2],mean=1,sd=1) L3 <- rnorm(gs[3], mean=2, sd=3) L <- c(L1,L2,L3) group <- rep(1:3,gs) Q <- mean(c(median(L1), median(L2), median(L3))) tiltMeanSolve(Q, L, group=group, tilt="ml") # Demonstrate relationship between overall and group tilting parameters set.seed(1) x <- runif(25) tiltMean(.1, x, group=rep(1:2, c(10,15)))$q (mean(x[1:10], weights=exp(.1 /(10/25) * x[1:10])) + mean(x[11:25], weights=exp(.1 /(15/25) * x[11:25])) ) tiltMean(.1 /(10/25), x[1:10])$q + tiltMean(.1 /(15/25), x[11:25])$q # all three match