Calculate tilting weights

DESCRIPTION:

Given a tilting parameter and discrete distribution values, calculate weights (probabilities) for exponential or maximum likelihood tilting.

USAGE:

tiltWeights(tau, L, tilt="exponential", weights=NULL, group=NULL, 
    lambda = NULL, details = F, tol = 1e-6, maxiter = 50) 

REQUIRED ARGUMENTS:

tau
scalar or vector; tilting parameters.
L
vector of values which determine a discrete distribution.

OPTIONAL ARGUMENTS:

tilt
one of "exponential" or "ml", for exponential or maximum likelihood tilting, respectively
weights
vector the same length as L, if the discrete distribution has unequal probabilities on the values (before tilting).
group
vector the same length as L; unique values of this vector determine groups, for multiple-sample applications or stratified sampling.
lambda
matrix with one row for each group and one column for each value of tau containing normalizing constants for maximum likelihood tilting with multiple groups (see DETAILS below, and ). These are computed if not provided.
details
if TRUE return values of lambda as well as tilting weights; if FALSE return tilting weights only. Ignored except for multiple-group "ml" tilting.
tol
Find lambda values such that tilting weights sum within each group to within tol of 1. Used only for multiple-group "ml" tilting.
maxiter
Maximum number of iterations in solving for lambda. Used only for multiple-group "ml" tilting.

VALUE:

tilting weights; a vector of the same length as the number of rows of 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.

DETAILS:

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 .

REFERENCES:

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.

SEE ALSO:

, , , , .

EXAMPLES:

# 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)