Home > code > plot > plot_wasc_mc.m

plot_wasc_mc

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 cd('..');
0002 boot;
0003 cd(cgmm_config.directories.plot);
0004 
0005 load(cgmm_config.monte_carlo.wasc);
0006 
0007 all_re = zeros(size(estimates{1},1)-1,length(time_steps));
0008 
0009 mean_mre = zeros(1, length(time_steps));
0010 std_mre = zeros(1, length(time_steps));
0011 
0012 for k=1:length(time_steps)
0013   theta = estimates{k};
0014   theta_true = theta(1,:);
0015   theta = theta(2:end,:);
0016   theta_true = repmat(theta_true, size(theta,1) ,1);
0017   re = abs(theta-theta_true) ./ abs(theta_true);
0018   mre = mean(re);
0019   stdre = std(re);
0020   % all estimates
0021   all_re(:,k) = mean(re,2);
0022   mean_mre(k) = mean(mre);
0023   std_mre(k) = std(mre);
0024   % M
0025   M_mre(k) = mean(mre(1:4));
0026   % Q
0027   Q_mre(k) = mean(mre(5:8));
0028   % rho
0029   rho_mre(k) = mean(mre(9:10));
0030   % beta
0031   beta_mre(k) = mre(11);
0032 end
0033 
0034 subplot(2,1,1);
0035 
0036 plot(time_steps, all_re, 'k');
0037 hold on;
0038 plot(time_steps, mean_mre, 'r', 'linewidth', 5);
0039 hold off;
0040 legend('100 independent simulations', 'Mean of all simulations', 'location', 'southwest');
0041 ylabel('mean relative error');
0042 xlabel('number of data points in time series');
0043 title('WASC first step mean relative estimation errors');
0044 
0045 subplot(2,1,2);
0046 plot(time_steps, std_mre);
0047 ylabel('standard deviation of mean relative error');
0048 xlabel('number of data points in time series');
0049 
0050 print(cgmm_config.plots.mre.all('wasc'), cgmm_config.plots.device)
0051 
0052 subplot(2,2,1);
0053 plot(time_steps, M_mre);
0054 title('M');
0055 subplot(2,2,2);
0056 plot(time_steps, Q_mre);
0057 title('Q');
0058 subplot(2,2,3);
0059 plot(time_steps, rho_mre);
0060 title('rho');
0061 subplot(2,2,4);
0062 plot(time_steps, beta_mre);
0063 title('beta');
0064 
0065 print(cgmm_config.plots.mre.individual('wasc'), cgmm_config.plots.device)

Generated on Mon 29-Apr-2013 19:29:13 by m2html © 2005