In functional Magnetic Resonance Imaging (fMRI), recent works have addressed the non parametric estimation of the Hemodynamic Response Function (HRF) under linearity and stationarity in time hypotheses . We propose to test a more flexible model that allows for the variation of the magnitude of the HRF with time. Under this model, the magnitude of the HRF evoked by a single event may vary with other occurrences of the same kind of event. This model is tested against a simpler model with a fixed magnitude. We develop a stochastic version of the EM algorithm to identify the magnitudes and the HRF. We also address the problem of model specification. It is usually assumed that every event type evokes a response. Our scheme uses a model selection approach which provides the best subset of event types maximizing the likelihood of the fMRI signal. Our methodology is exemplified by simulated and fMRI data.