EVOLUTION-MANAGER
Edit File: exp.tilt.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Exponential Tilting</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for exp.tilt {boot}"><tr><td>exp.tilt {boot}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Exponential Tilting </h2> <h3>Description</h3> <p>This function calculates exponentially tilted multinomial distributions such that the resampling distributions of the linear approximation to a statistic have the required means. </p> <h3>Usage</h3> <pre> exp.tilt(L, theta = NULL, t0 = 0, lambda = NULL, strata = rep(1, length(L))) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>L</code></td> <td> <p>The empirical influence values for the statistic of interest based on the observed data. The length of <code>L</code> should be the same as the size of the original data set. Typically <code>L</code> will be calculated by a call to <code>empinf</code>. </p> </td></tr> <tr valign="top"><td><code>theta</code></td> <td> <p>The value at which the tilted distribution is to be centred. This is not required if <code>lambda</code> is supplied but is needed otherwise. </p> </td></tr> <tr valign="top"><td><code>t0</code></td> <td> <p>The current value of the statistic. The default is that the statistic equals 0. </p> </td></tr> <tr valign="top"><td><code>lambda</code></td> <td> <p>The Lagrange multiplier(s). For each value of <code>lambda</code> a multinomial distribution is found with probabilities proportional to <code>exp(lambda * L)</code>. In general <code>lambda</code> is not known and so <code>theta</code> would be supplied, and the corresponding value of <code>lambda</code> found. If both <code>lambda</code> and <code>theta</code> are supplied then <code>lambda</code> is ignored and the multipliers for tilting to <code>theta</code> are found. </p> </td></tr> <tr valign="top"><td><code>strata</code></td> <td> <p>A vector or factor of the same length as <code>L</code> giving the strata for the observed data and the empirical influence values <code>L</code>. </p> </td></tr></table> <h3>Details</h3> <p>Exponential tilting involves finding a set of weights for a data set to ensure that the bootstrap distribution of the linear approximation to a statistic of interest has mean <code>theta</code>. The weights chosen to achieve this are given by <code>p[j]</code> proportional to <code>exp(lambda*L[j]/n)</code>, where <code>n</code> is the number of data points. <code>lambda</code> is then chosen to make the mean of the bootstrap distribution, of the linear approximation to the statistic of interest, equal to the required value <code>theta</code>. Thus <code>lambda</code> is defined as the solution of a nonlinear equation. The equation is solved by minimizing the Euclidean distance between the left and right hand sides of the equation using the function <code>nlmin</code>. If this minimum is not equal to zero then the method fails. </p> <p>Typically exponential tilting is used to find suitable weights for importance resampling. If a small tail probability or quantile of the distribution of the statistic of interest is required then a more efficient simulation is to centre the resampling distribution close to the point of interest and then use the functions <code>imp.prob</code> or <code>imp.quantile</code> to estimate the required quantity. </p> <p>Another method of achieving a similar shifting of the distribution is through the use of <code>smooth.f</code>. The function <code>tilt.boot</code> uses <code>exp.tilt</code> or <code>smooth.f</code> to find the weights for a tilted bootstrap. </p> <h3>Value</h3> <p>A list with the following components : </p> <table summary="R valueblock"> <tr valign="top"><td><code>p</code></td> <td> <p>The tilted probabilities. There will be <code>m</code> distributions where <code>m</code> is the length of <code>theta</code> (or <code>lambda</code> if supplied). If <code>m</code> is 1 then <code>p</code> is a vector of <code>length(L)</code> probabilities. If <code>m</code> is greater than 1 then <code>p</code> is a matrix with <code>m</code> rows, each of which contain <code>length(L)</code> probabilities. In this case the vector <code>p[i,]</code> is the distribution tilted to <code>theta[i]</code>. <code>p</code> is in the form required by the argument <code>weights</code> of the function <code>boot</code> for importance resampling. </p> </td></tr> <tr valign="top"><td><code>lambda</code></td> <td> <p>The Lagrange multiplier used in the equation to determine the tilted probabilities. <code>lambda</code> is a vector of the same length as <code>theta</code>. </p> </td></tr> <tr valign="top"><td><code>theta</code></td> <td> <p>The values of <code>theta</code> to which the distributions have been tilted. In general this will be the input value of <code>theta</code> but if <code>lambda</code> was supplied then this is the vector of the corresponding <code>theta</code> values. </p> </td></tr></table> <h3>References</h3> <p>Davison, A. C. and Hinkley, D. V. (1997) <em>Bootstrap Methods and Their Application</em>. Cambridge University Press. </p> <p>Efron, B. (1981) Nonparametric standard errors and confidence intervals (with Discussion). <em>Canadian Journal of Statistics</em>, <b>9</b>, 139–172. </p> <h3>See Also</h3> <p><code><a href="empinf.html">empinf</a></code>, <code><a href="Imp.Estimates.html">imp.prob</a></code>, <code><a href="Imp.Estimates.html">imp.quantile</a></code>, <code><a href="../../stats/html/optim.html">optim</a></code>, <code><a href="smooth.f.html">smooth.f</a></code>, <code><a href="tilt.boot.html">tilt.boot</a></code> </p> <h3>Examples</h3> <pre> # Example 9.8 of Davison and Hinkley (1997) requires tilting the resampling # distribution of the studentized statistic to be centred at the observed # value of the test statistic 1.84. This can be achieved as follows. grav1 <- gravity[as.numeric(gravity[,2]) >=7 , ] grav.fun <- function(dat, w, orig) { strata <- tapply(dat[, 2], as.numeric(dat[, 2])) d <- dat[, 1] ns <- tabulate(strata) w <- w/tapply(w, strata, sum)[strata] mns <- as.vector(tapply(d * w, strata, sum)) # drop names mn2 <- tapply(d * d * w, strata, sum) s2hat <- sum((mn2 - mns^2)/ns) c(mns[2]-mns[1], s2hat, (mns[2]-mns[1]-orig)/sqrt(s2hat)) } grav.z0 <- grav.fun(grav1, rep(1, 26), 0) grav.L <- empinf(data = grav1, statistic = grav.fun, stype = "w", strata = grav1[,2], index = 3, orig = grav.z0[1]) grav.tilt <- exp.tilt(grav.L, grav.z0[3], strata = grav1[,2]) boot(grav1, grav.fun, R = 499, stype = "w", weights = grav.tilt$p, strata = grav1[,2], orig = grav.z0[1]) </pre> <hr /><div style="text-align: center;">[Package <em>boot</em> version 1.3-22 <a href="00Index.html">Index</a>]</div> </body></html>