MATLAB Answers

LogLikelihood for Gaussian Process regression (function: `fitgpr`) for given set of hyperparameter

19 views (last 30 days)
Pankaj
Pankaj on 5 Aug 2017
Commented: Pankaj on 7 Feb 2018
I am interested in calculating LogLikelihood using Gaussian Process for given hyperparameters and noise parameter i.e. without optimizing for parameters.
In the following example; [3.5, 6.2, 0.2] are provided as parameters and since 'FitMethod' is 'none' fitgpr will not optimize for parameters
load(fullfile(matlabroot,'examples','stats','gprdata2.mat'))
sigma0 = 0.2;
kparams0 = [3.5, 6.2];
gprMdl2 = fitrgp(x,y,'KernelFunction','squaredexponential',...
'FitMethod','none', 'KernelParameters',kparams0,'Sigma',sigma0);
ypred2 = resubPredict(gprMdl2);
but variable gprMdl2.LofLikelihood = [ ], I am interested in LogLikelihood precisely for parameters [3.5, 6.2, 0.2] not for optimized ones.
Thanks
This question is in continuation to this post.

  0 Comments

Sign in to comment.

Accepted Answer

Gautam Pendse
Gautam Pendse on 6 Feb 2018
Hi Pankaj,
Loglikelihood is not calculated for 'FitMethod','none'. As a temporary workaround, there is an undocumented internal feature that does this calculation:
gprMdl2.Impl.computeLogLikelihoodExact()
Hope this helps,
Gautam

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!