Suppose that the random vector X and the random variable Y are jointly continuous. Also suppose that an observation x of X can be easily simulated and that the probability density function of Y conditional on X = x is known. The paper presents an efficient simulation-based algorithm for estimating E{g(X,Y) \ h(X,Y) = r} where g and h are real-valued functions. This algorithm is applicable to time series problems in which X = (X-1,...,Xn-1) and Y = X-n where {X-t} is a discrete-time stochastic process for which (X-1,..., X-n) is a continuous random vector. A numerical example from time series analysis illustrates the algorithm, for prediction for an ARCH(1) process.