0001
0002
0003
0004
0005
0006
0007
0008 close all
0009 clearvars
0010
0011 addpath(genpath('../General-Functions'));
0012
0013
0014 NoSample = 3;
0015 N = 300;
0016
0017
0018 d0 = 20;
0019 sigma = 1;
0020
0021
0022 d0l = 10;
0023 sigma_l = 0.5;
0024 d0r = 40;
0025 sigma_r = 3;
0026 dc = 30;
0027
0028
0029
0030
0031
0032 col=['k','b','r','c','m'];
0033 lin=['-','-','-','-','-'];
0034
0035
0036
0037 ss = plot_init;
0038
0039
0040
0041
0042 Sigma=zeros(N);
0043
0044 for n = 1:N
0045 for m = 1:N
0046 d = (n-m)/d0;
0047 Sigma(n,m) = sigma^2*exp(-d^2/2);
0048 end
0049 end
0050
0051
0052 y = rand_gauss(zeros(N,1),Sigma,NoSample);
0053
0054
0055 figure('name','homogeneous GP','color','w','Position',[0.1*ss(1),0.2*ss(2),0.35*ss(1),0.60*ss(2)]); hold on
0056 for s = 1:NoSample
0057 plot(1:N,y(:,s),strcat(lin(s),col(s)),'LineWidth',2);
0058 end
0059 plot(1:N, -3*sigma*ones(1,N),'--k')
0060 plot(1:N, +3*sigma*ones(1,N),'--k')
0061 xlim([-25,N+25])
0062 ylim([-4.5,+4.5]*sigma)
0063 xlabel('$t$');ylabel('$x$')
0064 title('Fig. 2.9: Samples of homogeneous Gaussian Process')
0065
0066