bb.science
Class Bootstrap.UnitTest.DistributionAbstract

java.lang.Object
  extended by bb.science.Bootstrap.UnitTest.DistributionAbstract
All Implemented Interfaces:
Bootstrap.UnitTest.Distribution
Direct Known Subclasses:
Bootstrap.UnitTest.CauchyStandard, Bootstrap.UnitTest.ExponentialStandard, Bootstrap.UnitTest.GaussianStandard
Enclosing class:
Bootstrap.UnitTest

private abstract static class Bootstrap.UnitTest.DistributionAbstract
extends Object
implements Bootstrap.UnitTest.Distribution

Implements some common functionality used by concrete subclasses.

This class is multithread safe: it is stateless.


Constructor Summary
private Bootstrap.UnitTest.DistributionAbstract()
           
 
Method Summary
 Bootstrap.Estimate getMedianEst(double[] sample, double confidenceLevel)
          Implements an amazing theoretical result for the median confidence interval which is valid for any distribution, and only assumes iid for the samples.
protected  double random01(ec.util.MersenneTwisterFast random)
          Returns a uniform random pick from the open interval (0, 1).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bb.science.Bootstrap.UnitTest.Distribution
generateSample, getMean, getMeanEst, getMedian, getName, getSd, getSdEst
 

Constructor Detail

Bootstrap.UnitTest.DistributionAbstract

private Bootstrap.UnitTest.DistributionAbstract()
Method Detail

getMedianEst

public Bootstrap.Estimate getMedianEst(double[] sample,
                                       double confidenceLevel)
Implements an amazing theoretical result for the median confidence interval which is valid for any distribution, and only assumes iid for the samples. This result involves the binomial distribution.
                        It is described here on these webpages:
                                perfeval.epfl.ch/printMe/conf-1.ppt     (see p. 12)
                                http://www.stat.ufl.edu/STA6166/Fall06/17.STA6166%20Chapter5p2.pdf
                                http://www.behav.org/QP/quant_large.pdf (see Appendix II)
                                http://stat-www.berkeley.edu/~stark/Teach/S240/Notes/ch5.htm    (see the final section)
                                http://www-users.york.ac.uk/~mb55/intro/cicent.htm
                                http://www.statsdirect.com/help/nonparametric_methods/qci.htm
                        and in these books:
                                Nonparametrics: Statistical Methods Based on Ranks, Holden-Day, 1975, by Lehmann p.182-183

                                Introduction to Mathematical Statistics (6th Edition)
                                by Robert V. Hogg, Allen Craig, by Joseph W. McKean (~p. 246 has an interesting discussion of this; see also their discussion in chapter 10)

                                Practical Nonparametric Statistics (3rd edition), Wiley 1999, by Conover WJ (several people on the web referenced this)

                                http://books.google.com/books?id=tARVZq4hq7UC&pg=PA173&lpg=PA173&dq=binomial+distribution+cdf+confidence+interval+median&source=web&ots=yFfj2N9vFi&sig=IilUl90CEaCqul8GCgpEASRjKVY#PPA173,M1
                        If you do not want to calculate it, here are tables:
                                http://www.math.unb.ca/~knight/utility/MedInt95.htm
                                http://biomet.oxfordjournals.org/cgi/content/abstract/57/3/613
                        and here is an applet:
                                http://www.sph.emory.edu/~cdckms/median-final.html

                        The sole drawback of this binomial result is that it is only exact for certain discrete values of the confidence level.
                        In particular, the exact confidence levels are limited to a small set of values
                        that is a function of the number of samples and the binomial distribution's cdf.

                        To work around this limitation, 2 solutions are possible.

                        First, if the confidence level that you desire is not one of the exact values,
                        you may simply use the confidence interval produced by the next largest exact confidence level.
                        This will be a conservative (too large) confidence interval for the level that you desire,
                        but for large sample sizes, the error should typically be small.

                        Second, a more rigorous technique is to use some form of interpolation.
                        For example, the Hettmansperger-Sheather result uses linear interpolation to handle arbitrary confidence levels.
                        This technique was originally described here:
                                Confidence Interval Based on Interpolated Order Statistics,
                                Hettmansperger, T. P., and Sheather, S. J.
                                Statistical Probability Letters, 4: 75–79 1986
                        and some web references are:
                                http://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/mediancl.htm
                                support.spss.com/Student/Documentation/Algorithms/14.0/errorbars.pdf
                        This article claims that linear interpolation is the best that can do:
                                Interpolated Nonparametric Prediction Intervals and Confidence Intervals
                                Rudolf Beran, Peter Hall
                                Journal of the Royal Statistical Society. Series B (Methodological), Vol. 55, No. 3 (1993), pp. 643-652
                                http://links.jstor.org/sici?sici=0035-9246%281993%2955%3A3%3C643%3AINPIAC%3E2.0.CO%3B2-W&size=LARGE&origin=JSTOR-enlargePage
                        and this one also advocates it:
                                Nonparametric Ranked-set Sampling Confidence Intervals for Quantiles of a Finite Population
                                Jayant V. Deshpande, Jesse Frey and Omer Ozturk
                                http://www.springerlink.com/content/h067ml43p62r8145/
                        See also this article:
                                http://www.springerlink.com/content/t501k266761l5461/
                        WARNING: if use these interpolation techniques, then the generality of the result is slightly reduced
                        (there IS now some distributional dependence):
                                "Confidence intervals for the population median based on interpolating adjacent order statistics are presented. They are shown to depend only slightly on the underlying distribution. A simple, nonlinear interpolation formula is given which works well for a broad collection of underlying distributions."
                                http://stinet.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADA152607

                        In addition to the above binomial result, there is:
                                "... a method given by Wilcox (see Reference below) on page 87, is based on the Maritz-Jarrett estimate of the standard error for a quantile"
                                http://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/mediancl.htm

                                a better way than the binomial or bootstrap using smoothing:
                                http://www.informaworld.com/smpp/content~content=a780357685~db=all~jumptype=rss

                                this old paper; gives results for point and interval of mean, median and mode of log normal:
                                http://links.jstor.org/sici?sici=0006-3444%28197912%2966%3A3%3C567%3ACEOMOL%3E2.0.CO%3B2-W&size=LARGE&origin=JSTOR-enlargePage

                                a novel way of using median CIs to obtain robust estimates:
                                http://web.informatik.uni-bonn.de/IV/strelen/Lehre/Veranstaltungen/sim/Folien/24ASTC.pdf
 

Specified by:
getMedianEst in interface Bootstrap.UnitTest.Distribution

random01

protected double random01(ec.util.MersenneTwisterFast random)
Returns a uniform random pick from the open interval (0, 1).