The sample-path method is one of the most important tools in simulation-based optimization. The basic idea of the method is to approximate the expected simulation output by the average of sample observations with a common random number sequence. In this paper, we describe a new variant of Powell's UOBYQA (Unconstrained Optimization BY Quadratic Approximation) method, which integrates a Bayesian Variable-Number Sample-Path (VNSP) scheme to choose appropriate number of samples at each iteration. The statistically accurate scheme determines the number of simulation runs, and guarantees the global convergence of the algorithm. The VNSP scheme saves a significant amount of simulation operations compared to general purpose 'fixed-number' sample-path methods. We present numerical results based on the new algorithm.Keywords sample-path method, simulation-based optimization, Bayesian analysis, trust region method Dedication This paper is dedicated to Stephen Robinson on the occasion of his 65th birthday. The authors are grateful for his encouragement and guidance over the past two decades, and the inspirational work he has done in the topic of this paper.