Commit d6feff5d authored by Emile Contal's avatar Emile Contal
Browse files

add basis function to sampling GP

parent 7fe00201
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -57,7 +57,11 @@ if opt.verbose; fprintf('generating fn...\n'); end
Xs = opt.size * rand(opt.ns, opt.d);
Xt = Xs(1:opt.nt,:);
Kss = opt.kernel(Xs,Xs);
B = opt.basis(Xs);
Fs = cholpsd(Kss)' * randn(opt.ns, 1);
if B
    Fs = Fs + B*randn(size(B,2),1);
end
f = @(X) Fs(X) + opt.noise * randn(size(X,1), 1);
Yt = f(1:opt.nt);