## 1. Introduction

Consider the linear regression model *y* = *X**β *+ *u* with observation vector *y*, covariate matrix *X*, regression coefficient vector *β* and disturbance vector *u* ∼ N(0, *σ*^{2}Ω) where *σ* is the scaling factor and Ω is a variance matrix depending on the vector of nuisance parameters *θ*. We therefore may write Ω = Ω(*θ*) and possibly *X* = *X*(*θ*). The marginal likelihood function is defined as the likelihood function of a transformation of the observations in *y* such that the transformed data is orthogonal in *X* and therefore independent of *β*. The profile likelihood function for the linear regression model is the likelihood function evaluated at the maximum likelihood estimate of *β*. In econometrics, the profile likelihood function is also known as the concentrated likelihood function. Among others, Cooper and Thompson (1977) and Tunnicliffe Wilson (1989) argue that the marginal likelihood is superior to the profile likelihood for the inference of nuisance parameters collected in vector *θ*. Small sample evidence for time-series models is provided by Shephard (1993). The marginal likelihood is for a (transformed) random variable and therefore its score vector has expectation zero; see, for example, Shephard (1993), Rahman and King (1997) and Francke and de Vos (2007).

The state space form for linear Gaussian time series models is convenient for likelihood-based estimation, signal extraction and forecasting. State space models can be represented as linear regression models with specifically designed matrices *X* and Ω, see Durbin and Koopman (2001, section 4.11). The likelihood function for stationary time-series models can be evaluated by the Kalman filter as it effectively carries out the prediction error decomposition; see Schweppe (1965) and Harvey (1989). Nuisance parameter vector *θ* can be estimated by directly maximizing the likelihood function. Time-series models with (time-varying) regression parameters and non-stationary latent factors require state space formulations with unknown initial conditions. In cases where the initial conditions are treated as fixed regression coefficients, the profile likelihood function can be computed as in Rosenberg (1973). When they are treated as random variables with large variances converging to infinity, a so-called diffuse likelihood function can be defined and computed as described in, among others, Harvey (1989, section 3.4.3), Ansley and Kohn (1985, 1990), De Jong (1988, 1991) and Koopman (1997). The diffuse likelihood function is a marginal likelihood function based on a transformation that is not necessarily invariant to the parameter vector *θ*. In this article, we develop a marginal likelihood function for the linear Gaussian state space model that is always invariant to *θ* when *θ* is linearly dependent on *X*. The evaluation of the marginal likelihood requires a modification of the diffuse Kalman filter. We further discuss its relation with profile and diffuse likelihood functions.

In Section 2, we develop general expressions for the profile, diffuse and marginal likelihood functions and we discuss their merits. Section 3 shows how the Kalman filter needs to be modified for the computation of the marginal likelihood function. Illustrations are given in Section 4. It is shown that different specifications of the same model lead to different diffuse likelihood functions whereas the marginal likelihood functions remain equal. Section 5 concludes.