Home > code > plot > plot_empirical_cf.m

plot_empirical_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 s = csvread(cgmm_config.time_series.file,1,0);
0006 y = log(s);
0007 r = diff(y);
0008 
0009 % create an evaluation grid
0010 grid_min = cgmm_config.cgmm.grid_min;
0011 grid_res = cgmm_config.cgmm.grid_res;
0012 grid_max = cgmm_config.cgmm.grid_max;
0013 grid_margin = grid_min:(grid_max-grid_min)/(grid_res-1):grid_max;
0014 omega = mgrid(grid_margin, 2); % evaluation grid
0015 
0016 phi_emp = mean(exp(1i*r*omega)); % calculate empirical characteristic function
0017 
0018 phi_emp = reshape(phi_emp, sqrt(length(phi_emp)), sqrt(length(phi_emp)));
0019 
0020 subplot(1,2,1);
0021 mesh(grid_margin, grid_margin, real(phi_emp));
0022 title('Empirical - real part');
0023 subplot(1,2,2);
0024 mesh(grid_margin, grid_margin, imag(phi_emp));
0025 title('Empirical - imaginary part');
0026 
0027 print(cgmm_config.plots.cf('empirical'), cgmm_config.plots.device)

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