Estimation of a trend of an atmospheric state variable is usually performed by fitting a linear regression line to a set of data of this variable sampled at different times. Often these data are irregularly sampled in space and time and clustered in a sense that error correlations among data points cause a similar error of data points sampled at similar times. Since this can affect the estimated trend, we suggest to take the full error covariance matrix of the data into account. Superimposed periodic variations can be jointly fitted in a straightforward manner, even if the shape of the periodic function is not known. Global data sets, particularly satellite data, can form the basis to estimate the error correlations. State-dependent amplitudes of superimposed periodic corrections result in a non-linear optimization problem which is solved iteratively.