  We present an importance sampling algorithm that can produce realisations of
Markovian epidemic models that exactly match observations, taken to be the
number of a single event type over a period of time. The importance sampling
can be used to construct an efficient particle filter that targets the states
of a system and hence estimate the likelihood to perform Bayesian parameter
inference. When used in a particle marginal Metropolis Hastings scheme, the
importance sampling provides a large speed-up in terms of the effective sample
size per unit of computational time, compared to simple bootstrap sampling. The
algorithm is general, with minimal restrictions, and we show how it can be
applied to any discrete-state continuous-time Markov chain where we wish to
exactly match the number of a single event type over a period of time.
