Home > 02-Probability > fig_2_10_demo_AR_process.m

fig_2_10_demo_AR_process

PURPOSE ^

% Fig. 2.10 page 54

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 2.10 page 54 
 Examples for autoregressive processes

 Calling this function yields four random profiles
 with the same parameters as in Fig. 2.10

 Repeated trials show typical samples

 Wolfgang Förstner 2015
 last changes: Susanne Wenzel 09/16
 wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Fig. 2.10 page 54
0002 % Examples for autoregressive processes
0003 %
0004 % Calling this function yields four random profiles
0005 % with the same parameters as in Fig. 2.10
0006 %
0007 % Repeated trials show typical samples
0008 %
0009 % Wolfgang Förstner 2015
0010 % last changes: Susanne Wenzel 09/16
0011 % wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de
0012 
0013 close all
0014 addpath(genpath('../General-Functions/'));
0015 
0016 %% parameters
0017 N = 100;                  % number of points
0018 sigma_n = 0;              % observational noise
0019 q = 0.999;                % decay of autoregressive processes
0020 ymin = 100000;
0021 ymax = -100000;
0022 
0023 %% prepare figure
0024 % get current screensize, for proper positioning of figures and set default
0025 % plot settings
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 %% AR(1)
0030 p = 1; % order of process
0031 
0032 % example a)
0033 sigma_e = 1.0; % process noise
0034 x11 = generate_observed_ARp(N,p,q,sigma_e,sigma_n);
0035 
0036 % example b)
0037 sigma_e = 0.2; % process noise
0038 x12 = generate_observed_ARp(N,p,q,sigma_e,sigma_n);
0039 
0040 %% AR(2)
0041 p = 2;  % order of process
0042 
0043 % example c)
0044 sigma_e = 1.0; % process noise
0045 x21 = generate_observed_ARp(N,p,q,sigma_e,sigma_n);
0046 
0047 % example d)
0048 sigma_e = 0.2; % process noise
0049 x22 = generate_observed_ARp(N,p,q,sigma_e,sigma_n);
0050 
0051 
0052 %% visualisation
0053 % joint scale
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

Generated on Sat 21-Jul-2018 20:56:10 by m2html © 2005