Home > code > plot > plot_pcsv_cf.m

plot_pcsv_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.pcsv);
0006 
0007 n = 2
0008 p = 2
0009 dt = 1/250
0010 
0011 % rename estimates to make clear that they play the role of true parameters here
0012 mu = mu_cgmm
0013 A = A_cgmm
0014 lambda_0 = lambda_0_cgmm
0015 kappa = kappa_cgmm
0016 theta = theta_cgmm
0017 sigma = sigma_cgmm
0018 rho = rho_cgmm
0019 
0020 s = csvread(cgmm_config.time_series.file,1,1);
0021 y = log(s);
0022 r = diff(y);
0023 
0024 % create an evaluation grid
0025 grid_min = cgmm_config.cgmm.grid_min;
0026 grid_res = cgmm_config.cgmm.grid_res;
0027 grid_max = cgmm_config.cgmm.grid_max;
0028 grid_margin = grid_min:(grid_max-grid_min)/(grid_res-1):grid_max;
0029 omega = mgrid(grid_margin, 2); % evaluation grid
0030 
0031 phi_emp = mean(exp(1i*r*omega)); % calculate empirical characteristic function
0032 phi = cf_pcsv_v(mu, A, lambda_0, kappa, theta, sigma, rho, omega, zeros(30,1), dt);
0033 phi = phi(end,:);
0034 
0035 phi = reshape(phi, sqrt(length(phi)), sqrt(length(phi)));
0036 phi_emp = reshape(phi_emp, sqrt(length(phi_emp)), sqrt(length(phi_emp)));
0037 
0038 subplot(2,2,1);
0039 mesh(grid_margin, grid_margin, real(phi));
0040 h = title('Theoretical - real part');
0041 P = get(h,'Position');
0042 set(h,'Position',[P(1)+50 P(2)+100 P(3)+40])
0043 set(h,'visible', 'off');
0044 
0045 subplot(2,2,3);
0046 mesh(grid_margin, grid_margin, real(phi_emp));
0047 title('Empirical - real part');
0048 subplot(2,2,2);
0049 mesh(grid_margin, grid_margin, imag(phi));
0050 title('Theoretical - imaginary part');
0051 subplot(2,2,4);
0052 mesh(grid_margin, grid_margin, imag(phi_emp));
0053 title('Empirical - imaginary part');
0054 
0055 print(cgmm_config.plots.cf('pcsv'), cgmm_config.plots.device)

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