State space models with non-stationary processes and/or fixed regression effects require a state vector with diffuse initial conditions. Different likelihood functions can be adopted for the estimation of parameters in time-series models with diffuse initial conditions. In this article, we consider profile, diffuse and marginal likelihood functions. The marginal likelihood function is defined as the likelihood function of a transformation of the data vector. The transformation is not unique. The diffuse likelihood is a marginal likelihood for a data transformation that may depend on parameters. Therefore, the diffuse likelihood cannot be used generally for parameter estimation. The marginal likelihood function is based on an orthonormal data transformation that does not depend on parameters. Here we develop a marginal likelihood function for state space models that can be evaluated by the Kalman filter. The so-called diffuse Kalman filter is designed for computing the diffuse likelihood function. We show that a minor modification of the diffuse Kalman filter is needed for the evaluation of our marginal likelihood function. Diffuse and marginal likelihood functions have better small sample properties compared with the profile likelihood function for the estimation of parameters in linear time series models. The results in our article confirm the earlier findings and show that the diffuse likelihood function is not appropriate for a range of state space model specifications. ©2010 Blackwell Publishing Ltd.