A fixed-memory moving, expanding window for obtaining scatter corrections in X-ray CT and other stochastic averages - Levine, Zachary H.; Pintar, Adam L. (Computer physics communications, 2015)
A simple algorithm for averaging a stochastic sequence of 1D arrays in a moving, expanding window is provided. The samples are grouped in bins which increase exponentially in size so that a constant fraction of the samples is retained at any point in the sequence. The algorithm is shown to have particular relevance for a class of Monte Carlo sampling problems which includes one characteristic of iterative reconstruction in computed tomography. The code is available in the CPC program library in both Fortran 95 and C and is also available in R through CRAN. Program title: mewAvg Catalogue identifier: AEXA_v1_0 Program summary URL:http://cpc.cs.qub.ac.uk/summaries/AEXA_v1_0.html Program obtainable from: CPC Program Library, Queen’s University, Belfast, N. Ireland Licensing provisions: Standard CPC licence, http://cpc.cs.qub.ac.uk/licence/licence.html No. of lines in distributed program, including test data, etc.: 4757 No. of bytes in distributed program, including test data, etc.: 67572 Distribution format: tar.gz Programming language: Fortran 95 or C. Computer: Personal computer or larger. Operating system: Red Hat Enterprise Linux 6, but probably cross platform. RAM: kB to GB depending on the application Classification: 4.13. Nature of problem: Some problems require both a self-consistent solution and Monte Carlo sampling. Monte Carlo samples based on early iterates may not be useful, but discarding all samples and resampling every time solution parameters change can be wasteful. Solution method: The solution is to keep a fixed fraction of the samples, such as the most recent half. The trick implemented here involves exponentially expanding windows so that a fixed fraction of the samples can be retained using a fixed amount of physical memory. Additional comments: The subprograms are intended to be integrated into a larger program of the user. Small driver programs are provided to illustrate the usage. Running time: Microseconds to seconds per iteration References:[1]G. T. Herman, Image reconstruction from projections: The fundamentals of computerized tomography (Academic, 1980).[2]E.-P. Rührnschopf and K. Klingenbeck, Medical Physics 38, 5186 (2011).[3]M.-H. Chen, Q.-M. Shao, and J. G. Ibrahim, Monte Carlo Methods in Bayesian Computation (Springer-Verlag, 2000).[4]A. Gelman, J. B. Carlin, H. S. Stern, and D. B. Rubin, Bayesian Data Analysis (Chapman & Hall/CRC, 2004), 2nd ed.[5]H. Robbins and S. Monro, The Annals of Mathematical Statistics 22, 400 (1951).[6]J. C. Spall, Introduction to Stochastic Search and Optimization (John Wiley and Sons, 2003).[7]H. J. Kushner and J. Yang, SIAM Journal on Control and Optimization 31, 1045 (1993).[8]A. L. Pintar and Z. H. Levine, mewAvg: A Fixed Memory Moving Expanding Window Average (2014), URL http://cran.r-project.org/web/packages/mewAvg/index.html.