A central goal of systems neuroscience is to characterize the transformation of sensory input to spiking output in single neurons. This problem is complicated by the large dimensionality of the inputs. To cope with this problem, previous methods have estimated simplified versions of a generic linear-nonlinear (LN) model and required, in most cases, stimuli with constrained statistics. Here we develop the extended Projection Pursuit Regression (ePPR) algorithm that allows the estimation of all of the parameters, in space and time, of a generic LN model using arbitrary stimuli. We first prove that ePPR models can uniformly approximate, to an arbitrary degree of precision, any continuous function. To test this generality empirically, we use ePPR to recover the parameters of models of cortical cells that cannot be represented exactly with an ePPR model. Next we evaluate ePPR with physiological data from primary visual cortex, and show that it can characterize both simple and complex cells, from their responses to both natural and random stimuli. For both simulated and physiological data, we show that ePPR compares favorably to spike-triggered and information-theoretic techniques. To the best of our knowledge, this article contains the first demonstration of a method that allows the estimation of an LN model of visual cells, containing multiple spatio-temporal filters, from their responses to natural stimuli.