# Marginal Likelihood of a Gaussian Process Model, Duplicate entries in kernel matrix

I am trying to fit a Gaussian process model using the toolbox and I got stuck in the following problem. Assuming that I have some duplicated data points in my training data, then those will map to duplicated rows in the kernel matrix which will result in both non-invertible kernel matrix and an infinite complexity term. I end up with an infinite log marginal likelihood which I guess due to the problem I explained above. Are there any ideas that could be used to avoid such a behavior?