Automatic Numeric Inversion Wolfgang H ¨ ormann, Gerhard Derflinger, Josef Leydold [email protected]IE-Department Bogazici University Istanbul Department of Statistics, WU Wien H ¨ ormann & Derflinger & Leydold– MCQMC-2008/07/11 – Automatic Numeric Inversion – p.0/41
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Automatic Numeric InversionWolfgang Hormann, Gerhard Derflinger, Josef Leydold
CDF and its inverse often not given in closed form(or unknown).
Algorithms based on well-known numerical methods(e.g. Newton’s method or regula falsi) are slow and canonly be speeded up by the usage of (large) tables.
Numerical methods are not exact, i.e., they producerandom numbers which are only approximatelydistributed as the given distribution.
Automatic algorithms have been developed fornon-standard distributions.
Also called black-box or universal methods.
Idea:One algorithm works for a large class of distributions.
Today these algorithms have properties that makes themalso attractive for generating from standard distributions.Even for sampling from Gaussian distributions.
In many simulation situations the application ofstandard distributions is not adequate.Development of inversion methods for specialdistribution too “expensive”.
New Automatic Inversion Algorithm:
User provides the PDF and one point in the domain.Set-up calculates all necessary tables and thus"designs" the algorithm.
In many simulation situations the application ofstandard distributions is not adequate.Development of inversion methods for specialdistribution too “expensive”.
New Automatic Inversion Algorithm:
User provides the PDF and one point in the domain.Set-up calculates all necessary tables and thus"designs" the algorithm.
Maximal accepted u-error can be selected by the userMaximal u-errors close to machine precision can bereached with medium-sized tablesSampling algorithm (very) fast
Numeric Integration to obtain the CDF F(x):Gauss-Lobatto integrationNumerical approximation of F−1(u):Newton interpolationDecomposition into many subintervals:indexed search to find the subintervalImportant Synergies:We use the same subintervals for integration andinterpolation.
We can evaluate the CDF F(x) using numerical integration.Thus it is easy to specify the interval and constructionpoints xi and ui = F(xi).Use the pairs (ui, xi) for Newton interpolation of F−1
We have two alternatives for point selection:use the “rescaled” Chebyshev points to select xi.Advantage: SimpleDisadvantage: Interploation may be poor in the tails.use the “rescaled” Chebyshev points for ui.Advantage: optimal interpolationDisadvantage: numerical inversion in set-up
Select the xi for i = 1, 2, . . . , n.Using n Lobatto(5) integrations calculate the ui = F(xi)
for i = 1 to n.Calculate the coefficents of the Newton Interpolation forthe pairs (ui, xi), i = 0, 1, . . . , n.Calculate the control-points for the u-error.If the u-error at all control-points is a bit smaller than εu
return xn.otherwise retry with smaller/larger value for xn.
[Loop]Set x0 ← a, step← (b − a)/128, j← 0.Repeat while x < b.
x← Sub-Interval(xj, xj + step)
Set step← x − xj, j← j + 1, xj ← x.Store Coefficients of the Newton Polynomials for allsubintervals.Store cumulative probabilities of the subintervals.Make guide table.
Generate U ∼ U(0, 1).Use indexed search to calculate index J of thecorresponding subinterval.Evaluate the Newton polynomial of interval J at U tocalculate X.Return X.
We checked our implementation for:Normal, Gamma, and t distributionsMany different parametersFor n = 3 to 11.For εu = 10−6, 10−8, 10−10, 10−12.For 3 · 106 different u-values, many of them in the tails.
Results:For εu not smaller than 10−10 the maximal observed u-errorwas always below εu.
For 10−12 some moderately larger u-errors were observed.Probably error too close to machine precision.
Requires only the (unnormed) PDF and no CDF.Accuracy can be easily checked. We can thus use themaximal accepted approximation error εu as parameterof the algorithm.
There is not need to compute F−1(u) for any u.Only moderate number of subintervals requiredVery fast.
Have to cut off tails of distributions with unboundeddomains.
We only can control the “u-error”, i.e.,εu(u) = |u − F(F−1
a (u))|.The “x-error”, i.e., εx(u) = |F−1(u) − F−1
a (u)| can be quitelarge in the tails.Performance depends on floating point numbers used.For future new standards higher order polynomials maybe necessary.
Note:The floating point standard has not changed for 20 years.