tiltWeights(tau, L, tilt="exponential", weights=NULL, group=NULL,
lambda = NULL, details = F, tol = 1e-6, maxiter = 50)
"exponential" or
"ml", for exponential or maximum likelihood
tilting, respectively
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 multiple groups (see DETAILS below, and
).
These are computed if not provided.
TRUE return values of
lambda as well as tilting weights; if
FALSE return tilting weights only.
Ignored except for multiple-group
"ml" tilting.
lambda values such
that tilting weights sum within each group to within
tol of 1.
Used only for multiple-group
"ml" tilting.
lambda.
Used only for multiple-group
"ml" tilting.
L, giving probabilities for the discrete distribution after tilting.
If
details=TRUE and maximum likelihood tilting is
used with multiple groups, return a list with components
tau (the input),
w (tilting weights), and
lambda.
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.
# Determine weights for importance sampling in bootstrapping.
x <- rnorm(20)
L <- influence(x, mean)$L
wt1 <- tiltWeights( saddlepointPSolve(.05, L=x), L=x)
wt2 <- tiltWeights( saddlepointPSolve(.95, L=x), L=x)
bfit <- bootstrap(x, mean, B = c(200, 100, 100),
sampler.prob = list(NULL, wt1, wt2))
plot(bfit)
# Determine weights for which the weighted mean of x is 0
tau <- tiltMeanSolve(q = 0, L=x)$tau.exp
wt <- tiltWeights(tau, L)
plot(x, wt)
mean(x, weights=wt)