Home > code > plot > plot_wasc_cf.m

plot_wasc_cf

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.estimates.wasc);
0006 
0007 dt = 1/250
0008 
0009 % rename estimates to make clear that they play the role of true parameters here
0010 mu = mu_cgmm
0011 Sigma_0 = Sigma_0_cgmm
0012 M = M_cgmm
0013 Q = Q_cgmm
0014 rho = rho_cgmm
0015 beta = beta_cgmm
0016 
0017 s = csvread(cgmm_config.time_series.file,1,1);
0018 y = log(s);
0019 r = diff(y);
0020 
0021 grid_min = cgmm_config.cgmm.grid_min;
0022 grid_res = cgmm_config.cgmm.grid_res;
0023 grid_max = cgmm_config.cgmm.grid_max;
0024 grid_margin = grid_min:(grid_max-grid_min)/(grid_res-1):grid_max;
0025 omega = mgrid(grid_margin, 2); % evaluation grid
0026 
0027 phi_emp = mean(exp(1i*r*omega)); % calculate empirical characteristic function
0028 phi = cf_wasc_v(mu, Sigma_0, M, Q, rho, beta, omega, y, dt);
0029 phi = mean(phi);
0030 
0031 phi = reshape(phi, sqrt(length(phi)), sqrt(length(phi)));
0032 phi_emp = reshape(phi_emp, sqrt(length(phi_emp)), sqrt(length(phi_emp)));
0033 
0034 subplot(2,2,1);
0035 mesh(grid_margin, grid_margin, real(phi));
0036 title('Theoretical - real part');
0037 subplot(2,2,3);
0038 mesh(grid_margin, grid_margin, real(phi_emp));
0039 title('Empirical - real part');
0040 subplot(2,2,2);
0041 mesh(grid_margin, grid_margin, imag(phi));
0042 title('Theoretical - imaginary part');
0043 subplot(2,2,4);
0044 mesh(grid_margin, grid_margin, imag(phi_emp));
0045 title('Empirical - imaginary part');
0046 
0047 print(cgmm_config.plots.cf('wasc'), cgmm_config.plots.device)

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