0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 close all
0014 addpath(genpath('../General-Functions/'));
0015
0016
0017 N = 100;
0018 sigma_n = 0;
0019 q = 0.999;
0020 ymin = 100000;
0021 ymax = -100000;
0022
0023
0024
0025
0026 ss = plot_init;
0027 figure('name','Examples for autoregressive processes','color','w','Position',[0.1*ss(1),0.2*ss(2),0.6*ss(1),0.7*ss(2)]); hold on
0028
0029
0030 p = 1;
0031
0032
0033 sigma_e = 1.0;
0034 x11 = generate_observed_ARp(N,p,q,sigma_e,sigma_n);
0035
0036
0037 sigma_e = 0.2;
0038 x12 = generate_observed_ARp(N,p,q,sigma_e,sigma_n);
0039
0040
0041 p = 2;
0042
0043
0044 sigma_e = 1.0;
0045 x21 = generate_observed_ARp(N,p,q,sigma_e,sigma_n);
0046
0047
0048 sigma_e = 0.2;
0049 x22 = generate_observed_ARp(N,p,q,sigma_e,sigma_n);
0050
0051
0052
0053
0054 ymin=min([ymin,min(x11),min(x12),min(x21),min(x22)]);
0055 ymax=max([ymax,max(x11),max(x12),max(x21),max(x22)]);
0056
0057 subplot(2,2,1);
0058 plot(1:N,x11,'.k','LineWidth',2)
0059 xlim([1,N]);ylim([ymin,ymax]);xlabel('$n$');ylabel('$x$');
0060 title('Fig. 2.10a AR(1), $\sigma_e = 1.0$')
0061
0062 subplot(2,2,2);
0063 plot(1:N,x12,'.k','LineWidth',2);
0064 xlim([1,N]);ylim([ymin,ymax]);xlabel('$n$');ylabel('$x$');
0065 title('Fig. 2.10b AR(1), $\sigma_e = 0.2$')
0066
0067 subplot(2,2,3);
0068 plot(1:N,x21,'.k','LineWidth',2)
0069 xlim([1,N]);ylim([ymin,ymax]);xlabel('$n$');ylabel('$x$');
0070 title('Fig. 2.10c AR(2), $\sigma_e = 1.0$')
0071
0072 subplot(2,2,4);
0073 plot(1:N,x22,'.k','LineWidth',2)
0074 xlim([1,N]);ylim([ymin,ymax]);xlabel('$n$');ylabel('$x$');
0075 title('Fig. 2.10d AR(2), $\sigma_e = 0.2$')
0076
0077