I am using gaussian process for regression and i would like to know if there is any way to design a kernel that ensure that my function is always non-negative. All my observables are positive and i would like points between them to be as well but sometimes the function dives under 0 values because of variations, can i prevent it ?
-
$\begingroup$ Can you give sample code, sample data? Different languages have different tools and approaches. is this R, MatLab, SAS, Python, Julia or Erlang? Is the problem fundamental to your algorithm, or is there a simple switch to flip that will "make all better"? $\endgroup$– EngrStudentCommented Aug 31, 2015 at 12:30
-
$\begingroup$ @EngrStudent : give sample code or data is pretty hard.. The code is c++ written by myself. The data consist in a n * d matrix with n=100 and d=260 000. $\endgroup$– IrminsulCommented Aug 31, 2015 at 14:43
-
$\begingroup$ Have you tested the code against known sets to confirm that it does everything it should, and doesn't do anything that it shouldn't? $\endgroup$– EngrStudentCommented Aug 31, 2015 at 15:43
2 Answers
Not really. A Gaussian process produces gaussian variates and these have infinite support. Theoretically, your function could dip below 0.
In practice, if the you give the process a positive mean that is several standard deviations (at least 4) from 0, the probability of going negative will be very small.
If you are prepared to go non-Gaussian, you could take any Gaussian process you liked and then square the results. These will be positive, although your process will no longer be Gaussian.
-
$\begingroup$ My answer was meant to only add links / references to yours, but I do agree! $\endgroup$– j__Commented Sep 1, 2015 at 9:37
There are two interesting ways to get around this which are approximate but very useful. Both methods model a warping of the original space. Osborne et al. (http://www.robots.ox.ac.uk/~mosb/public/pdf/133/bbq_nips_final.pdf) models the log of the function space and Gunter et al. (http://www.robots.ox.ac.uk/~mosb/public/pdf/266/Gunter%20et%20al.%20-%202014%20-%20Sampling%20for%20Inference%20in%20Probabilistic%20Models%20wit.pdf) model the square root of the function.
Of course this will not be a Gaussian process (instead for example it would be an approximate chi process) in the original space but it may be an appropriate technique for you.