Home > code > plot > plot_pcsv_cf_sim.m

plot_pcsv_cf_sim

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_0 = repmat(100,1,n);
0021 y_0 = log(S_0);
0022 
0023 % create an evaluation grid
0024 grid_min = cgmm_config.cgmm.grid_min;
0025 grid_res = cgmm_config.cgmm.grid_res;
0026 grid_max = cgmm_config.cgmm.grid_max;
0027 margin = grid_min:(grid_max-grid_min)/(grid_res-1):grid_max;
0028 omega = mgrid(margin, 2); % evaluation grid
0029 
0030 % simulate
0031 dt = 1/250
0032 N = 500;
0033 phi_emp = cf_pcsv_sim(mu, A, lambda_0, kappa, theta, sigma, rho, omega, repmat(y_0, 1/dt, 1), dt, N);
0034 phi_emp = mean(phi_emp);
0035 
0036 phi = cf_pcsv_alternative(mu, A, lambda_0, kappa, theta, sigma, rho, omega, repmat(y_0, 1/dt, 1), dt);
0037 phi = mean(phi);
0038 
0039 phi = reshape(phi, sqrt(length(phi)), sqrt(length(phi)));
0040 phi_emp = reshape(phi_emp, sqrt(length(phi_emp)), sqrt(length(phi_emp)));
0041 
0042 subplot(2,2,1);
0043 mesh(margin, margin, real(phi));
0044 h = title('Theoretical - real part');
0045 
0046 subplot(2,2,3);
0047 mesh(margin, margin, real(phi_emp));
0048 title('Empirical - real part');
0049 subplot(2,2,2);
0050 mesh(margin, margin, imag(phi));
0051 title('Theoretical - imaginary part');
0052 subplot(2,2,4);
0053 mesh(margin, margin, imag(phi_emp));
0054 title('Empirical - imaginary part');
0055 
0056 print('../output/png/pcsv_cf.png', cgmm_config.plots.device)

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