├── DCC_toolbox ├── DCC2 │ ├── F.m │ ├── F.prj │ ├── F_mex.mexmaci64 │ ├── G.m │ ├── G.prj │ ├── G_mex.mexmaci64 │ ├── GarchDCC_X_example_2.m │ ├── LcOriginal.m │ ├── LcOriginal.prj │ ├── LcOriginal_mex.mexmaci64 │ ├── LcOriginal_mex.mexw64 │ ├── codegen │ │ └── mex │ │ │ ├── F │ │ │ ├── F.cpp │ │ │ ├── F.h │ │ │ ├── F.o │ │ │ ├── F_data.cpp │ │ │ ├── F_data.h │ │ │ ├── F_data.o │ │ │ ├── F_emxutil.cpp │ │ │ ├── F_emxutil.h │ │ │ ├── F_emxutil.o │ │ │ ├── F_initialize.cpp │ │ │ ├── F_initialize.h │ │ │ ├── F_initialize.o │ │ │ ├── F_mex.mexmaci64 │ │ │ ├── F_mex.mk │ │ │ ├── F_mex.mki │ │ │ ├── F_mex.sh │ │ │ ├── F_mex_mex.map │ │ │ ├── F_terminate.cpp │ │ │ ├── F_terminate.h │ │ │ ├── F_terminate.o │ │ │ ├── F_types.h │ │ │ ├── _coder_F_api.o │ │ │ ├── _coder_F_info.o │ │ │ ├── _coder_F_mex.o │ │ │ ├── buildInfo.mat │ │ │ ├── eml_int_forloop_overflow_check.cpp │ │ │ ├── eml_int_forloop_overflow_check.h │ │ │ ├── eml_int_forloop_overflow_check.o │ │ │ ├── epsilonToY.cpp │ │ │ ├── epsilonToY.h │ │ │ ├── epsilonToY.o │ │ │ ├── error.cpp │ │ │ ├── error.h │ │ │ ├── error.o │ │ │ ├── gcGuiReport.mat │ │ │ ├── html │ │ │ │ ├── F1_mcode.html │ │ │ │ ├── F1_watch.html │ │ │ │ ├── F_buildlog1.html │ │ │ │ ├── F_buildlog2.html │ │ │ │ ├── F_buildlog3.html │ │ │ │ ├── F_buildlog4.html │ │ │ │ ├── F_cpp.html │ │ │ │ ├── F_data_cpp.html │ │ │ │ ├── F_data_h.html │ │ │ │ ├── F_emxutil_cpp.html │ │ │ │ ├── F_emxutil_h.html │ │ │ │ ├── F_h.html │ │ │ │ ├── F_initialize_cpp.html │ │ │ │ ├── F_initialize_h.html │ │ │ │ ├── F_terminate_cpp.html │ │ │ │ ├── F_terminate_h.html │ │ │ │ ├── F_types_h.html │ │ │ │ ├── _coder_F_api_cpp.html │ │ │ │ ├── _coder_F_api_h.html │ │ │ │ ├── _coder_F_info_cpp.html │ │ │ │ ├── _coder_F_info_h.html │ │ │ │ ├── _coder_F_mex_cpp.html │ │ │ │ ├── _coder_F_mex_h.html │ │ │ │ ├── contents_file.tmp │ │ │ │ ├── eml_int_forloop_overflow_check_cpp.html │ │ │ │ ├── eml_int_forloop_overflow_check_h.html │ │ │ │ ├── epsilonToY93_mcode.html │ │ │ │ ├── epsilonToY93_watch.html │ │ │ │ ├── epsilonToY_cpp.html │ │ │ │ ├── epsilonToY_h.html │ │ │ │ ├── error_cpp.html │ │ │ │ ├── error_h.html │ │ │ │ ├── exported_values.mat │ │ │ │ ├── hilite_warning.png │ │ │ │ ├── index.css │ │ │ │ ├── index.html │ │ │ │ ├── mean_cpp.html │ │ │ │ ├── mean_h.html │ │ │ │ ├── mex_warning.html │ │ │ │ ├── power_cpp.html │ │ │ │ ├── power_h.html │ │ │ │ ├── resources │ │ │ │ │ ├── Error_document.gif │ │ │ │ │ ├── Fatal_document.gif │ │ │ │ │ ├── Warning_document.gif │ │ │ │ │ ├── cc_sourcecodec.png │ │ │ │ │ ├── collapsible-last.gif │ │ │ │ │ ├── collapsible.gif │ │ │ │ │ ├── cs_document_check.png │ │ │ │ │ ├── cs_document_error.png │ │ │ │ │ ├── cs_document_warning.png │ │ │ │ │ ├── cs_folder_close_check.png │ │ │ │ │ ├── cs_folder_close_error.png │ │ │ │ │ ├── cs_folder_close_warning.png │ │ │ │ │ ├── cs_folder_open_check.png │ │ │ │ │ ├── cs_folder_open_error.png │ │ │ │ │ ├── cs_folder_open_warning.png │ │ │ │ │ ├── css │ │ │ │ │ │ └── coder_app.css │ │ │ │ │ ├── emcvhtml.js │ │ │ │ │ ├── eml_report.css │ │ │ │ │ ├── eml_report_interactions.js │ │ │ │ │ ├── eml_report_layout.js │ │ │ │ │ ├── expandable-last.gif │ │ │ │ │ ├── expandable.gif │ │ │ │ │ ├── folderclosed.gif │ │ │ │ │ ├── folderopen.gif │ │ │ │ │ ├── help.png │ │ │ │ │ ├── hilite_warning.png │ │ │ │ │ ├── inspect.html │ │ │ │ │ ├── jQuery │ │ │ │ │ │ ├── jquery-1.3.2.min.js │ │ │ │ │ │ ├── jquery-ui-1.7.custom.min.js │ │ │ │ │ │ ├── jquery.hotkeys-0.7.8.js │ │ │ │ │ │ ├── jquery.tablesorter.mod.js │ │ │ │ │ │ └── ui.resizable.css │ │ │ │ │ ├── js │ │ │ │ │ │ └── coder_app.js │ │ │ │ │ ├── leaf-last.gif │ │ │ │ │ ├── leaf.gif │ │ │ │ │ ├── matlab-report-styles.css │ │ │ │ │ ├── mhighlight.css │ │ │ │ │ ├── nav.html │ │ │ │ │ ├── navToolbar.html │ │ │ │ │ ├── nolines_minus.gif │ │ │ │ │ ├── nolines_plus.gif │ │ │ │ │ ├── right_arrow.gif │ │ │ │ │ ├── rtwannotate.js │ │ │ │ │ ├── rtwhilite.js │ │ │ │ │ ├── rtwmsg.html │ │ │ │ │ ├── rtwreport.css │ │ │ │ │ ├── rtwreport_utils.js │ │ │ │ │ ├── rtwshrink.js │ │ │ │ │ ├── search.js │ │ │ │ │ ├── spinner.gif │ │ │ │ │ ├── status_failed.png │ │ │ │ │ ├── status_passed.png │ │ │ │ │ ├── status_warning.png │ │ │ │ │ ├── tablesorter_bkgrd.png │ │ │ │ │ ├── texture_blue.png │ │ │ │ │ ├── texture_gray1.png │ │ │ │ │ ├── texture_gray2.png │ │ │ │ │ └── webview_codegen.js │ │ │ │ ├── rt_nonfinite_h.html │ │ │ │ ├── rtwshrink.js │ │ │ │ ├── rtwtypes_h.html │ │ │ │ ├── scalexpAlloc_cpp.html │ │ │ │ ├── scalexpAlloc_h.html │ │ │ │ ├── sqrt_cpp.html │ │ │ │ ├── sqrt_h.html │ │ │ │ ├── warning_cpp.html │ │ │ │ └── warning_h.html │ │ │ ├── interface │ │ │ │ ├── _coder_F_api.cpp │ │ │ │ ├── _coder_F_api.h │ │ │ │ ├── _coder_F_info.cpp │ │ │ │ ├── _coder_F_info.h │ │ │ │ ├── _coder_F_mex.cpp │ │ │ │ └── _coder_F_mex.h │ │ │ ├── mean.cpp │ │ │ ├── mean.h │ │ │ ├── mean.o │ │ │ ├── power.cpp │ │ │ ├── power.h │ │ │ ├── power.o │ │ │ ├── rt_nonfinite.h │ │ │ ├── rtwtypes.h │ │ │ ├── scalexpAlloc.cpp │ │ │ ├── scalexpAlloc.h │ │ │ ├── scalexpAlloc.o │ │ │ ├── setEnv.sh │ │ │ ├── sqrt.cpp │ │ │ ├── sqrt.h │ │ │ ├── sqrt.o │ │ │ ├── warning.cpp │ │ │ ├── warning.h │ │ │ └── warning.o │ │ │ └── G │ │ │ ├── G.cpp │ │ │ ├── G.h │ │ │ ├── G.o │ │ │ ├── G_data.cpp │ │ │ ├── G_data.h │ │ │ ├── G_data.o │ │ │ ├── G_emxutil.cpp │ │ │ ├── G_emxutil.h │ │ │ ├── G_emxutil.o │ │ │ ├── G_initialize.cpp │ │ │ ├── G_initialize.h │ │ │ ├── G_initialize.o │ │ │ ├── G_mex.mexmaci64 │ │ │ ├── G_mex.mk │ │ │ ├── G_mex.mki │ │ │ ├── G_mex.sh │ │ │ ├── G_mex_mex.map │ │ │ ├── G_terminate.cpp │ │ │ ├── G_terminate.h │ │ │ ├── G_terminate.o │ │ │ ├── G_types.h │ │ │ ├── _coder_G_api.o │ │ │ ├── _coder_G_info.o │ │ │ ├── _coder_G_mex.o │ │ │ ├── buildInfo.mat │ │ │ ├── eml_int_forloop_overflow_check.cpp │ │ │ ├── eml_int_forloop_overflow_check.h │ │ │ ├── eml_int_forloop_overflow_check.o │ │ │ ├── epsilonToY.cpp │ │ │ ├── epsilonToY.h │ │ │ ├── epsilonToY.o │ │ │ ├── error.cpp │ │ │ ├── error.h │ │ │ ├── error.o │ │ │ ├── gcGuiReport.mat │ │ │ ├── html │ │ │ ├── G1_mcode.html │ │ │ ├── G1_watch.html │ │ │ ├── G_buildlog1.html │ │ │ ├── G_buildlog2.html │ │ │ ├── G_buildlog3.html │ │ │ ├── G_buildlog4.html │ │ │ ├── G_cpp.html │ │ │ ├── G_data_cpp.html │ │ │ ├── G_data_h.html │ │ │ ├── G_emxutil_cpp.html │ │ │ ├── G_emxutil_h.html │ │ │ ├── G_h.html │ │ │ ├── G_initialize_cpp.html │ │ │ ├── G_initialize_h.html │ │ │ ├── G_terminate_cpp.html │ │ │ ├── G_terminate_h.html │ │ │ ├── G_types_h.html │ │ │ ├── _coder_G_api_cpp.html │ │ │ ├── _coder_G_api_h.html │ │ │ ├── _coder_G_info_cpp.html │ │ │ ├── _coder_G_info_h.html │ │ │ ├── _coder_G_mex_cpp.html │ │ │ ├── _coder_G_mex_h.html │ │ │ ├── contents_file.tmp │ │ │ ├── eml_int_forloop_overflow_check_cpp.html │ │ │ ├── eml_int_forloop_overflow_check_h.html │ │ │ ├── epsilonToY93_mcode.html │ │ │ ├── epsilonToY93_watch.html │ │ │ ├── epsilonToY_cpp.html │ │ │ ├── epsilonToY_h.html │ │ │ ├── error_cpp.html │ │ │ ├── error_h.html │ │ │ ├── exported_values.mat │ │ │ ├── hilite_warning.png │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ ├── mean_cpp.html │ │ │ ├── mean_h.html │ │ │ ├── mex_warning.html │ │ │ ├── power_cpp.html │ │ │ ├── power_h.html │ │ │ ├── resources │ │ │ │ ├── Error_document.gif │ │ │ │ ├── Fatal_document.gif │ │ │ │ ├── Warning_document.gif │ │ │ │ ├── cc_sourcecodec.png │ │ │ │ ├── collapsible-last.gif │ │ │ │ ├── collapsible.gif │ │ │ │ ├── cs_document_check.png │ │ │ │ ├── cs_document_error.png │ │ │ │ ├── cs_document_warning.png │ │ │ │ ├── cs_folder_close_check.png │ │ │ │ ├── cs_folder_close_error.png │ │ │ │ ├── cs_folder_close_warning.png │ │ │ │ ├── cs_folder_open_check.png │ │ │ │ ├── cs_folder_open_error.png │ │ │ │ ├── cs_folder_open_warning.png │ │ │ │ ├── css │ │ │ │ │ └── coder_app.css │ │ │ │ ├── emcvhtml.js │ │ │ │ ├── eml_report.css │ │ │ │ ├── eml_report_interactions.js │ │ │ │ ├── eml_report_layout.js │ │ │ │ ├── expandable-last.gif │ │ │ │ ├── expandable.gif │ │ │ │ ├── folderclosed.gif │ │ │ │ ├── folderopen.gif │ │ │ │ ├── help.png │ │ │ │ ├── hilite_warning.png │ │ │ │ ├── inspect.html │ │ │ │ ├── jQuery │ │ │ │ │ ├── jquery-1.3.2.min.js │ │ │ │ │ ├── jquery-ui-1.7.custom.min.js │ │ │ │ │ ├── jquery.hotkeys-0.7.8.js │ │ │ │ │ ├── jquery.tablesorter.mod.js │ │ │ │ │ └── ui.resizable.css │ │ │ │ ├── js │ │ │ │ │ └── coder_app.js │ │ │ │ ├── leaf-last.gif │ │ │ │ ├── leaf.gif │ │ │ │ ├── matlab-report-styles.css │ │ │ │ ├── mhighlight.css │ │ │ │ ├── nav.html │ │ │ │ ├── navToolbar.html │ │ │ │ ├── nolines_minus.gif │ │ │ │ ├── nolines_plus.gif │ │ │ │ ├── right_arrow.gif │ │ │ │ ├── rtwannotate.js │ │ │ │ ├── rtwhilite.js │ │ │ │ ├── rtwmsg.html │ │ │ │ ├── rtwreport.css │ │ │ │ ├── rtwreport_utils.js │ │ │ │ ├── rtwshrink.js │ │ │ │ ├── search.js │ │ │ │ ├── spinner.gif │ │ │ │ ├── status_failed.png │ │ │ │ ├── status_passed.png │ │ │ │ ├── status_warning.png │ │ │ │ ├── tablesorter_bkgrd.png │ │ │ │ ├── texture_blue.png │ │ │ │ ├── texture_gray1.png │ │ │ │ ├── texture_gray2.png │ │ │ │ └── webview_codegen.js │ │ │ ├── rt_nonfinite_h.html │ │ │ ├── rtwshrink.js │ │ │ ├── rtwtypes_h.html │ │ │ ├── scalexpAlloc_cpp.html │ │ │ ├── scalexpAlloc_h.html │ │ │ ├── sqrt_cpp.html │ │ │ ├── sqrt_h.html │ │ │ ├── warning_cpp.html │ │ │ └── warning_h.html │ │ │ ├── interface │ │ │ ├── _coder_G_api.cpp │ │ │ ├── _coder_G_api.h │ │ │ ├── _coder_G_info.cpp │ │ │ ├── _coder_G_info.h │ │ │ ├── _coder_G_mex.cpp │ │ │ └── _coder_G_mex.h │ │ │ ├── mean.cpp │ │ │ ├── mean.h │ │ │ ├── mean.o │ │ │ ├── power.cpp │ │ │ ├── power.h │ │ │ ├── power.o │ │ │ ├── rt_nonfinite.h │ │ │ ├── rtwtypes.h │ │ │ ├── scalexpAlloc.cpp │ │ │ ├── scalexpAlloc.h │ │ │ ├── scalexpAlloc.o │ │ │ ├── setEnv.sh │ │ │ ├── sqrt.cpp │ │ │ ├── sqrt.h │ │ │ ├── sqrt.o │ │ │ ├── warning.cpp │ │ │ ├── warning.h │ │ │ └── warning.o │ ├── dccMLE.m │ ├── epsilonToR_2.m │ ├── epsilonToY.m │ ├── garchDCC_X.m │ ├── generateData.m │ ├── generateData_corr.m │ └── myFixPointFinder.m ├── DCCcode │ ├── DCC.m │ ├── DCCsimple.m │ ├── dcc_hessian.m │ ├── dcc_mvgarch.m │ ├── dcc_mvgarch_full_likelihood.m │ ├── dcc_mvgarch_likelihood.m │ ├── dcc_univariate_simulate.m │ ├── fattailed_garch.m │ ├── fattailed_garchlikelihood.m │ ├── garchcore.m │ ├── hessian_2sided.m │ ├── license.txt │ └── tempHt.mat ├── Example.m ├── GarchDCC_X │ ├── DCC_X.m │ ├── DCC_X_mex.m │ ├── GarchDCC_X.mltbx │ ├── GarchDCC_X_example.m │ ├── LcOriginal.m │ ├── LcOriginal_mex.mexmaci64 │ ├── LcOriginal_mex.mexw64 │ ├── demos.xml │ ├── epsilonToR.m │ ├── generateData.m │ ├── html │ │ ├── GarchDCC_X_example.html │ │ ├── GarchDCC_X_example.png │ │ └── GarchDCC_X_example_01.png │ ├── loglikelihood_garch11.m │ └── rToEpsilon.m ├── README.rtf ├── SWcode │ ├── sliding_window.m │ └── tapered_sliding_window.m ├── Simulations │ ├── dcc_sim1.m │ ├── dcc_sim1_get_tpr_fpr.m │ └── dcc_sim_generate_data1.m ├── rest05_DCC.m └── tempHt.mat ├── DCD ├── DCD.m ├── DCD.mltbx ├── SignificantSingle1.m ├── SignificantSingle2.m ├── Split1.m ├── Split2.m ├── SplitSearch1.m ├── SplitSearch2.m ├── featureSelect.m ├── fun1.m └── home │ └── yuting │ └── Dropbox │ └── Ubuntu_to_Windows │ └── 20150210_DCD │ ├── SignificantSingle1.m │ ├── SignificantSingle2.m │ ├── Split1.m │ ├── Split2.m │ ├── SplitSearch1.m │ ├── SplitSearch2.m │ ├── featureSelect.m │ └── fun1.m └── README.md /DCC_toolbox/DCC2/F.m: -------------------------------------------------------------------------------- 1 | function [ para_new ] = F(para,Y0,vecS0) 2 | % Calculate mapping F 3 | % Input: 4 | % para: 1-by-2 DCC parameters 5 | % Y0,vecS0: a series of vecterized outer product from standardized residual time series 6 | % Output: 7 | % para_new: mapping F(para,Y0,vecS0) 8 | % Function dependency: 9 | % epsilonToY.m 10 | 11 | %% initialization 12 | T = size(Y0,2); 13 | K = floor(sqrt(length(vecS0)*2)); 14 | theta = 1-sum(para); 15 | 16 | %% update the design matrix via DCC formular with old para 17 | 18 | Qdiag = zeros(K,T); 19 | Qdiag(:,1) = 1; 20 | 21 | Ydiag = Y0(1:K,:); 22 | Sdiag = vecS0(1:K,1); 23 | 24 | for t = 2:T 25 | temp = Ydiag(:,t-1).*Qdiag(:,t-1); 26 | Qdiag(:,t) = theta*Sdiag + para(1)*temp + para(2)*Qdiag(:,t-1); 27 | end 28 | 29 | VU = epsilonToY( sqrt(Qdiag') ); 30 | 31 | Y = Y0.*VU; 32 | vecS = mean(Y,2); 33 | Y = Y - vecS*ones(1,T); 34 | 35 | U = zeros(K*(K+1)/2,T); 36 | U(:,1) = [ones(1,K) zeros(1,K*(K-1)/2)]' - vecS; 37 | X = zeros(size(Y0,1),2,T); 38 | X(:,1,1) = Y(:,1); X(:,2,1) = U(:,1); 39 | 40 | for t = 2:T 41 | U(:,t) = para(1)*Y(:,t-1) + para(2)*U(:,t-1); 42 | X(:,1,t) = Y(:,t); 43 | X(:,2,t) = U(:,t); 44 | end 45 | 46 | %% convex optimization step 47 | b = zeros(2,1); 48 | A = zeros(2,2); 49 | 50 | for t = 2:T 51 | b = b + X(:,:,t-1)'*Y(:,t); 52 | A = A + X(:,:,t-1)'*X(:,:,t-1); 53 | end 54 | 55 | A = A/T; 56 | b = b/T; 57 | %para_new = (inv(A)*b)'; 58 | para_new = (A\b)'; 59 | 60 | if ~(para_new(1)>=0 && para_new(2)>=0 && (para_new(1)+para_new(2))<1) 61 | eta = 10^(-5); 62 | 63 | obj = zeros(1,3); 64 | paraAtBoundary = zeros(3,2); 65 | % case 1) para = [?, 0] 66 | p1 = b(1)/A(1,1); 67 | if p1 < 0 68 | p1 = eta; 69 | elseif p1 > 1 70 | p1 = 1-eta; 71 | end 72 | paraAtBoundary(1,:) = [p1 0]; 73 | % case 2) para = [0, ?] 74 | p2 = b(2)/A(2,2); 75 | if p2 < 0 76 | p2 = eta; 77 | elseif p2 > 1 78 | p2 = 1-eta; 79 | end 80 | paraAtBoundary(2,:) = [p2 0]; 81 | % case 3) para(1)+para(2) = 1 82 | p1 = ((b(1)-b(2))/2 + A(2,2)-A(1,2))/(A(1,1)-2*A(1,2)+A(2,2)); 83 | if p1 < 0 84 | p1 = eta; 85 | elseif p1 > 1 86 | p1 = 1-eta; 87 | end 88 | p2 = 1-p1-eta; 89 | paraAtBoundary(3,:) = [p1 p2]; 90 | 91 | for k=1:3 92 | obj(k) = paraAtBoundary(k,:)*A*paraAtBoundary(k,:)' - 2*paraAtBoundary(k,:)*b; 93 | end 94 | 95 | [val,index] = min(obj); 96 | if val < 0 97 | para_new = paraAtBoundary(index,:); 98 | else 99 | para_new = [0 0]; 100 | end 101 | end 102 | 103 | end -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/F_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/F_mex.mexmaci64 -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/G.m: -------------------------------------------------------------------------------- 1 | function [ g ] = G( para,Y0,vecS0 ) 2 | % Auxiliary function, calculate || F(para,Y0,vecS0)-para ||^2 3 | % Used by: 4 | % myFixPointFinder.m 5 | % Function dependency: 6 | % epsilonToY.m 7 | 8 | %% initialization 9 | T = size(Y0,2); 10 | K = floor(sqrt(length(vecS0)*2)); 11 | theta = 1-sum(para); 12 | 13 | %% update the design matrix via DCC formular with old para 14 | 15 | Qdiag = zeros(K,T); 16 | Qdiag(:,1) = 1; 17 | 18 | Ydiag = Y0(1:K,:); 19 | Sdiag = vecS0(1:K,1); 20 | 21 | for t = 2:T 22 | temp = Ydiag(:,t-1).*Qdiag(:,t-1); 23 | Qdiag(:,t) = theta*Sdiag + para(1)*temp + para(2)*Qdiag(:,t-1); 24 | end 25 | 26 | VU = epsilonToY( sqrt(Qdiag') ); 27 | 28 | Y = Y0.*VU; 29 | vecS = mean(Y,2); 30 | Y = Y - vecS*ones(1,T); 31 | 32 | U = zeros(K*(K+1)/2,T); 33 | U(:,1) = [ones(1,K) zeros(1,K*(K-1)/2)]' - vecS; 34 | X = zeros(size(Y0,1),2,T); 35 | X(:,1,1) = Y(:,1); X(:,2,1) = U(:,1); 36 | 37 | for t = 2:T 38 | U(:,t) = para(1)*Y(:,t-1) + para(2)*U(:,t-1); 39 | X(:,1,t) = Y(:,t); 40 | X(:,2,t) = U(:,t); 41 | end 42 | 43 | %% convex optimization step 44 | b = zeros(2,1); 45 | A = zeros(2,2); 46 | 47 | for t = 2:T 48 | b = b + X(:,:,t-1)'*Y(:,t); 49 | A = A + X(:,:,t-1)'*X(:,:,t-1); 50 | end 51 | A = A/T; 52 | b = b/T; 53 | %para_new = (inv(A)*b)'; 54 | para_new = (A\b)'; 55 | 56 | if ~(para_new(1)>=0 && para_new(2)>=0 && (para_new(1)+para_new(2))<1) 57 | eta = 10^(-5); 58 | 59 | obj = zeros(1,3); 60 | paraAtBoundary = zeros(3,2); 61 | % case 1) para = [?, 0] 62 | p1 = b(1)/A(1,1); 63 | if p1 < 0 64 | p1 = eta; 65 | elseif p1 > 1 66 | p1 = 1-eta; 67 | end 68 | paraAtBoundary(1,:) = [p1 0]; 69 | % case 2) para = [0, ?] 70 | p2 = b(2)/A(2,2); 71 | if p2 < 0 72 | p2 = eta; 73 | elseif p2 > 1 74 | p2 = 1-eta; 75 | end 76 | paraAtBoundary(2,:) = [p2 0]; 77 | % case 3) para(1)+para(2) = 1 78 | p1 = ((b(1)-b(2))/2 + A(2,2)-A(1,2))/(A(1,1)-2*A(1,2)+A(2,2)); 79 | if p1 < 0 80 | p1 = eta; 81 | elseif p1 > 1 82 | p1 = 1-eta; 83 | end 84 | p2 = 1-p1-eta; 85 | paraAtBoundary(3,:) = [p1 p2]; 86 | 87 | for k=1:3 88 | obj(k) = paraAtBoundary(k,:)*A*paraAtBoundary(k,:)' - 2*paraAtBoundary(k,:)*b; 89 | end 90 | 91 | [val,index] = min(obj); 92 | if val < 0 93 | para_new = paraAtBoundary(index,:); 94 | else 95 | para_new = [0 0]; 96 | end 97 | end 98 | 99 | %% calculate function G 100 | %g = F(para,Y0,vecS0) - para; 101 | g = sum((para_new - para).^2); 102 | 103 | end -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/G_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/G_mex.mexmaci64 -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/GarchDCC_X_example_2.m: -------------------------------------------------------------------------------- 1 | %% Step (1) Generate Data from Garch-DCC model 2 | K = 2; % dimension of time series 3 | T = 2000; % time series length 4 | burnIn = 500; 5 | 6 | % parameters for modelling the volatility of each dimension as a Garch(1,1) process 7 | theta = [0.01 0.05 0.9]; 8 | % parameters for conditional correlations 9 | para = [0.1 0.8]; 10 | % generate data with true DCC model 11 | % r = T-by-K data matrix 12 | % H0: K*K*T matrix containing H_1,...,H_T, where H_t is the true conditional covariance matrix at time t. 13 | % R0: K*K*T matrix containing R_1,...,R_T, where R_t is the true conditional correlation matrix at time t. 14 | [ r, H0, R0 ] = generateData( K, T, theta, para, burnIn ); 15 | 16 | %% Step (2) Run garchDCC_X under different Parameter Settings 17 | % (2.1) original dcc MLE estimator 18 | method = 0; 19 | deMean = 1; 20 | tic 21 | [ X1, timeX1, dat1 ] = garchDCC_X( r, method, deMean ); 22 | toc 23 | 24 | % (2.2) new moment estimator 25 | method = 1; 26 | deMean = 1; 27 | tic 28 | [ X2, timeX2, dat2 ] = garchDCC_X( r, method, deMean ); 29 | toc 30 | 31 | %% Step (3) compare estimate H,R with true value H0,R0 32 | i = 4; 33 | j = 5; 34 | 35 | figure 36 | subplot 121 37 | plot(1:T,squeeze(H0(i,j,:)),'k.-',1:T,squeeze(dat1.H(i,j,:)),'b.-',1:T,squeeze(dat2.H(i,j,:)),'r.-') 38 | xlabel('time') 39 | title('Compare an element in time varying covariance matrix ') 40 | legend('truth','MLE','new') 41 | 42 | subplot 122 43 | plot(1:T,squeeze(R0(i,j,:)),'k.-',1:T,squeeze(dat1.R(i,j,:)),'b.-',1:T,squeeze(dat2.R(i,j,:)),'r.-') 44 | xlabel('time') 45 | title('Compare an element in time varying correlation matrix ') 46 | legend('truth','MLE','new') -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/LcOriginal.m: -------------------------------------------------------------------------------- 1 | function [ output ] = LcOriginal( epsilon, para ) 2 | % Calculate the correlation component in log-likelihood, eq.(29) in ref paper 3 | % Syntax: 4 | % [ output ] = LcOriginal( epsilon, para ) 5 | % Input: 6 | % epsilon: standardized residual time series, size T-by-K 7 | % para: 1-by-2 dcc parameter vector 8 | % Output: 9 | % a real number proportional to the correlation component in negative log-likelihood( to be minimized ) 10 | % Used by: 11 | % dcMLE.m 12 | 13 | T = size(epsilon,1); 14 | K = size(epsilon,2); 15 | 16 | %S2 = corr(epsilon); 17 | S2 = cov(epsilon); 18 | SS = S2*(1-sum(para)); 19 | 20 | Q = S2; 21 | R = diag(1./sqrt(diag(Q)))*Q*diag(1./sqrt(diag(Q))); 22 | 23 | output = 0; 24 | 25 | if K==2 26 | % when K = 2, use some complicate expression to speed up 27 | p = R(1,2); 28 | for t = 1:T 29 | output = output + log(1-p^2) + (sum(epsilon(t,:).^2)- p*epsilon(t,1)*epsilon(t,2))/(1-p^2); 30 | temp = epsilon(t,:).*sqrt(diag(Q))'; 31 | Q = SS + para(1)*(temp'*temp) + para(2)*Q; 32 | p = Q(1,2)/sqrt(Q(1,1)*Q(2,2)); 33 | end 34 | else 35 | for t = 1:T 36 | output = output + log(det(R)) + epsilon(t,:)/R*epsilon(t,:)'; 37 | temp = epsilon(t,:).*sqrt(diag(Q))'; 38 | Q = SS + para(1)*(temp'*temp) + para(2)*Q; 39 | R = diag(1./sqrt(diag(Q)))*Q*diag(1./sqrt(diag(Q))); 40 | end 41 | end 42 | 43 | end 44 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/LcOriginal_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/LcOriginal_mex.mexmaci64 -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/LcOriginal_mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/LcOriginal_mex.mexw64 -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * F.h 7 | * 8 | * Code generation for function 'F' 9 | * 10 | */ 11 | 12 | #ifndef F_H 13 | #define F_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void F(const emlrtStack *sp, const real_T para[2], const emxArray_real_T * 29 | Y0, const emxArray_real_T *vecS0, real_T para_new[2]); 30 | 31 | #endif 32 | 33 | /* End of code generation (F.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/F.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_data.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * F_data.cpp 7 | * 8 | * Code generation for function 'F_data' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "F.h" 15 | #include "F_data.h" 16 | #include "blas.h" 17 | 18 | /* Variable Definitions */ 19 | emlrtCTX emlrtRootTLSGlobal = NULL; 20 | const volatile char_T *emlrtBreakCheckR2012bFlagVar = NULL; 21 | emlrtContext emlrtContextGlobal = { true, false, 131434U, NULL, "F", NULL, false, 22 | { 2045744189U, 2170104910U, 2743257031U, 4284093946U }, NULL }; 23 | 24 | emlrtRSInfo j_emlrtRSI = { 20, "eml_int_forloop_overflow_check", 25 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m" 26 | }; 27 | 28 | /* End of code generation (F_data.cpp) */ 29 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * F_data.h 7 | * 8 | * Code generation for function 'F_data' 9 | * 10 | */ 11 | 12 | #ifndef F_DATA_H 13 | #define F_DATA_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Variable Declarations */ 28 | extern emlrtCTX emlrtRootTLSGlobal; 29 | extern const volatile char_T *emlrtBreakCheckR2012bFlagVar; 30 | extern emlrtContext emlrtContextGlobal; 31 | extern emlrtRSInfo j_emlrtRSI; 32 | 33 | #endif 34 | 35 | /* End of code generation (F_data.h) */ 36 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_data.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/F_data.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_emxutil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * F_emxutil.h 7 | * 8 | * Code generation for function 'F_emxutil' 9 | * 10 | */ 11 | 12 | #ifndef F_EMXUTIL_H 13 | #define F_EMXUTIL_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void emxEnsureCapacity(const emlrtStack *sp, emxArray__common *emxArray, 29 | int32_T oldNumel, int32_T elementSize, const emlrtRTEInfo *srcLocation); 30 | extern void emxFree_int32_T(emxArray_int32_T **pEmxArray); 31 | extern void emxFree_real_T(emxArray_real_T **pEmxArray); 32 | extern void emxInit_int32_T(const emlrtStack *sp, emxArray_int32_T **pEmxArray, 33 | int32_T numDimensions, const emlrtRTEInfo *srcLocation, boolean_T doPush); 34 | extern void emxInit_real_T(const emlrtStack *sp, emxArray_real_T **pEmxArray, 35 | int32_T numDimensions, const emlrtRTEInfo *srcLocation, boolean_T doPush); 36 | extern void emxInit_real_T1(const emlrtStack *sp, emxArray_real_T **pEmxArray, 37 | int32_T numDimensions, const emlrtRTEInfo *srcLocation, boolean_T doPush); 38 | extern void emxInit_real_T2(const emlrtStack *sp, emxArray_real_T **pEmxArray, 39 | int32_T numDimensions, const emlrtRTEInfo *srcLocation, boolean_T doPush); 40 | 41 | #endif 42 | 43 | /* End of code generation (F_emxutil.h) */ 44 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_emxutil.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/F_emxutil.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_initialize.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * F_initialize.cpp 7 | * 8 | * Code generation for function 'F_initialize' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "F.h" 15 | #include "F_initialize.h" 16 | #include "_coder_F_mex.h" 17 | #include "F_data.h" 18 | #include "blas.h" 19 | 20 | /* Function Definitions */ 21 | void F_initialize() 22 | { 23 | emlrtStack st = { NULL, NULL, NULL }; 24 | 25 | mexFunctionCreateRootTLS(); 26 | emlrtBreakCheckR2012bFlagVar = emlrtGetBreakCheckFlagAddressR2012b(); 27 | st.tls = emlrtRootTLSGlobal; 28 | emlrtClearAllocCountR2012b(&st, false, 0U, 0); 29 | emlrtEnterRtStackR2012b(&st); 30 | emlrtFirstTimeR2012b(emlrtRootTLSGlobal); 31 | } 32 | 33 | /* End of code generation (F_initialize.cpp) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_initialize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * F_initialize.h 7 | * 8 | * Code generation for function 'F_initialize' 9 | * 10 | */ 11 | 12 | #ifndef F_INITIALIZE_H 13 | #define F_INITIALIZE_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void F_initialize(); 29 | 30 | #endif 31 | 32 | /* End of code generation (F_initialize.h) */ 33 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_initialize.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/F_initialize.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/F_mex.mexmaci64 -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_mex.mki: -------------------------------------------------------------------------------- 1 | # Make settings for F 2 | CC=/usr/bin/xcrun -sdk macosx10.11 clang 3 | CFLAGS=-fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -DMATLAB_MEX_FILE 4 | CLIBS= 5 | COPTIMFLAGS=-O2 -DNDEBUG 6 | CDEBUGFLAGS=-g 7 | CXX=/usr/bin/xcrun -sdk macosx10.11 clang 8 | CXXFLAGS=-fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -DMATLAB_MEX_FILE 9 | CXXLIBS= 10 | CXXOPTIMFLAGS=-O2 -DNDEBUG 11 | CXXDEBUGFLAGS=-g 12 | LD=/usr/bin/xcrun -sdk macosx10.11 clang 13 | LDFLAGS=-Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.11 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map -L/Applications/MATLAB_R2016a.app/bin/maci64 -lmx -lmex -lmat -lc++ -Wl,-exported_symbols_list,/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map 14 | LDOPTIMFLAGS= 15 | LDDEBUGFLAGS=-g 16 | Arch=maci64 17 | OMPFLAGS= 18 | OMPLINKFLAGS= 19 | EMC_COMPILER=Xcode with Clang 20 | EMC_CONFIG=optim 21 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_mex.sh: -------------------------------------------------------------------------------- 1 | MATLAB="/Applications/MATLAB_R2016a.app" 2 | Arch=maci64 3 | ENTRYPOINT=mexFunction 4 | MAPFILE=$ENTRYPOINT'.map' 5 | PREFDIR="/Users/xuyuting/.matlab/R2016a" 6 | OPTSFILE_NAME="./setEnv.sh" 7 | . $OPTSFILE_NAME 8 | COMPILER=$CC 9 | . $OPTSFILE_NAME 10 | echo "# Make settings for F" > F_mex.mki 11 | echo "CC=$CC" >> F_mex.mki 12 | echo "CFLAGS=$CFLAGS" >> F_mex.mki 13 | echo "CLIBS=$CLIBS" >> F_mex.mki 14 | echo "COPTIMFLAGS=$COPTIMFLAGS" >> F_mex.mki 15 | echo "CDEBUGFLAGS=$CDEBUGFLAGS" >> F_mex.mki 16 | echo "CXX=$CXX" >> F_mex.mki 17 | echo "CXXFLAGS=$CXXFLAGS" >> F_mex.mki 18 | echo "CXXLIBS=$CXXLIBS" >> F_mex.mki 19 | echo "CXXOPTIMFLAGS=$CXXOPTIMFLAGS" >> F_mex.mki 20 | echo "CXXDEBUGFLAGS=$CXXDEBUGFLAGS" >> F_mex.mki 21 | echo "LD=$LD" >> F_mex.mki 22 | echo "LDFLAGS=$LDFLAGS" >> F_mex.mki 23 | echo "LDOPTIMFLAGS=$LDOPTIMFLAGS" >> F_mex.mki 24 | echo "LDDEBUGFLAGS=$LDDEBUGFLAGS" >> F_mex.mki 25 | echo "Arch=$Arch" >> F_mex.mki 26 | echo OMPFLAGS= >> F_mex.mki 27 | echo OMPLINKFLAGS= >> F_mex.mki 28 | echo "EMC_COMPILER=Xcode with Clang" >> F_mex.mki 29 | echo "EMC_CONFIG=optim" >> F_mex.mki 30 | "/Applications/MATLAB_R2016a.app/bin/maci64/gmake" -B -f F_mex.mk 31 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_mex_mex.map: -------------------------------------------------------------------------------- 1 | _mexFunction 2 | _emlrtMexFcnProperties 3 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_terminate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * F_terminate.cpp 7 | * 8 | * Code generation for function 'F_terminate' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "F.h" 15 | #include "F_terminate.h" 16 | #include "_coder_F_mex.h" 17 | #include "F_data.h" 18 | #include "blas.h" 19 | 20 | /* Function Definitions */ 21 | void F_atexit() 22 | { 23 | emlrtStack st = { NULL, NULL, NULL }; 24 | 25 | mexFunctionCreateRootTLS(); 26 | st.tls = emlrtRootTLSGlobal; 27 | emlrtEnterRtStackR2012b(&st); 28 | emlrtLeaveRtStackR2012b(&st); 29 | emlrtDestroyRootTLS(&emlrtRootTLSGlobal); 30 | } 31 | 32 | void F_terminate() 33 | { 34 | emlrtStack st = { NULL, NULL, NULL }; 35 | 36 | st.tls = emlrtRootTLSGlobal; 37 | emlrtLeaveRtStackR2012b(&st); 38 | emlrtDestroyRootTLS(&emlrtRootTLSGlobal); 39 | } 40 | 41 | /* End of code generation (F_terminate.cpp) */ 42 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_terminate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * F_terminate.h 7 | * 8 | * Code generation for function 'F_terminate' 9 | * 10 | */ 11 | 12 | #ifndef F_TERMINATE_H 13 | #define F_TERMINATE_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void F_atexit(); 29 | extern void F_terminate(); 30 | 31 | #endif 32 | 33 | /* End of code generation (F_terminate.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_terminate.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/F_terminate.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/F_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * F_types.h 7 | * 8 | * Code generation for function 'F' 9 | * 10 | */ 11 | 12 | #ifndef F_TYPES_H 13 | #define F_TYPES_H 14 | 15 | /* Include files */ 16 | #include "rtwtypes.h" 17 | 18 | /* Type Definitions */ 19 | #ifndef struct_emxArray__common 20 | #define struct_emxArray__common 21 | 22 | struct emxArray__common 23 | { 24 | void *data; 25 | int32_T *size; 26 | int32_T allocatedSize; 27 | int32_T numDimensions; 28 | boolean_T canFreeData; 29 | }; 30 | 31 | #endif /*struct_emxArray__common*/ 32 | 33 | #ifndef struct_emxArray_int32_T 34 | #define struct_emxArray_int32_T 35 | 36 | struct emxArray_int32_T 37 | { 38 | int32_T *data; 39 | int32_T *size; 40 | int32_T allocatedSize; 41 | int32_T numDimensions; 42 | boolean_T canFreeData; 43 | }; 44 | 45 | #endif /*struct_emxArray_int32_T*/ 46 | 47 | #ifndef struct_emxArray_real_T 48 | #define struct_emxArray_real_T 49 | 50 | struct emxArray_real_T 51 | { 52 | real_T *data; 53 | int32_T *size; 54 | int32_T allocatedSize; 55 | int32_T numDimensions; 56 | boolean_T canFreeData; 57 | }; 58 | 59 | #endif /*struct_emxArray_real_T*/ 60 | #endif 61 | 62 | /* End of code generation (F_types.h) */ 63 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/_coder_F_api.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/_coder_F_api.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/_coder_F_info.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/_coder_F_info.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/_coder_F_mex.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/_coder_F_mex.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/buildInfo.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/buildInfo.mat -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/eml_int_forloop_overflow_check.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * eml_int_forloop_overflow_check.cpp 7 | * 8 | * Code generation for function 'eml_int_forloop_overflow_check' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "F.h" 15 | #include "eml_int_forloop_overflow_check.h" 16 | #include "blas.h" 17 | 18 | /* Variable Definitions */ 19 | static emlrtRTEInfo p_emlrtRTEI = { 86, 15, "eml_int_forloop_overflow_check", 20 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m" 21 | }; 22 | 23 | /* Function Definitions */ 24 | void check_forloop_overflow_error(const emlrtStack *sp) 25 | { 26 | emlrtErrorWithMessageIdR2012b(sp, &p_emlrtRTEI, 27 | "Coder:toolbox:int_forloop_overflow", 3, 4, 5, "int32"); 28 | } 29 | 30 | /* End of code generation (eml_int_forloop_overflow_check.cpp) */ 31 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/eml_int_forloop_overflow_check.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * eml_int_forloop_overflow_check.h 7 | * 8 | * Code generation for function 'eml_int_forloop_overflow_check' 9 | * 10 | */ 11 | 12 | #ifndef EML_INT_FORLOOP_OVERFLOW_CHECK_H 13 | #define EML_INT_FORLOOP_OVERFLOW_CHECK_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void check_forloop_overflow_error(const emlrtStack *sp); 29 | 30 | #endif 31 | 32 | /* End of code generation (eml_int_forloop_overflow_check.h) */ 33 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/eml_int_forloop_overflow_check.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/eml_int_forloop_overflow_check.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/epsilonToY.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * epsilonToY.h 7 | * 8 | * Code generation for function 'epsilonToY' 9 | * 10 | */ 11 | 12 | #ifndef EPSILONTOY_H 13 | #define EPSILONTOY_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void epsilonToY(const emlrtStack *sp, const emxArray_real_T *epsilon, 29 | emxArray_real_T *Y); 30 | 31 | #endif 32 | 33 | /* End of code generation (epsilonToY.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/epsilonToY.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/epsilonToY.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/error.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * error.cpp 7 | * 8 | * Code generation for function 'error' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "F.h" 15 | #include "error.h" 16 | #include "blas.h" 17 | 18 | /* Variable Definitions */ 19 | static emlrtRTEInfo o_emlrtRTEI = { 17, 9, "error", 20 | "/Applications/MATLAB_R2016a.app/toolbox/eml/eml/+coder/+internal/error.m" }; 21 | 22 | /* Function Definitions */ 23 | void b_error(const emlrtStack *sp) 24 | { 25 | emlrtErrorWithMessageIdR2012b(sp, &o_emlrtRTEI, 26 | "Coder:toolbox:power_domainError", 0); 27 | } 28 | 29 | void error(const emlrtStack *sp) 30 | { 31 | emlrtErrorWithMessageIdR2012b(sp, &o_emlrtRTEI, 32 | "Coder:toolbox:ElFunDomainError", 3, 4, 4, "sqrt"); 33 | } 34 | 35 | /* End of code generation (error.cpp) */ 36 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * error.h 7 | * 8 | * Code generation for function 'error' 9 | * 10 | */ 11 | 12 | #ifndef ERROR_H 13 | #define ERROR_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void b_error(const emlrtStack *sp); 29 | extern void error(const emlrtStack *sp); 30 | 31 | #endif 32 | 33 | /* End of code generation (error.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/error.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/error.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/gcGuiReport.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/gcGuiReport.mat -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/F_buildlog2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 23 |
24 | Code Generation Report For 'F' 25 | 26 | 27 |
MATLAB Coder Build Log

28 |

29 |
30 | 31 | 32 | 33 | 34 | 35 |
Build Parameters
Build directory
36 |
37 | 38 | 39 |
Build Log
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/F_buildlog3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 23 |
24 | Code Generation Report For 'F' 25 | 26 | 27 |
MATLAB Coder Build Log

28 |

29 |
30 | 31 | 32 | 33 | 34 | 35 |
Build Parameters
Build directory
36 |
37 | 38 | 39 |
Build Log
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/F_buildlog4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 23 |
24 | Code Generation Report For 'F' 25 | 26 | 27 |
MATLAB Coder Build Log

28 |

29 |
30 | 31 | 32 | 33 | 34 | 35 |
Build Parameters
Build directory
36 |
37 | 38 | 39 |
Build Log
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/contents_file.tmp: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
2 | Generated Source Files 3 |
_coder_F_api.cpp
_coder_F_api.h
_coder_F_info.cpp
_coder_F_info.h
_coder_F_mex.cpp
_coder_F_mex.h
11 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/exported_values.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/exported_values.mat -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/hilite_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/hilite_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: sans-serif; 3 | font-size: 9pt; 4 | } 5 | pre.code, pre#RTWcode, .center .lineno { 6 | font:10pt/14pt Courier New; 7 | } 8 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/mex_warning.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Code Generation Report 6 | 7 | 8 | 9 |
The C code that is generated for a MEX file contains extra checks and MATLAB interfacing logic that is not suitable for production code. To generate production code that is more readable and usable outside MATLAB, change the output type to library or executable.

See MEX source code

10 | 11 | 12 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/Error_document.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/Error_document.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/Fatal_document.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/Fatal_document.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/Warning_document.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/Warning_document.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cc_sourcecodec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cc_sourcecodec.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/collapsible-last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/collapsible-last.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/collapsible.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/collapsible.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_document_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_document_check.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_document_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_document_error.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_document_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_document_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_close_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_close_check.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_close_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_close_error.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_close_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_close_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_open_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_open_check.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_open_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_open_error.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_open_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/cs_folder_open_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/expandable-last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/expandable-last.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/expandable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/expandable.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/folderclosed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/folderclosed.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/folderopen.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/folderopen.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/help.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/hilite_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/hilite_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/inspect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 32 | 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/jQuery/ui.resizable.css: -------------------------------------------------------------------------------- 1 | /* Resizable 2 | ----------------------------------*/ 3 | .ui-resizable { position: relative;} 4 | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} 5 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 6 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } 7 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } 8 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } 9 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } 10 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 11 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 12 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 13 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/leaf-last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/leaf-last.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/leaf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/leaf.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/matlab-report-styles.css: -------------------------------------------------------------------------------- 1 | /* Copyright 1984-2013 The MathWorks, Inc. */ 2 | 3 | PRE { 4 | font-size: 100%; 5 | } 6 | 7 | .mono { 8 | font-family: monospace; 9 | font-size: 100%; 10 | } 11 | 12 | .head { 13 | font-weight: bold; 14 | } 15 | 16 | .report-head { 17 | padding: 8px; 18 | font-size: 150%; 19 | font-weight: bold; 20 | background: #008; 21 | color: #FFF; 22 | } 23 | 24 | .report-desc { 25 | margin-top:-8px; 26 | margin-bottom:4px; 27 | } 28 | 29 | .subdir-top { 30 | border-top:1px solid #CCC; 31 | margin-top:8px; 32 | margin-bottom:2px; 33 | } 34 | 35 | .subdir-bottom { 36 | border-top:1px solid #CCC; 37 | margin-top:4px; 38 | margin-bottom:8px; 39 | } 40 | 41 | .grayline { 42 | border-top:1px solid #CCC; 43 | margin-top:4px; 44 | margin-bottom:4px; 45 | } 46 | 47 | .td-linetop { 48 | border-top:1px solid #BBB; 49 | } 50 | 51 | .td-dashtop { 52 | border-top:1px dotted #CCC; 53 | background-color: #F0F0F0; 54 | } 55 | 56 | .td-linetopleft { 57 | border-top:1px solid #BBB; 58 | border-left:1px solid #BBB; 59 | } 60 | 61 | .td-dashtopleft { 62 | border-top:1px dotted #CCC; 63 | border-left:1px solid #BBB; 64 | background-color: #F0F0F0; 65 | } 66 | 67 | .td-linebottomrt { 68 | border-bottom:1px solid #BBB; 69 | border-right:1px solid #BBB; 70 | } 71 | 72 | .td-function { 73 | border-top:1px solid #CCC; 74 | border-left:1px solid #BBB; 75 | background: #F0F8FF; 76 | } 77 | 78 | .td-script { 79 | border-top:1px solid #CCC; 80 | border-left:1px solid #BBB; 81 | background: #FFE; 82 | } 83 | 84 | .td-cellscript { 85 | border-top:1px solid #CCC; 86 | background: #FFF; 87 | } 88 | 89 | 90 | /* */ 91 | 92 | .soft { 93 | color: #888; 94 | } 95 | 96 | .warning { 97 | background: #FFC0C0; 98 | } 99 | 100 | .xtrainfo { 101 | font-family: monospace; 102 | padding-left:3em; 103 | padding-bottom:0px; 104 | margin-bottom:-1em; 105 | } 106 | 107 | #FunctionListingTable{ 108 | border:0px; 109 | border-spacing:0px; 110 | border-collapse:collapse; 111 | } 112 | 113 | #FunctionListingTable tr { 114 | padding:0px; 115 | border:0px; 116 | } 117 | 118 | #FunctionListingTable th { 119 | text-align:center; 120 | } 121 | 122 | #FunctionListingTable th.leftAligned { 123 | text-align:left; 124 | } 125 | 126 | #FunctionListingTable pre { 127 | margin:0px; 128 | } 129 | 130 | #FunctionListingTable th > pre > span { 131 | font-weight:bold; 132 | text-decoration:none; 133 | } 134 | 135 | #FunctionListingTable td { 136 | padding:0px; 137 | text-align:center; 138 | } 139 | 140 | #FunctionListingTable td.leftAligned { 141 | padding:0px; 142 | text-align:left; 143 | } 144 | 145 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/mhighlight.css: -------------------------------------------------------------------------------- 1 | span.keyword {color: #0000FF} 2 | span.comment {color: #228B22} 3 | span.string {color: #A020F0} 4 | span.untermstring {color: #B20000} 5 | span.syscmd {color: #B28C00} 6 | 7 | div.code { 8 | cursor:default; 9 | } -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/nav.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/nolines_minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/nolines_minus.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/nolines_plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/nolines_plus.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/right_arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/right_arrow.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/rtwmsg.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Block-to-Code Highlighting Message 5 | 6 | 7 | 8 |

Block-to-Code Highlighting Message

9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/spinner.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/status_failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/status_failed.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/status_passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/status_passed.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/status_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/status_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/tablesorter_bkgrd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/tablesorter_bkgrd.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/texture_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/texture_blue.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/texture_gray1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/texture_gray1.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/texture_gray2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/html/resources/texture_gray2.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/html/resources/webview_codegen.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015-2016 The MathWorks, Inc. 3 | */ 4 | function webviewToCodeInit(){document.getElementById("rtw_webview").contentWindow.require(["dojo/dom-style","dojo/topic","dojo/window","dijit/registry"],function(k,m,n,p){var c=p.byId("slwebview"),h=!0,g={traceableColor:"#00cfcf",untraceableColor:"#e8d152",getColor:function(d){return d?this.traceableColor:this.untraceableColor},getStyle:function(d,c){var a=this.getColor(c);return"fill:"+a+"; fill-opacity:0.5; stroke:"+a+";"}},f,l=function(d,e,a){c.open(d).then(function(){var b;if(b=c.getElementViewer())if(f&& 5 | k.set(f,"background",""),b=b.getLineNode(e))k.set(b,"background",a),n.scrollIntoView(b),f=b})};m.subscribe("slwebview/select",function(d,e){var a,b;c.isElement(d)&&h&&(c.unhighlightAll(),a=d.backing.sid,b=e&&e.line?e.line:-1,0<=b&&(a=d.backing.obj_viewer.code_sid+":"+b.toString()),a=top.rtwChangeSysCallback(a),c.highlight(d,g.getStyle(d,a)),0<=b&&l(d,b,g.getColor(a)))});top.codeToWebView=function(d,e){var a=c.getElement(d),b,f;a||(f=d.lastIndexOf(":"),b=d.substring(f+1),a=c.getElement(e));a&&c.open(a.diagram).then(function(){c.unhighlightAll(); 6 | c.moveToView(a);h=!1;c.highlight(a,g.getStyle(a,!0));0<=b?(l(a,b,g.getColor(!0)),c.select(a)):c.select(a.diagram);h=!0})}})}; 7 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/interface/_coder_F_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * _coder_F_api.h 7 | * 8 | * Code generation for function '_coder_F_api' 9 | * 10 | */ 11 | 12 | #ifndef _CODER_F_API_H 13 | #define _CODER_F_API_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void F_api(const mxArray * const prhs[3], const mxArray *plhs[1]); 29 | 30 | #endif 31 | 32 | /* End of code generation (_coder_F_api.h) */ 33 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/interface/_coder_F_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * _coder_F_info.h 7 | * 8 | * Code generation for function '_coder_F_info' 9 | * 10 | */ 11 | 12 | #ifndef _CODER_F_INFO_H 13 | #define _CODER_F_INFO_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | MEXFUNCTION_LINKAGE mxArray *emlrtMexFcnProperties(); 29 | extern const mxArray *emlrtMexFcnResolvedFunctionsInfo(); 30 | 31 | #endif 32 | 33 | /* End of code generation (_coder_F_info.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/interface/_coder_F_mex.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * _coder_F_mex.cpp 7 | * 8 | * Code generation for function '_coder_F_mex' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "F.h" 14 | #include "_coder_F_mex.h" 15 | #include "F_terminate.h" 16 | #include "_coder_F_api.h" 17 | #include "F_initialize.h" 18 | #include "F_data.h" 19 | #include "blas.h" 20 | 21 | /* Function Declarations */ 22 | static void F_mexFunction(int32_T nlhs, mxArray *plhs[1], int32_T nrhs, const 23 | mxArray *prhs[3]); 24 | 25 | /* Function Definitions */ 26 | static void F_mexFunction(int32_T nlhs, mxArray *plhs[1], int32_T nrhs, const 27 | mxArray *prhs[3]) 28 | { 29 | int32_T n; 30 | const mxArray *inputs[3]; 31 | const mxArray *outputs[1]; 32 | int32_T b_nlhs; 33 | emlrtStack st = { NULL, NULL, NULL }; 34 | 35 | st.tls = emlrtRootTLSGlobal; 36 | 37 | /* Check for proper number of arguments. */ 38 | if (nrhs != 3) { 39 | emlrtErrMsgIdAndTxt(&st, "EMLRT:runTime:WrongNumberOfInputs", 5, 12, 3, 4, 1, 40 | "F"); 41 | } 42 | 43 | if (nlhs > 1) { 44 | emlrtErrMsgIdAndTxt(&st, "EMLRT:runTime:TooManyOutputArguments", 3, 4, 1, 45 | "F"); 46 | } 47 | 48 | /* Temporary copy for mex inputs. */ 49 | for (n = 0; n < nrhs; n++) { 50 | inputs[n] = prhs[n]; 51 | if (*emlrtBreakCheckR2012bFlagVar != 0) { 52 | emlrtBreakCheckR2012b(&st); 53 | } 54 | } 55 | 56 | /* Call the function. */ 57 | F_api(inputs, outputs); 58 | 59 | /* Copy over outputs to the caller. */ 60 | if (nlhs < 1) { 61 | b_nlhs = 1; 62 | } else { 63 | b_nlhs = nlhs; 64 | } 65 | 66 | emlrtReturnArrays(b_nlhs, plhs, outputs); 67 | 68 | /* Module termination. */ 69 | F_terminate(); 70 | } 71 | 72 | void mexFunction(int32_T nlhs, mxArray *plhs[], int32_T nrhs, const mxArray 73 | *prhs[]) 74 | { 75 | mexAtExit(F_atexit); 76 | 77 | /* Initialize the memory manager. */ 78 | /* Module initialization. */ 79 | F_initialize(); 80 | 81 | /* Dispatch the entry-point. */ 82 | F_mexFunction(nlhs, plhs, nrhs, prhs); 83 | } 84 | 85 | emlrtCTX mexFunctionCreateRootTLS() 86 | { 87 | emlrtCreateRootTLS(&emlrtRootTLSGlobal, &emlrtContextGlobal, NULL, 1); 88 | return emlrtRootTLSGlobal; 89 | } 90 | 91 | /* End of code generation (_coder_F_mex.cpp) */ 92 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/interface/_coder_F_mex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * _coder_F_mex.h 7 | * 8 | * Code generation for function '_coder_F_mex' 9 | * 10 | */ 11 | 12 | #ifndef _CODER_F_MEX_H 13 | #define _CODER_F_MEX_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void mexFunction(int32_T nlhs, mxArray *plhs[], int32_T nrhs, const 29 | mxArray *prhs[]); 30 | extern emlrtCTX mexFunctionCreateRootTLS(); 31 | 32 | #endif 33 | 34 | /* End of code generation (_coder_F_mex.h) */ 35 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/mean.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * mean.h 7 | * 8 | * Code generation for function 'mean' 9 | * 10 | */ 11 | 12 | #ifndef MEAN_H 13 | #define MEAN_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void mean(const emlrtStack *sp, const emxArray_real_T *x, emxArray_real_T 29 | *y); 30 | 31 | #endif 32 | 33 | /* End of code generation (mean.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/mean.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/mean.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/power.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * power.h 7 | * 8 | * Code generation for function 'power' 9 | * 10 | */ 11 | 12 | #ifndef POWER_H 13 | #define POWER_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void power(const emlrtStack *sp, const emxArray_real_T *a, 29 | emxArray_real_T *y); 30 | 31 | #endif 32 | 33 | /* End of code generation (power.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/power.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/power.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/rt_nonfinite.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * rt_nonfinite.h 7 | * 8 | * Code generation for function 'F' 9 | * 10 | */ 11 | 12 | #ifndef RT_NONFINITE_H 13 | #define RT_NONFINITE_H 14 | #define rtInf mxGetInf() 15 | #define rtMinusInf (-mxGetInf()) 16 | #define rtNaN mxGetNaN() 17 | #define rtIsNaN(X) mxIsNaN(X) 18 | #define rtIsInf(X) mxIsInf(X) 19 | #define rtIsNaNF(X) mxIsNaN(X) 20 | #define rtIsInfF(X) mxIsInf(X) 21 | #endif 22 | /* End of code generation (rt_nonfinite.h) */ 23 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/rtwtypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * rtwtypes.h 7 | * 8 | * Code generation for function 'F' 9 | * 10 | */ 11 | 12 | #ifndef RTWTYPES_H 13 | #define RTWTYPES_H 14 | #include "tmwtypes.h" 15 | /* 16 | * TRUE/FALSE definitions 17 | */ 18 | #ifndef TRUE 19 | #define TRUE (1U) 20 | #endif 21 | #ifndef FALSE 22 | #define FALSE (0U) 23 | #endif 24 | #endif 25 | /* End of code generation (rtwtypes.h) */ 26 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/scalexpAlloc.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * scalexpAlloc.cpp 7 | * 8 | * Code generation for function 'scalexpAlloc' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "F.h" 15 | #include "scalexpAlloc.h" 16 | #include "blas.h" 17 | 18 | /* Function Definitions */ 19 | boolean_T dimagree(const emxArray_real_T *z, const emxArray_real_T *varargin_1) 20 | { 21 | boolean_T p; 22 | boolean_T b_p; 23 | int32_T k; 24 | boolean_T exitg1; 25 | p = true; 26 | b_p = true; 27 | k = 0; 28 | exitg1 = false; 29 | while ((!exitg1) && (k + 1 < 3)) { 30 | if (z->size[k] != varargin_1->size[k]) { 31 | b_p = false; 32 | exitg1 = true; 33 | } else { 34 | k++; 35 | } 36 | } 37 | 38 | if (b_p) { 39 | } else { 40 | p = false; 41 | } 42 | 43 | return p; 44 | } 45 | 46 | /* End of code generation (scalexpAlloc.cpp) */ 47 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/scalexpAlloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * scalexpAlloc.h 7 | * 8 | * Code generation for function 'scalexpAlloc' 9 | * 10 | */ 11 | 12 | #ifndef SCALEXPALLOC_H 13 | #define SCALEXPALLOC_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern boolean_T dimagree(const emxArray_real_T *z, const emxArray_real_T 29 | *varargin_1); 30 | 31 | #endif 32 | 33 | /* End of code generation (scalexpAlloc.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/scalexpAlloc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/scalexpAlloc.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/setEnv.sh: -------------------------------------------------------------------------------- 1 | CC="/usr/bin/xcrun -sdk macosx10.11 clang" 2 | CXX="/usr/bin/xcrun -sdk macosx10.11 clang" 3 | CFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -DMATLAB_MEX_FILE" 4 | CXXFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -DMATLAB_MEX_FILE" 5 | COPTIMFLAGS="-O2 -DNDEBUG" 6 | CXXOPTIMFLAGS="-O2 -DNDEBUG" 7 | CDEBUGFLAGS="-g" 8 | CXXDEBUGFLAGS="-g" 9 | LD="/usr/bin/xcrun -sdk macosx10.11 clang" 10 | LDXX="/usr/bin/xcrun -sdk macosx10.11 clang" 11 | LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.11 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -bundle -Wl,-exported_symbols_list,"/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map" -L"/Applications/MATLAB_R2016a.app/bin/maci64" -lmx -lmex -lmat -lc++ -Wl,-exported_symbols_list,"/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map"" 12 | LDDEBUGFLAGS="-g" 13 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/sqrt.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * sqrt.cpp 7 | * 8 | * Code generation for function 'sqrt' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "F.h" 15 | #include "sqrt.h" 16 | #include "error.h" 17 | #include "eml_int_forloop_overflow_check.h" 18 | #include "F_data.h" 19 | #include "blas.h" 20 | 21 | /* Variable Definitions */ 22 | static emlrtRSInfo g_emlrtRSI = { 12, "sqrt", 23 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/elfun/sqrt.m" }; 24 | 25 | static emlrtRSInfo h_emlrtRSI = { 15, "sqrt", 26 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/elfun/sqrt.m" }; 27 | 28 | static emlrtRSInfo i_emlrtRSI = { 24, "applyScalarFunctionInPlace", 29 | "/Applications/MATLAB_R2016a.app/toolbox/eml/eml/+coder/+internal/applyScalarFunctionInPlace.m" 30 | }; 31 | 32 | /* Function Definitions */ 33 | void b_sqrt(real_T *x) 34 | { 35 | *x = muDoubleScalarSqrt(*x); 36 | } 37 | 38 | void c_sqrt(const emlrtStack *sp, emxArray_real_T *x) 39 | { 40 | boolean_T p; 41 | int32_T nx; 42 | int32_T k; 43 | emlrtStack st; 44 | emlrtStack b_st; 45 | emlrtStack c_st; 46 | st.prev = sp; 47 | st.tls = sp->tls; 48 | b_st.prev = &st; 49 | b_st.tls = st.tls; 50 | c_st.prev = &b_st; 51 | c_st.tls = b_st.tls; 52 | p = false; 53 | nx = x->size[0] * x->size[1]; 54 | for (k = 0; k < nx; k++) { 55 | if (p || (x->data[k] < 0.0)) { 56 | p = true; 57 | } else { 58 | p = false; 59 | } 60 | } 61 | 62 | if (p) { 63 | st.site = &g_emlrtRSI; 64 | error(&st); 65 | } 66 | 67 | st.site = &h_emlrtRSI; 68 | nx = x->size[0] * x->size[1]; 69 | b_st.site = &i_emlrtRSI; 70 | if ((!(1 > nx)) && (nx > 2147483646)) { 71 | c_st.site = &j_emlrtRSI; 72 | check_forloop_overflow_error(&c_st); 73 | } 74 | 75 | for (k = 0; k + 1 <= nx; k++) { 76 | x->data[k] = muDoubleScalarSqrt(x->data[k]); 77 | } 78 | } 79 | 80 | /* End of code generation (sqrt.cpp) */ 81 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/sqrt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * sqrt.h 7 | * 8 | * Code generation for function 'sqrt' 9 | * 10 | */ 11 | 12 | #ifndef SQRT_H 13 | #define SQRT_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void b_sqrt(real_T *x); 29 | extern void c_sqrt(const emlrtStack *sp, emxArray_real_T *x); 30 | 31 | #endif 32 | 33 | /* End of code generation (sqrt.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/sqrt.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/sqrt.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/warning.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * warning.h 7 | * 8 | * Code generation for function 'warning' 9 | * 10 | */ 11 | 12 | #ifndef WARNING_H 13 | #define WARNING_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "F_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void warning(const emlrtStack *sp); 29 | 30 | #endif 31 | 32 | /* End of code generation (warning.h) */ 33 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/F/warning.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/F/warning.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * G.h 7 | * 8 | * Code generation for function 'G' 9 | * 10 | */ 11 | 12 | #ifndef G_H 13 | #define G_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern real_T G(const emlrtStack *sp, const real_T para[2], const 29 | emxArray_real_T *Y0, const emxArray_real_T *vecS0); 30 | 31 | #ifdef __WATCOMC__ 32 | 33 | #pragma aux G value [8087]; 34 | 35 | #endif 36 | #endif 37 | 38 | /* End of code generation (G.h) */ 39 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/G.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_data.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * G_data.cpp 7 | * 8 | * Code generation for function 'G_data' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "G.h" 15 | #include "G_data.h" 16 | #include "blas.h" 17 | 18 | /* Variable Definitions */ 19 | emlrtCTX emlrtRootTLSGlobal = NULL; 20 | const volatile char_T *emlrtBreakCheckR2012bFlagVar = NULL; 21 | emlrtContext emlrtContextGlobal = { true, false, 131434U, NULL, "G", NULL, false, 22 | { 2045744189U, 2170104910U, 2743257031U, 4284093946U }, NULL }; 23 | 24 | emlrtRSInfo k_emlrtRSI = { 20, "eml_int_forloop_overflow_check", 25 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m" 26 | }; 27 | 28 | emlrtRSInfo m_emlrtRSI = { 49, "power", 29 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/ops/power.m" }; 30 | 31 | /* End of code generation (G_data.cpp) */ 32 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * G_data.h 7 | * 8 | * Code generation for function 'G_data' 9 | * 10 | */ 11 | 12 | #ifndef G_DATA_H 13 | #define G_DATA_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Variable Declarations */ 28 | extern emlrtCTX emlrtRootTLSGlobal; 29 | extern const volatile char_T *emlrtBreakCheckR2012bFlagVar; 30 | extern emlrtContext emlrtContextGlobal; 31 | extern emlrtRSInfo k_emlrtRSI; 32 | extern emlrtRSInfo m_emlrtRSI; 33 | 34 | #endif 35 | 36 | /* End of code generation (G_data.h) */ 37 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_data.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/G_data.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_emxutil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * G_emxutil.h 7 | * 8 | * Code generation for function 'G_emxutil' 9 | * 10 | */ 11 | 12 | #ifndef G_EMXUTIL_H 13 | #define G_EMXUTIL_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void emxEnsureCapacity(const emlrtStack *sp, emxArray__common *emxArray, 29 | int32_T oldNumel, int32_T elementSize, const emlrtRTEInfo *srcLocation); 30 | extern void emxFree_int32_T(emxArray_int32_T **pEmxArray); 31 | extern void emxFree_real_T(emxArray_real_T **pEmxArray); 32 | extern void emxInit_int32_T(const emlrtStack *sp, emxArray_int32_T **pEmxArray, 33 | int32_T numDimensions, const emlrtRTEInfo *srcLocation, boolean_T doPush); 34 | extern void emxInit_real_T(const emlrtStack *sp, emxArray_real_T **pEmxArray, 35 | int32_T numDimensions, const emlrtRTEInfo *srcLocation, boolean_T doPush); 36 | extern void emxInit_real_T1(const emlrtStack *sp, emxArray_real_T **pEmxArray, 37 | int32_T numDimensions, const emlrtRTEInfo *srcLocation, boolean_T doPush); 38 | extern void emxInit_real_T2(const emlrtStack *sp, emxArray_real_T **pEmxArray, 39 | int32_T numDimensions, const emlrtRTEInfo *srcLocation, boolean_T doPush); 40 | 41 | #endif 42 | 43 | /* End of code generation (G_emxutil.h) */ 44 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_emxutil.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/G_emxutil.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_initialize.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * G_initialize.cpp 7 | * 8 | * Code generation for function 'G_initialize' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "G.h" 15 | #include "G_initialize.h" 16 | #include "_coder_G_mex.h" 17 | #include "G_data.h" 18 | #include "blas.h" 19 | 20 | /* Function Definitions */ 21 | void G_initialize() 22 | { 23 | emlrtStack st = { NULL, NULL, NULL }; 24 | 25 | mexFunctionCreateRootTLS(); 26 | emlrtBreakCheckR2012bFlagVar = emlrtGetBreakCheckFlagAddressR2012b(); 27 | st.tls = emlrtRootTLSGlobal; 28 | emlrtClearAllocCountR2012b(&st, false, 0U, 0); 29 | emlrtEnterRtStackR2012b(&st); 30 | emlrtFirstTimeR2012b(emlrtRootTLSGlobal); 31 | } 32 | 33 | /* End of code generation (G_initialize.cpp) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_initialize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * G_initialize.h 7 | * 8 | * Code generation for function 'G_initialize' 9 | * 10 | */ 11 | 12 | #ifndef G_INITIALIZE_H 13 | #define G_INITIALIZE_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void G_initialize(); 29 | 30 | #endif 31 | 32 | /* End of code generation (G_initialize.h) */ 33 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_initialize.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/G_initialize.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/G_mex.mexmaci64 -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_mex.mki: -------------------------------------------------------------------------------- 1 | # Make settings for G 2 | CC=/usr/bin/xcrun -sdk macosx10.11 clang 3 | CFLAGS=-fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -DMATLAB_MEX_FILE 4 | CLIBS= 5 | COPTIMFLAGS=-O2 -DNDEBUG 6 | CDEBUGFLAGS=-g 7 | CXX=/usr/bin/xcrun -sdk macosx10.11 clang 8 | CXXFLAGS=-fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -DMATLAB_MEX_FILE 9 | CXXLIBS= 10 | CXXOPTIMFLAGS=-O2 -DNDEBUG 11 | CXXDEBUGFLAGS=-g 12 | LD=/usr/bin/xcrun -sdk macosx10.11 clang 13 | LDFLAGS=-Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.11 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map -L/Applications/MATLAB_R2016a.app/bin/maci64 -lmx -lmex -lmat -lc++ -Wl,-exported_symbols_list,/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map 14 | LDOPTIMFLAGS= 15 | LDDEBUGFLAGS=-g 16 | Arch=maci64 17 | OMPFLAGS= 18 | OMPLINKFLAGS= 19 | EMC_COMPILER=Xcode with Clang 20 | EMC_CONFIG=optim 21 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_mex.sh: -------------------------------------------------------------------------------- 1 | MATLAB="/Applications/MATLAB_R2016a.app" 2 | Arch=maci64 3 | ENTRYPOINT=mexFunction 4 | MAPFILE=$ENTRYPOINT'.map' 5 | PREFDIR="/Users/xuyuting/.matlab/R2016a" 6 | OPTSFILE_NAME="./setEnv.sh" 7 | . $OPTSFILE_NAME 8 | COMPILER=$CC 9 | . $OPTSFILE_NAME 10 | echo "# Make settings for G" > G_mex.mki 11 | echo "CC=$CC" >> G_mex.mki 12 | echo "CFLAGS=$CFLAGS" >> G_mex.mki 13 | echo "CLIBS=$CLIBS" >> G_mex.mki 14 | echo "COPTIMFLAGS=$COPTIMFLAGS" >> G_mex.mki 15 | echo "CDEBUGFLAGS=$CDEBUGFLAGS" >> G_mex.mki 16 | echo "CXX=$CXX" >> G_mex.mki 17 | echo "CXXFLAGS=$CXXFLAGS" >> G_mex.mki 18 | echo "CXXLIBS=$CXXLIBS" >> G_mex.mki 19 | echo "CXXOPTIMFLAGS=$CXXOPTIMFLAGS" >> G_mex.mki 20 | echo "CXXDEBUGFLAGS=$CXXDEBUGFLAGS" >> G_mex.mki 21 | echo "LD=$LD" >> G_mex.mki 22 | echo "LDFLAGS=$LDFLAGS" >> G_mex.mki 23 | echo "LDOPTIMFLAGS=$LDOPTIMFLAGS" >> G_mex.mki 24 | echo "LDDEBUGFLAGS=$LDDEBUGFLAGS" >> G_mex.mki 25 | echo "Arch=$Arch" >> G_mex.mki 26 | echo OMPFLAGS= >> G_mex.mki 27 | echo OMPLINKFLAGS= >> G_mex.mki 28 | echo "EMC_COMPILER=Xcode with Clang" >> G_mex.mki 29 | echo "EMC_CONFIG=optim" >> G_mex.mki 30 | "/Applications/MATLAB_R2016a.app/bin/maci64/gmake" -B -f G_mex.mk 31 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_mex_mex.map: -------------------------------------------------------------------------------- 1 | _mexFunction 2 | _emlrtMexFcnProperties 3 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_terminate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * G_terminate.cpp 7 | * 8 | * Code generation for function 'G_terminate' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "G.h" 15 | #include "G_terminate.h" 16 | #include "_coder_G_mex.h" 17 | #include "G_data.h" 18 | #include "blas.h" 19 | 20 | /* Function Definitions */ 21 | void G_atexit() 22 | { 23 | emlrtStack st = { NULL, NULL, NULL }; 24 | 25 | mexFunctionCreateRootTLS(); 26 | st.tls = emlrtRootTLSGlobal; 27 | emlrtEnterRtStackR2012b(&st); 28 | emlrtLeaveRtStackR2012b(&st); 29 | emlrtDestroyRootTLS(&emlrtRootTLSGlobal); 30 | } 31 | 32 | void G_terminate() 33 | { 34 | emlrtStack st = { NULL, NULL, NULL }; 35 | 36 | st.tls = emlrtRootTLSGlobal; 37 | emlrtLeaveRtStackR2012b(&st); 38 | emlrtDestroyRootTLS(&emlrtRootTLSGlobal); 39 | } 40 | 41 | /* End of code generation (G_terminate.cpp) */ 42 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_terminate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * G_terminate.h 7 | * 8 | * Code generation for function 'G_terminate' 9 | * 10 | */ 11 | 12 | #ifndef G_TERMINATE_H 13 | #define G_TERMINATE_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void G_atexit(); 29 | extern void G_terminate(); 30 | 31 | #endif 32 | 33 | /* End of code generation (G_terminate.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_terminate.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/G_terminate.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/G_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * G_types.h 7 | * 8 | * Code generation for function 'G' 9 | * 10 | */ 11 | 12 | #ifndef G_TYPES_H 13 | #define G_TYPES_H 14 | 15 | /* Include files */ 16 | #include "rtwtypes.h" 17 | 18 | /* Type Definitions */ 19 | #ifndef struct_emxArray__common 20 | #define struct_emxArray__common 21 | 22 | struct emxArray__common 23 | { 24 | void *data; 25 | int32_T *size; 26 | int32_T allocatedSize; 27 | int32_T numDimensions; 28 | boolean_T canFreeData; 29 | }; 30 | 31 | #endif /*struct_emxArray__common*/ 32 | 33 | #ifndef struct_emxArray_int32_T 34 | #define struct_emxArray_int32_T 35 | 36 | struct emxArray_int32_T 37 | { 38 | int32_T *data; 39 | int32_T *size; 40 | int32_T allocatedSize; 41 | int32_T numDimensions; 42 | boolean_T canFreeData; 43 | }; 44 | 45 | #endif /*struct_emxArray_int32_T*/ 46 | 47 | #ifndef struct_emxArray_real_T 48 | #define struct_emxArray_real_T 49 | 50 | struct emxArray_real_T 51 | { 52 | real_T *data; 53 | int32_T *size; 54 | int32_T allocatedSize; 55 | int32_T numDimensions; 56 | boolean_T canFreeData; 57 | }; 58 | 59 | #endif /*struct_emxArray_real_T*/ 60 | #endif 61 | 62 | /* End of code generation (G_types.h) */ 63 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/_coder_G_api.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/_coder_G_api.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/_coder_G_info.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/_coder_G_info.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/_coder_G_mex.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/_coder_G_mex.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/buildInfo.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/buildInfo.mat -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/eml_int_forloop_overflow_check.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * eml_int_forloop_overflow_check.cpp 7 | * 8 | * Code generation for function 'eml_int_forloop_overflow_check' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "G.h" 15 | #include "eml_int_forloop_overflow_check.h" 16 | #include "blas.h" 17 | 18 | /* Variable Definitions */ 19 | static emlrtRTEInfo p_emlrtRTEI = { 86, 15, "eml_int_forloop_overflow_check", 20 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m" 21 | }; 22 | 23 | /* Function Definitions */ 24 | void check_forloop_overflow_error(const emlrtStack *sp) 25 | { 26 | emlrtErrorWithMessageIdR2012b(sp, &p_emlrtRTEI, 27 | "Coder:toolbox:int_forloop_overflow", 3, 4, 5, "int32"); 28 | } 29 | 30 | /* End of code generation (eml_int_forloop_overflow_check.cpp) */ 31 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/eml_int_forloop_overflow_check.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * eml_int_forloop_overflow_check.h 7 | * 8 | * Code generation for function 'eml_int_forloop_overflow_check' 9 | * 10 | */ 11 | 12 | #ifndef EML_INT_FORLOOP_OVERFLOW_CHECK_H 13 | #define EML_INT_FORLOOP_OVERFLOW_CHECK_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void check_forloop_overflow_error(const emlrtStack *sp); 29 | 30 | #endif 31 | 32 | /* End of code generation (eml_int_forloop_overflow_check.h) */ 33 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/eml_int_forloop_overflow_check.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/eml_int_forloop_overflow_check.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/epsilonToY.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * epsilonToY.h 7 | * 8 | * Code generation for function 'epsilonToY' 9 | * 10 | */ 11 | 12 | #ifndef EPSILONTOY_H 13 | #define EPSILONTOY_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void epsilonToY(const emlrtStack *sp, const emxArray_real_T *epsilon, 29 | emxArray_real_T *Y); 30 | 31 | #endif 32 | 33 | /* End of code generation (epsilonToY.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/epsilonToY.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/epsilonToY.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/error.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * error.cpp 7 | * 8 | * Code generation for function 'error' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "G.h" 15 | #include "error.h" 16 | #include "blas.h" 17 | 18 | /* Variable Definitions */ 19 | static emlrtRTEInfo o_emlrtRTEI = { 17, 9, "error", 20 | "/Applications/MATLAB_R2016a.app/toolbox/eml/eml/+coder/+internal/error.m" }; 21 | 22 | /* Function Definitions */ 23 | void b_error(const emlrtStack *sp) 24 | { 25 | emlrtErrorWithMessageIdR2012b(sp, &o_emlrtRTEI, 26 | "Coder:toolbox:power_domainError", 0); 27 | } 28 | 29 | void error(const emlrtStack *sp) 30 | { 31 | emlrtErrorWithMessageIdR2012b(sp, &o_emlrtRTEI, 32 | "Coder:toolbox:ElFunDomainError", 3, 4, 4, "sqrt"); 33 | } 34 | 35 | /* End of code generation (error.cpp) */ 36 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * error.h 7 | * 8 | * Code generation for function 'error' 9 | * 10 | */ 11 | 12 | #ifndef ERROR_H 13 | #define ERROR_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void b_error(const emlrtStack *sp); 29 | extern void error(const emlrtStack *sp); 30 | 31 | #endif 32 | 33 | /* End of code generation (error.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/error.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/error.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/gcGuiReport.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/gcGuiReport.mat -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/G_buildlog2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 23 |
24 | Code Generation Report For 'G' 25 | 26 | 27 |
MATLAB Coder Build Log

28 |

29 |
30 | 31 | 32 | 33 | 34 | 35 |
Build Parameters
Build directory
36 |
37 | 38 | 39 |
Build Log
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/G_buildlog3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 23 |
24 | Code Generation Report For 'G' 25 | 26 | 27 |
MATLAB Coder Build Log

28 |

29 |
30 | 31 | 32 | 33 | 34 | 35 |
Build Parameters
Build directory
36 |
37 | 38 | 39 |
Build Log
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/G_buildlog4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 23 |
24 | Code Generation Report For 'G' 25 | 26 | 27 |
MATLAB Coder Build Log

28 |

29 |
30 | 31 | 32 | 33 | 34 | 35 |
Build Parameters
Build directory
36 |
37 | 38 | 39 |
Build Log
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/contents_file.tmp: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
2 | Generated Source Files 3 |
_coder_G_api.cpp
_coder_G_api.h
_coder_G_info.cpp
_coder_G_info.h
_coder_G_mex.cpp
_coder_G_mex.h
11 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/exported_values.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/exported_values.mat -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/hilite_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/hilite_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: sans-serif; 3 | font-size: 9pt; 4 | } 5 | pre.code, pre#RTWcode, .center .lineno { 6 | font:10pt/14pt Courier New; 7 | } 8 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/mex_warning.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Code Generation Report 6 | 7 | 8 | 9 |
The C code that is generated for a MEX file contains extra checks and MATLAB interfacing logic that is not suitable for production code. To generate production code that is more readable and usable outside MATLAB, change the output type to library or executable.

See MEX source code

10 | 11 | 12 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/Error_document.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/Error_document.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/Fatal_document.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/Fatal_document.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/Warning_document.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/Warning_document.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cc_sourcecodec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cc_sourcecodec.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/collapsible-last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/collapsible-last.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/collapsible.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/collapsible.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_document_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_document_check.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_document_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_document_error.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_document_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_document_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_close_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_close_check.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_close_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_close_error.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_close_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_close_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_open_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_open_check.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_open_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_open_error.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_open_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/cs_folder_open_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/expandable-last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/expandable-last.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/expandable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/expandable.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/folderclosed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/folderclosed.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/folderopen.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/folderopen.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/help.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/hilite_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/hilite_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/inspect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 32 | 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/jQuery/ui.resizable.css: -------------------------------------------------------------------------------- 1 | /* Resizable 2 | ----------------------------------*/ 3 | .ui-resizable { position: relative;} 4 | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} 5 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 6 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } 7 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } 8 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } 9 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } 10 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 11 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 12 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 13 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/leaf-last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/leaf-last.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/leaf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/leaf.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/matlab-report-styles.css: -------------------------------------------------------------------------------- 1 | /* Copyright 1984-2013 The MathWorks, Inc. */ 2 | 3 | PRE { 4 | font-size: 100%; 5 | } 6 | 7 | .mono { 8 | font-family: monospace; 9 | font-size: 100%; 10 | } 11 | 12 | .head { 13 | font-weight: bold; 14 | } 15 | 16 | .report-head { 17 | padding: 8px; 18 | font-size: 150%; 19 | font-weight: bold; 20 | background: #008; 21 | color: #FFF; 22 | } 23 | 24 | .report-desc { 25 | margin-top:-8px; 26 | margin-bottom:4px; 27 | } 28 | 29 | .subdir-top { 30 | border-top:1px solid #CCC; 31 | margin-top:8px; 32 | margin-bottom:2px; 33 | } 34 | 35 | .subdir-bottom { 36 | border-top:1px solid #CCC; 37 | margin-top:4px; 38 | margin-bottom:8px; 39 | } 40 | 41 | .grayline { 42 | border-top:1px solid #CCC; 43 | margin-top:4px; 44 | margin-bottom:4px; 45 | } 46 | 47 | .td-linetop { 48 | border-top:1px solid #BBB; 49 | } 50 | 51 | .td-dashtop { 52 | border-top:1px dotted #CCC; 53 | background-color: #F0F0F0; 54 | } 55 | 56 | .td-linetopleft { 57 | border-top:1px solid #BBB; 58 | border-left:1px solid #BBB; 59 | } 60 | 61 | .td-dashtopleft { 62 | border-top:1px dotted #CCC; 63 | border-left:1px solid #BBB; 64 | background-color: #F0F0F0; 65 | } 66 | 67 | .td-linebottomrt { 68 | border-bottom:1px solid #BBB; 69 | border-right:1px solid #BBB; 70 | } 71 | 72 | .td-function { 73 | border-top:1px solid #CCC; 74 | border-left:1px solid #BBB; 75 | background: #F0F8FF; 76 | } 77 | 78 | .td-script { 79 | border-top:1px solid #CCC; 80 | border-left:1px solid #BBB; 81 | background: #FFE; 82 | } 83 | 84 | .td-cellscript { 85 | border-top:1px solid #CCC; 86 | background: #FFF; 87 | } 88 | 89 | 90 | /* */ 91 | 92 | .soft { 93 | color: #888; 94 | } 95 | 96 | .warning { 97 | background: #FFC0C0; 98 | } 99 | 100 | .xtrainfo { 101 | font-family: monospace; 102 | padding-left:3em; 103 | padding-bottom:0px; 104 | margin-bottom:-1em; 105 | } 106 | 107 | #FunctionListingTable{ 108 | border:0px; 109 | border-spacing:0px; 110 | border-collapse:collapse; 111 | } 112 | 113 | #FunctionListingTable tr { 114 | padding:0px; 115 | border:0px; 116 | } 117 | 118 | #FunctionListingTable th { 119 | text-align:center; 120 | } 121 | 122 | #FunctionListingTable th.leftAligned { 123 | text-align:left; 124 | } 125 | 126 | #FunctionListingTable pre { 127 | margin:0px; 128 | } 129 | 130 | #FunctionListingTable th > pre > span { 131 | font-weight:bold; 132 | text-decoration:none; 133 | } 134 | 135 | #FunctionListingTable td { 136 | padding:0px; 137 | text-align:center; 138 | } 139 | 140 | #FunctionListingTable td.leftAligned { 141 | padding:0px; 142 | text-align:left; 143 | } 144 | 145 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/mhighlight.css: -------------------------------------------------------------------------------- 1 | span.keyword {color: #0000FF} 2 | span.comment {color: #228B22} 3 | span.string {color: #A020F0} 4 | span.untermstring {color: #B20000} 5 | span.syscmd {color: #B28C00} 6 | 7 | div.code { 8 | cursor:default; 9 | } -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/nav.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/nolines_minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/nolines_minus.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/nolines_plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/nolines_plus.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/right_arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/right_arrow.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/rtwmsg.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Block-to-Code Highlighting Message 5 | 6 | 7 | 8 |

Block-to-Code Highlighting Message

9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/spinner.gif -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/status_failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/status_failed.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/status_passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/status_passed.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/status_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/status_warning.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/tablesorter_bkgrd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/tablesorter_bkgrd.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/texture_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/texture_blue.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/texture_gray1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/texture_gray1.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/texture_gray2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/html/resources/texture_gray2.png -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/html/resources/webview_codegen.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015-2016 The MathWorks, Inc. 3 | */ 4 | function webviewToCodeInit(){document.getElementById("rtw_webview").contentWindow.require(["dojo/dom-style","dojo/topic","dojo/window","dijit/registry"],function(k,m,n,p){var c=p.byId("slwebview"),h=!0,g={traceableColor:"#00cfcf",untraceableColor:"#e8d152",getColor:function(d){return d?this.traceableColor:this.untraceableColor},getStyle:function(d,c){var a=this.getColor(c);return"fill:"+a+"; fill-opacity:0.5; stroke:"+a+";"}},f,l=function(d,e,a){c.open(d).then(function(){var b;if(b=c.getElementViewer())if(f&& 5 | k.set(f,"background",""),b=b.getLineNode(e))k.set(b,"background",a),n.scrollIntoView(b),f=b})};m.subscribe("slwebview/select",function(d,e){var a,b;c.isElement(d)&&h&&(c.unhighlightAll(),a=d.backing.sid,b=e&&e.line?e.line:-1,0<=b&&(a=d.backing.obj_viewer.code_sid+":"+b.toString()),a=top.rtwChangeSysCallback(a),c.highlight(d,g.getStyle(d,a)),0<=b&&l(d,b,g.getColor(a)))});top.codeToWebView=function(d,e){var a=c.getElement(d),b,f;a||(f=d.lastIndexOf(":"),b=d.substring(f+1),a=c.getElement(e));a&&c.open(a.diagram).then(function(){c.unhighlightAll(); 6 | c.moveToView(a);h=!1;c.highlight(a,g.getStyle(a,!0));0<=b?(l(a,b,g.getColor(!0)),c.select(a)):c.select(a.diagram);h=!0})}})}; 7 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/interface/_coder_G_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * _coder_G_api.h 7 | * 8 | * Code generation for function '_coder_G_api' 9 | * 10 | */ 11 | 12 | #ifndef _CODER_G_API_H 13 | #define _CODER_G_API_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void G_api(const mxArray * const prhs[3], const mxArray *plhs[1]); 29 | 30 | #endif 31 | 32 | /* End of code generation (_coder_G_api.h) */ 33 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/interface/_coder_G_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * _coder_G_info.h 7 | * 8 | * Code generation for function '_coder_G_info' 9 | * 10 | */ 11 | 12 | #ifndef _CODER_G_INFO_H 13 | #define _CODER_G_INFO_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | MEXFUNCTION_LINKAGE mxArray *emlrtMexFcnProperties(); 29 | extern const mxArray *emlrtMexFcnResolvedFunctionsInfo(); 30 | 31 | #endif 32 | 33 | /* End of code generation (_coder_G_info.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/interface/_coder_G_mex.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * _coder_G_mex.cpp 7 | * 8 | * Code generation for function '_coder_G_mex' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "G.h" 14 | #include "_coder_G_mex.h" 15 | #include "G_terminate.h" 16 | #include "_coder_G_api.h" 17 | #include "G_initialize.h" 18 | #include "G_data.h" 19 | #include "blas.h" 20 | 21 | /* Function Declarations */ 22 | static void G_mexFunction(int32_T nlhs, mxArray *plhs[1], int32_T nrhs, const 23 | mxArray *prhs[3]); 24 | 25 | /* Function Definitions */ 26 | static void G_mexFunction(int32_T nlhs, mxArray *plhs[1], int32_T nrhs, const 27 | mxArray *prhs[3]) 28 | { 29 | int32_T n; 30 | const mxArray *inputs[3]; 31 | const mxArray *outputs[1]; 32 | int32_T b_nlhs; 33 | emlrtStack st = { NULL, NULL, NULL }; 34 | 35 | st.tls = emlrtRootTLSGlobal; 36 | 37 | /* Check for proper number of arguments. */ 38 | if (nrhs != 3) { 39 | emlrtErrMsgIdAndTxt(&st, "EMLRT:runTime:WrongNumberOfInputs", 5, 12, 3, 4, 1, 40 | "G"); 41 | } 42 | 43 | if (nlhs > 1) { 44 | emlrtErrMsgIdAndTxt(&st, "EMLRT:runTime:TooManyOutputArguments", 3, 4, 1, 45 | "G"); 46 | } 47 | 48 | /* Temporary copy for mex inputs. */ 49 | for (n = 0; n < nrhs; n++) { 50 | inputs[n] = prhs[n]; 51 | if (*emlrtBreakCheckR2012bFlagVar != 0) { 52 | emlrtBreakCheckR2012b(&st); 53 | } 54 | } 55 | 56 | /* Call the function. */ 57 | G_api(inputs, outputs); 58 | 59 | /* Copy over outputs to the caller. */ 60 | if (nlhs < 1) { 61 | b_nlhs = 1; 62 | } else { 63 | b_nlhs = nlhs; 64 | } 65 | 66 | emlrtReturnArrays(b_nlhs, plhs, outputs); 67 | 68 | /* Module termination. */ 69 | G_terminate(); 70 | } 71 | 72 | void mexFunction(int32_T nlhs, mxArray *plhs[], int32_T nrhs, const mxArray 73 | *prhs[]) 74 | { 75 | mexAtExit(G_atexit); 76 | 77 | /* Initialize the memory manager. */ 78 | /* Module initialization. */ 79 | G_initialize(); 80 | 81 | /* Dispatch the entry-point. */ 82 | G_mexFunction(nlhs, plhs, nrhs, prhs); 83 | } 84 | 85 | emlrtCTX mexFunctionCreateRootTLS() 86 | { 87 | emlrtCreateRootTLS(&emlrtRootTLSGlobal, &emlrtContextGlobal, NULL, 1); 88 | return emlrtRootTLSGlobal; 89 | } 90 | 91 | /* End of code generation (_coder_G_mex.cpp) */ 92 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/interface/_coder_G_mex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * _coder_G_mex.h 7 | * 8 | * Code generation for function '_coder_G_mex' 9 | * 10 | */ 11 | 12 | #ifndef _CODER_G_MEX_H 13 | #define _CODER_G_MEX_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void mexFunction(int32_T nlhs, mxArray *plhs[], int32_T nrhs, const 29 | mxArray *prhs[]); 30 | extern emlrtCTX mexFunctionCreateRootTLS(); 31 | 32 | #endif 33 | 34 | /* End of code generation (_coder_G_mex.h) */ 35 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/mean.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * mean.h 7 | * 8 | * Code generation for function 'mean' 9 | * 10 | */ 11 | 12 | #ifndef MEAN_H 13 | #define MEAN_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void mean(const emlrtStack *sp, const emxArray_real_T *x, emxArray_real_T 29 | *y); 30 | 31 | #endif 32 | 33 | /* End of code generation (mean.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/mean.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/mean.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/power.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * power.cpp 7 | * 8 | * Code generation for function 'power' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "G.h" 15 | #include "power.h" 16 | #include "error.h" 17 | #include "G_emxutil.h" 18 | #include "scalexpAlloc.h" 19 | #include "G_data.h" 20 | #include "blas.h" 21 | 22 | /* Variable Definitions */ 23 | static emlrtRSInfo n_emlrtRSI = { 58, "power", 24 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/ops/power.m" }; 25 | 26 | static emlrtRSInfo o_emlrtRSI = { 61, "power", 27 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/ops/power.m" }; 28 | 29 | static emlrtRSInfo p_emlrtRSI = { 73, "applyScalarFunction", 30 | "/Applications/MATLAB_R2016a.app/toolbox/eml/eml/+coder/+internal/applyScalarFunction.m" 31 | }; 32 | 33 | static emlrtRSInfo q_emlrtRSI = { 132, "applyScalarFunction", 34 | "/Applications/MATLAB_R2016a.app/toolbox/eml/eml/+coder/+internal/applyScalarFunction.m" 35 | }; 36 | 37 | static emlrtRTEInfo j_emlrtRTEI = { 16, 9, "scalexpAlloc", 38 | "/Applications/MATLAB_R2016a.app/toolbox/eml/eml/+coder/+internal/scalexpAlloc.m" 39 | }; 40 | 41 | static emlrtRTEInfo q_emlrtRTEI = { 17, 19, "scalexpAlloc", 42 | "/Applications/MATLAB_R2016a.app/toolbox/eml/eml/+coder/+internal/scalexpAlloc.m" 43 | }; 44 | 45 | /* Function Declarations */ 46 | static boolean_T fltpower_domain_error(); 47 | 48 | /* Function Definitions */ 49 | static boolean_T fltpower_domain_error() 50 | { 51 | return false; 52 | } 53 | 54 | void power(const emlrtStack *sp, const emxArray_real_T *a, emxArray_real_T *y) 55 | { 56 | int32_T k; 57 | emlrtStack st; 58 | emlrtStack b_st; 59 | emlrtStack c_st; 60 | st.prev = sp; 61 | st.tls = sp->tls; 62 | st.site = &m_emlrtRSI; 63 | b_st.prev = &st; 64 | b_st.tls = st.tls; 65 | c_st.prev = &b_st; 66 | c_st.tls = b_st.tls; 67 | b_st.site = &n_emlrtRSI; 68 | c_st.site = &p_emlrtRSI; 69 | k = y->size[0] * y->size[1]; 70 | y->size[0] = 1; 71 | y->size[1] = (uint16_T)a->size[1]; 72 | emxEnsureCapacity(&c_st, (emxArray__common *)y, k, (int32_T)sizeof(real_T), 73 | &j_emlrtRTEI); 74 | if (dimagree(y, a)) { 75 | } else { 76 | emlrtErrorWithMessageIdR2012b(&c_st, &q_emlrtRTEI, "MATLAB:dimagree", 0); 77 | } 78 | 79 | c_st.site = &q_emlrtRSI; 80 | for (k = 0; k + 1 <= a->size[1]; k++) { 81 | y->data[k] = a->data[k] * a->data[k]; 82 | } 83 | 84 | if (fltpower_domain_error()) { 85 | b_st.site = &o_emlrtRSI; 86 | b_error(&b_st); 87 | } 88 | } 89 | 90 | /* End of code generation (power.cpp) */ 91 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/power.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * power.h 7 | * 8 | * Code generation for function 'power' 9 | * 10 | */ 11 | 12 | #ifndef POWER_H 13 | #define POWER_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void power(const emlrtStack *sp, const emxArray_real_T *a, 29 | emxArray_real_T *y); 30 | 31 | #endif 32 | 33 | /* End of code generation (power.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/power.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/power.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/rt_nonfinite.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * rt_nonfinite.h 7 | * 8 | * Code generation for function 'G' 9 | * 10 | */ 11 | 12 | #ifndef RT_NONFINITE_H 13 | #define RT_NONFINITE_H 14 | #define rtInf mxGetInf() 15 | #define rtMinusInf (-mxGetInf()) 16 | #define rtNaN mxGetNaN() 17 | #define rtIsNaN(X) mxIsNaN(X) 18 | #define rtIsInf(X) mxIsInf(X) 19 | #define rtIsNaNF(X) mxIsNaN(X) 20 | #define rtIsInfF(X) mxIsInf(X) 21 | #endif 22 | /* End of code generation (rt_nonfinite.h) */ 23 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/rtwtypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * rtwtypes.h 7 | * 8 | * Code generation for function 'G' 9 | * 10 | */ 11 | 12 | #ifndef RTWTYPES_H 13 | #define RTWTYPES_H 14 | #include "tmwtypes.h" 15 | /* 16 | * TRUE/FALSE definitions 17 | */ 18 | #ifndef TRUE 19 | #define TRUE (1U) 20 | #endif 21 | #ifndef FALSE 22 | #define FALSE (0U) 23 | #endif 24 | #endif 25 | /* End of code generation (rtwtypes.h) */ 26 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/scalexpAlloc.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * scalexpAlloc.cpp 7 | * 8 | * Code generation for function 'scalexpAlloc' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "G.h" 15 | #include "scalexpAlloc.h" 16 | #include "blas.h" 17 | 18 | /* Function Definitions */ 19 | boolean_T dimagree(const emxArray_real_T *z, const emxArray_real_T *varargin_1) 20 | { 21 | boolean_T p; 22 | boolean_T b_p; 23 | int32_T k; 24 | boolean_T exitg1; 25 | p = true; 26 | b_p = true; 27 | k = 0; 28 | exitg1 = false; 29 | while ((!exitg1) && (k + 1 < 3)) { 30 | if (z->size[k] != varargin_1->size[k]) { 31 | b_p = false; 32 | exitg1 = true; 33 | } else { 34 | k++; 35 | } 36 | } 37 | 38 | if (b_p) { 39 | } else { 40 | p = false; 41 | } 42 | 43 | return p; 44 | } 45 | 46 | /* End of code generation (scalexpAlloc.cpp) */ 47 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/scalexpAlloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * scalexpAlloc.h 7 | * 8 | * Code generation for function 'scalexpAlloc' 9 | * 10 | */ 11 | 12 | #ifndef SCALEXPALLOC_H 13 | #define SCALEXPALLOC_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern boolean_T dimagree(const emxArray_real_T *z, const emxArray_real_T 29 | *varargin_1); 30 | 31 | #endif 32 | 33 | /* End of code generation (scalexpAlloc.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/scalexpAlloc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/scalexpAlloc.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/setEnv.sh: -------------------------------------------------------------------------------- 1 | CC="/usr/bin/xcrun -sdk macosx10.11 clang" 2 | CXX="/usr/bin/xcrun -sdk macosx10.11 clang" 3 | CFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -DMATLAB_MEX_FILE" 4 | CXXFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -DMATLAB_MEX_FILE" 5 | COPTIMFLAGS="-O2 -DNDEBUG" 6 | CXXOPTIMFLAGS="-O2 -DNDEBUG" 7 | CDEBUGFLAGS="-g" 8 | CXXDEBUGFLAGS="-g" 9 | LD="/usr/bin/xcrun -sdk macosx10.11 clang" 10 | LDXX="/usr/bin/xcrun -sdk macosx10.11 clang" 11 | LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.11 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -bundle -Wl,-exported_symbols_list,"/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map" -L"/Applications/MATLAB_R2016a.app/bin/maci64" -lmx -lmex -lmat -lc++ -Wl,-exported_symbols_list,"/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map"" 12 | LDDEBUGFLAGS="-g" 13 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/sqrt.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * sqrt.cpp 7 | * 8 | * Code generation for function 'sqrt' 9 | * 10 | */ 11 | 12 | /* Include files */ 13 | #include "rt_nonfinite.h" 14 | #include "G.h" 15 | #include "sqrt.h" 16 | #include "error.h" 17 | #include "eml_int_forloop_overflow_check.h" 18 | #include "G_data.h" 19 | #include "blas.h" 20 | 21 | /* Variable Definitions */ 22 | static emlrtRSInfo h_emlrtRSI = { 12, "sqrt", 23 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/elfun/sqrt.m" }; 24 | 25 | static emlrtRSInfo i_emlrtRSI = { 15, "sqrt", 26 | "/Applications/MATLAB_R2016a.app/toolbox/eml/lib/matlab/elfun/sqrt.m" }; 27 | 28 | static emlrtRSInfo j_emlrtRSI = { 24, "applyScalarFunctionInPlace", 29 | "/Applications/MATLAB_R2016a.app/toolbox/eml/eml/+coder/+internal/applyScalarFunctionInPlace.m" 30 | }; 31 | 32 | /* Function Definitions */ 33 | void b_sqrt(real_T *x) 34 | { 35 | *x = muDoubleScalarSqrt(*x); 36 | } 37 | 38 | void c_sqrt(const emlrtStack *sp, emxArray_real_T *x) 39 | { 40 | boolean_T p; 41 | int32_T nx; 42 | int32_T k; 43 | emlrtStack st; 44 | emlrtStack b_st; 45 | emlrtStack c_st; 46 | st.prev = sp; 47 | st.tls = sp->tls; 48 | b_st.prev = &st; 49 | b_st.tls = st.tls; 50 | c_st.prev = &b_st; 51 | c_st.tls = b_st.tls; 52 | p = false; 53 | nx = x->size[0] * x->size[1]; 54 | for (k = 0; k < nx; k++) { 55 | if (p || (x->data[k] < 0.0)) { 56 | p = true; 57 | } else { 58 | p = false; 59 | } 60 | } 61 | 62 | if (p) { 63 | st.site = &h_emlrtRSI; 64 | error(&st); 65 | } 66 | 67 | st.site = &i_emlrtRSI; 68 | nx = x->size[0] * x->size[1]; 69 | b_st.site = &j_emlrtRSI; 70 | if ((!(1 > nx)) && (nx > 2147483646)) { 71 | c_st.site = &k_emlrtRSI; 72 | check_forloop_overflow_error(&c_st); 73 | } 74 | 75 | for (k = 0; k + 1 <= nx; k++) { 76 | x->data[k] = muDoubleScalarSqrt(x->data[k]); 77 | } 78 | } 79 | 80 | /* End of code generation (sqrt.cpp) */ 81 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/sqrt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * sqrt.h 7 | * 8 | * Code generation for function 'sqrt' 9 | * 10 | */ 11 | 12 | #ifndef SQRT_H 13 | #define SQRT_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void b_sqrt(real_T *x); 29 | extern void c_sqrt(const emlrtStack *sp, emxArray_real_T *x); 30 | 31 | #endif 32 | 33 | /* End of code generation (sqrt.h) */ 34 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/sqrt.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/sqrt.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/warning.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Academic License - for use in teaching, academic research, and meeting 3 | * course requirements at degree granting institutions only. Not for 4 | * government, commercial, or other organizational use. 5 | * 6 | * warning.h 7 | * 8 | * Code generation for function 'warning' 9 | * 10 | */ 11 | 12 | #ifndef WARNING_H 13 | #define WARNING_H 14 | 15 | /* Include files */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "mwmathutil.h" 21 | #include "tmwtypes.h" 22 | #include "mex.h" 23 | #include "emlrt.h" 24 | #include "rtwtypes.h" 25 | #include "G_types.h" 26 | 27 | /* Function Declarations */ 28 | extern void warning(const emlrtStack *sp); 29 | 30 | #endif 31 | 32 | /* End of code generation (warning.h) */ 33 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/codegen/mex/G/warning.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCC2/codegen/mex/G/warning.o -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/dccMLE.m: -------------------------------------------------------------------------------- 1 | function [ x1_final ] = dccMLE( epsilon, deltaX, M ) 2 | % Estimate the MLE for DCC parameter X 3 | % Input: 4 | % epsilon: standardized residual time series, size T-by-K 5 | % deltaX: precision of parameter X 6 | % M: number of random starts when using fmincon to find optimized X 7 | % Output: 8 | % x1_final: MLE of 1-by-2 dcc parameter X 9 | % Used by: 10 | % garchDCC_X.m 11 | % Function dependency: 12 | % LcOriginal_mex 13 | 14 | if nargin < 3 15 | M = 5; 16 | end 17 | 18 | if nargin < 2 19 | deltaX = 10^(-4); 20 | end 21 | 22 | [version_num, version_name, version_date] = check_matlab_version; 23 | if version_date > datenum('01-Jan-2016') 24 | 25 | options = optimoptions('fmincon','Display','off','StepTolerance',deltaX,'Algorithm','interior-point'); 26 | 27 | else 28 | 29 | options = optimoptions('fmincon','Display','off','TolX',deltaX,'Algorithm','interior-point'); 30 | 31 | end 32 | 33 | 34 | x1 = zeros(M,2); 35 | f1 = zeros(M,1); 36 | 37 | for m = 1:M 38 | x0 = rand(1,2); 39 | while(sum(x0) >= 1) 40 | x0 = rand(1,2); 41 | end 42 | x1(m,:) = fmincon(@(x)LcOriginal_mex(epsilon,x),x0,[1 1],1,[],[],[0 0],[1 1],[],options); 43 | f1(m) = LcOriginal_mex(epsilon,x1(m,:)); 44 | end 45 | 46 | [~,index] = min(f1); 47 | x1_final = x1(index,:); 48 | 49 | end 50 | 51 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/epsilonToR_2.m: -------------------------------------------------------------------------------- 1 | function [ R, S0 ] = epsilonToR_2( epsilon, para ) 2 | % auxiliary function, calculate time-varying conditional correlation matrix 3 | % from standardized returns. 4 | % 5 | % Syntax: 6 | % [ R ] = epsilonToR( epsilon, para ) 7 | % Input: 8 | % epsilon: standardized residual time series, size T-by-K 9 | % para: 1-by-2 dcc parameter vector 10 | % Output: 11 | % R: K-by-K-by-T conditional correlation matrix, when K = 2, only 12 | % output the off-diagonal element of R_t to save space, so R is 1-by-T matrix 13 | % S0: K-by-K matrix, unconditional correlation matrix 14 | % Used by: 15 | % garchDCC_X.m 16 | 17 | 18 | T = size(epsilon,1); 19 | K = size(epsilon,2); 20 | 21 | S2 = corr(epsilon); 22 | SS = S2*(1-sum(para)); 23 | 24 | Q = S2; 25 | 26 | S0 = zeros(K,K); 27 | 28 | R = zeros(K,K,T); 29 | for t = 1:T 30 | temp = epsilon(t,:).*sqrt(diag(Q))'; 31 | temp2 = temp'*temp; 32 | S0 = S0 + temp2; 33 | Q = SS + para(1)*temp2 + para(2)*Q; 34 | R(:,:,t) = diag(1./sqrt(diag(Q)))*Q*diag(1./sqrt(diag(Q))); 35 | end 36 | 37 | S0 = S0/T; 38 | 39 | 40 | end -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/epsilonToY.m: -------------------------------------------------------------------------------- 1 | function [ Y ] = epsilonToY( epsilon ) 2 | %Auxiliary function 3 | % Input: 4 | % epsilon: T-by-K residual time series 5 | % Output: 6 | % Y: K*(K+1)/2-by-T matrix, vecterized outer product time series 7 | % Used by: 8 | % F.m 9 | 10 | 11 | 12 | T = size(epsilon,1); 13 | K = size(epsilon,2); 14 | 15 | Y = zeros(K*(K+1)/2,T); 16 | 17 | 18 | for t = 1:T 19 | Y(1:K,t) = (epsilon(t,:).^2)'; 20 | count = K; 21 | for i = 1:K 22 | for j = (i+1):K 23 | count = count + 1; 24 | Y(count,t) = epsilon(t,i)*epsilon(t,j); 25 | end 26 | end 27 | end 28 | 29 | 30 | 31 | end 32 | 33 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/generateData.m: -------------------------------------------------------------------------------- 1 | function [ r, H, R ] = generateData( K, T, theta, para, burnIn ) 2 | %% generating simulation data from DCC model 3 | % Syntax: 4 | % [ r, H, R ] = generateData( K, T, theta, para, burnIn ) 5 | % Input: 6 | % K = dimension of time series 7 | % T = length of time series 8 | % theta = garch(1,1) parameters for volatilities 9 | % para = [alpha beta] dynamic correlation parameters 10 | % burnIn = how many initial data to discard 11 | % Output: 12 | % r = T-by-K data matrix 13 | % H: H_1,...,H_T conditional covariance, K*K*T matrix. 14 | % R: R_1,...,R_T conditional correlation, K*K*T matrix. 15 | 16 | %% 17 | alpha = para(1); 18 | beta = para(2); 19 | T0 = T+burnIn; 20 | 21 | % initial value 22 | Q = eye(K); 23 | Rt = eye(K); 24 | mu0 = zeros(1,K); 25 | h = ones(1,K); 26 | 27 | %temp = rand(K,K); 28 | %temp = (temp + temp')/2; 29 | %S = eye(K) + 0.1*temp; 30 | S = eye(K); 31 | 32 | H = zeros(K,K,T0); 33 | R = ones(K,K,T0); 34 | 35 | r = zeros(T0,K); 36 | for t = 1:T0 37 | epsilon = mvnrnd(mu0,Rt); 38 | rt = epsilon.*sqrt(h); 39 | r(t,:) = rt; 40 | Q = (1-alpha-beta)*S + alpha*(epsilon'*epsilon) + beta*Q; % Q_{t+1} 41 | Rt = diag(1./sqrt(diag(Q)))*Q*diag(1./sqrt(diag(Q))); % R_{t+1} 42 | h = theta(1) + theta(2)*rt.^2 + theta(3)*h; % D_{t+1} 43 | 44 | R(:,:,t) = Rt; 45 | H(:,:,t) = diag(sqrt(h))*Rt*diag(sqrt(h)); 46 | end 47 | 48 | r = r((burnIn+1):T0,:); 49 | R = R(:,:,(burnIn+1):T0); 50 | H = H(:,:,(burnIn+1):T0); 51 | 52 | end 53 | 54 | -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/generateData_corr.m: -------------------------------------------------------------------------------- 1 | function [ r, R ] = generateData_corr( K, T, para, burnIn, S ) 2 | %% generating simulation data from reduced_DCC model (no volatility, corr only) 3 | % Syntax: 4 | % [ r, R ] = generateData( K, T, theta, para, burnIn ) 5 | % Input: 6 | % K = dimension of time series 7 | % T = length of time series 8 | % para = [alpha beta] dynamic correlation parameters 9 | % burnIn = how many initial data to discard 10 | % S = unconditional correlation matrix 11 | % Output: 12 | % r = T-by-K data matrix 13 | % R: R_1,...,R_T conditional correlation, K*K*T matrix. 14 | 15 | %% 16 | alpha = para(1); 17 | beta = para(2); 18 | T0 = T+burnIn; 19 | 20 | if nargin < 5 21 | % if no user input unconditional correlation matrix S 22 | S = eye(K); 23 | end 24 | 25 | % initial value 26 | Q = eye(K); 27 | Rt = eye(K); 28 | mu0 = zeros(1,K); 29 | 30 | R = ones(K,K,T0); 31 | r = zeros(T0,K); 32 | 33 | for t = 1:T0 34 | R(:,:,t) = Rt; 35 | epsilon = mvnrnd(mu0,Rt); 36 | r(t,:) = epsilon; 37 | Q = (1-alpha-beta)*S + alpha*(epsilon'*epsilon) + beta*Q; % Q_{t+1} 38 | Rt = diag(1./sqrt(diag(Q)))*Q*diag(1./sqrt(diag(Q))); % R_{t+1} 39 | end 40 | 41 | r = r((burnIn+1):T0,:); 42 | R = R(:,:,(burnIn+1):T0); 43 | 44 | end -------------------------------------------------------------------------------- /DCC_toolbox/DCC2/myFixPointFinder.m: -------------------------------------------------------------------------------- 1 | function [ x ] = myFixPointFinder( epsilon,deltaX,x0 ) 2 | %% Efficiently find the solution for fixed point x: F(x,Y0,vecS0)=x 3 | % Syntax: 4 | % [ x ] = myFixPointFinder( epsilon,deltaX,x0 ) 5 | % Input: 6 | % epsilon: standardized residual time series, size T-by-K 7 | % deltaX: precision of parameter X 8 | % x0: initial value 9 | % Output: 10 | % x: MLE of 1-by-2 dcc parameter X 11 | % Used by: 12 | % garchDCC_X.m 13 | % Function dependency: 14 | % F_mex 15 | % G_mex 16 | 17 | %% 18 | Y0 = epsilonToY(epsilon); 19 | vecS0 = mean(Y0,2); 20 | 21 | if nargin < 3 22 | x0 = rand(1,2); 23 | while sum(x0) >= 1 24 | x0 = rand(1,2); 25 | end 26 | end 27 | 28 | if nargin < 2 29 | deltaX = 10^(-4); 30 | end 31 | 32 | options = optimoptions('fmincon','Display','off','StepTolerance',deltaX,'Algorithm','sqp'); 33 | 34 | for q = 1:50 35 | temp = F_mex(x0,Y0,vecS0)-x0; 36 | if max(abs(temp))< deltaX 37 | break 38 | else 39 | x0 = x0 + rand()*temp; 40 | end 41 | end 42 | 43 | if q==50 44 | x = fmincon(@(para)G_mex(para,Y0,vecS0),x0,[1 1],1,[],[],[0 0],[1 1],[],options); 45 | else 46 | x = x0; 47 | end 48 | 49 | 50 | end 51 | 52 | -------------------------------------------------------------------------------- /DCC_toolbox/DCCcode/DCCsimple.m: -------------------------------------------------------------------------------- 1 | function [Ct, Ht] = DCC(dat) 2 | % function [Ct, Ht] = DCC(dat) 3 | % 4 | % Estimate a multivariate GARCH model using the DCC estimator of Engle and Sheppard 5 | % 6 | % INPUTS: 7 | % 8 | % dat Zero mean T by p matrix 9 | % 10 | % OUTPUTS: 11 | % 12 | % Ct p by p by T array of conditional correlations 13 | % Ht p by p by T array of conditional covariances 14 | % 15 | % 16 | % File created by Martin Lindquist on 07/22/14 17 | % Last update: 07/22/14 18 | 19 | [T,p] = size(dat); 20 | 21 | [~, ~, Ht] = dcc_mvgarch(dat,1,1,1,1); % Ht is the dyanamic covariance matrix 22 | 23 | % Compute dynamic correlation matrix Ct 24 | Ct = Ht; 25 | for i=1:T, 26 | Ct(:,:,i) = Ht(:,:,i)./sqrt(diag(Ht(:,:,i))*diag(Ht(:,:,i))'); 27 | end 28 | -------------------------------------------------------------------------------- /DCC_toolbox/DCCcode/dcc_hessian.m: -------------------------------------------------------------------------------- 1 | function H = dcc_hessian(f,x,N,varargin) 2 | % PURPOSE: 3 | % Special purpose hessian for use with dcc std errors 4 | % 5 | % USAGE: 6 | % H = dcc_hessian(func,x,N,varargin) 7 | % 8 | % 9 | % INPUTS: 10 | % f = function name, feval = func(x,varargin) 11 | % x = vector of parameters (n x 1) 12 | % N = the last N rows to be completed 13 | % varargin = optional arguments passed to the function 14 | % 15 | % OUTPUTS: 16 | % H = the N last rows of the hessian 17 | % used to speed up dcc_garch 18 | % 19 | % COMMENTS: 20 | % 21 | % 22 | % Author: Kevin Sheppard 23 | % kevin.sheppard@economics.ox.ac.uk 24 | % Revision: 2 Date: 12/31/2001 25 | 26 | doverbose = 0; 27 | 28 | 29 | 30 | 31 | % Code modified from: 32 | % COMPECON toolbox [www4.ncsu.edu/~pfackler] 33 | % by James P. LeSage, Dept of Economics 34 | % University of Toledo 35 | % 2801 W. Bancroft St, 36 | % Toledo, OH 43606 37 | % jlesage@spatial-econometrics.com 38 | 39 | % Copyright (c) Kevin Sheppard. 40 | % $Revision: 1.0 $ $Date: 2001/04/19 $ 41 | 42 | 43 | n = size(x,1); 44 | fx = feval(f,x,varargin{:}); 45 | 46 | % Compute the stepsize (h) 47 | h = eps.^(1/3)*max(abs(x),1); 48 | xh = x+h; 49 | h = xh-x; 50 | ee = sparse(1:n,1:n,h,n,n); 51 | 52 | % Compute forward step 53 | g = zeros(n,1); 54 | for i=1:n 55 | g(i) = feval(f,x+ee(:,i),varargin{:}); 56 | end 57 | 58 | H=h*h'; 59 | % Compute "double" forward step 60 | index=1; 61 | for i=1:n 62 | for j=(n-N+1):n 63 | if doverbose, fprintf('Evaluating Function %d out of %d\n',index,n*N); end 64 | if i<=j; 65 | H(i,j) = (feval(f,x+ee(:,i)+ee(:,j),varargin{:})-g(i)-g(j)+fx)/H(i,j); 66 | H(j,i) = H(i,j); 67 | end 68 | index=index+1; 69 | end 70 | end 71 | 72 | newH=H((n-N+1):n,:); 73 | H=newH; -------------------------------------------------------------------------------- /DCC_toolbox/DCCcode/dcc_mvgarch_likelihood.m: -------------------------------------------------------------------------------- 1 | function [logL, Rt, likelihoods, Qt]=dcc_mvgarch_likelihood(params, stdresid, P, Q) 2 | % PURPOSE: 3 | % Restricted likelihood for use in the DCC_MVGARCH estimation and 4 | % returns the likelihood of the 2SQMLE estimates of the DCC parameters 5 | % 6 | % USAGE: 7 | % [logL, Rt, likelihoods]=dcc_garch_likelihood(params, stdresid, P, Q) 8 | % 9 | % INPUTS: 10 | % params - A P+Q by 1 vector of parameters of the form [dccPparameters;dccQparameters] 11 | % stdresid - A matrix, t x k of residuals standardized by their conditional standard deviation 12 | % P - The innovation order of the DCC Garch process 13 | % Q - The AR order of the DCC estimator 14 | % 15 | % OUTPUTS: 16 | % logL - Th ecalculate Quasi-Likelihood 17 | % Rt - a k x k x t 3 dimesnaional array of conditional correlations 18 | % likelihoods - a t by 1 vector of quasi likelihoods 19 | % 20 | % 21 | % COMMENTS: 22 | % 23 | % 24 | % Author: Kevin Sheppard 25 | % kevin.sheppard@economics.ox.ac.uk 26 | % Revision: 2 Date: 12/31/2001 27 | 28 | doverbose = 0; 29 | 30 | [t,k]=size(stdresid); 31 | a=params(1:P); 32 | b=params(P+1:P+Q); 33 | sumA=sum(a); 34 | sumB=sum(b); 35 | 36 | %First compute Qbar, the unconditional Correlation Matrix 37 | Qbar=cov(stdresid); 38 | 39 | % Next compute Qt 40 | m=max(P,Q); 41 | Qt=zeros(k,k,t+m); 42 | Rt=zeros(k,k,t+m); 43 | Qt(:,:,1:m)=repmat(Qbar,[1 1 m]); 44 | Rt(:,:,1:m)=repmat(Qbar,[1 1 m]); 45 | logL=0; 46 | likelihoods=zeros(1,t+m); 47 | %The stdresid have epected value 1 maybe but in the variances 48 | stdresid=[zeros(m,k);stdresid]; 49 | for j=(m+1):t+m 50 | Qt(:,:,j)=Qbar*(1-sumA-sumB); 51 | for i=1:P 52 | Qt(:,:,j)=Qt(:,:,j)+a(i)*(stdresid(j-i,:)'*stdresid(j-i,:)); 53 | end 54 | for i=1:Q 55 | Qt(:,:,j)=Qt(:,:,j)+b(i)*Qt(:,:,j-i); 56 | end 57 | Rt(:,:,j)=Qt(:,:,j)./(sqrt(diag(Qt(:,:,j)))*sqrt(diag(Qt(:,:,j)))'); 58 | likelihoods(j)=log(det(Rt(:,:,j)))+stdresid(j,:)*inv(Rt(:,:,j))*stdresid(j,:)'; 59 | logL=logL+likelihoods(j); 60 | end; 61 | 62 | Qt=Qt(:,:,(m+1:t+m)); 63 | Rt=Rt(:,:,(m+1:t+m)); 64 | logL=(1/2)*logL; 65 | likelihoods=(1/2)*likelihoods(m+1:t+m); 66 | 67 | if isreal(logL) 68 | else 69 | if doverbose 70 | disp('Imag') 71 | params 72 | end 73 | 74 | logL=10E+8; 75 | end 76 | 77 | if isinf(logL) 78 | if doverbose 79 | disp('Inf') 80 | params 81 | end 82 | logL=10E+8; 83 | end 84 | -------------------------------------------------------------------------------- /DCC_toolbox/DCCcode/dcc_univariate_simulate.m: -------------------------------------------------------------------------------- 1 | function [simulatedata, H] = dcc_univariate_simulate(parameters,p,q,data) 2 | % PURPOSE: 3 | % Make a univariate time series of conditional variances for use by DCC_GARCH_FULL_LIKELIHOOD 4 | % 5 | % 6 | % USAGE: 7 | % [simulatedata, H] = dcc_univariate_simulate(parameters,p,q,data) 8 | % 9 | % 10 | % INPUTS: 11 | % parameters - A vector(p+q+1) by 1 of parameters of form 12 | % [omega archp(1) ... archp(p) garchp(1) ... garchp(q)] 13 | % p - The number of innovations to include(scalar) 14 | % q - The length of the AR in the Garch process(scalar) 15 | % data - A set of zero mean residuals you wish to introduce garch effects to 16 | % 17 | % OUTPUTS: 18 | % simulatedata - The data that has had garch standard deviation applied to it 19 | % H - The conditional variances for the data 20 | % 21 | % 22 | % COMMENTS: 23 | % 24 | % 25 | % Author: Kevin Sheppard 26 | % kevin.sheppard@economics.ox.ac.uk 27 | % Revision: 2 Date: 12/31/2001 28 | 29 | 30 | 31 | constp=parameters(1); 32 | archp=parameters(2:p+1); 33 | garchp=parameters(p+2:p+q+1); 34 | 35 | 36 | 37 | if isempty(q) 38 | m=p; 39 | else 40 | m = max(p,q); 41 | end 42 | 43 | [t,k]=size(data); 44 | UncondStd = sqrt(cov(data)); 45 | h=UncondStd.^2*ones(t+m,1); 46 | data=[UncondStd*ones(m,1);data]; 47 | RandomNums=randn(t+m,1); 48 | T=size(data,1); 49 | 50 | 51 | h=garchcore(data,parameters,UncondStd^2,p,q,m,T); 52 | % for t = (m + 1):T 53 | % h(t) = parameters' * [1 ; data(t-(1:p)).^2; h(t-(1:q)) ]; 54 | % end 55 | 56 | 57 | 58 | 59 | simulatedata=data((m+1):T); 60 | H=h((m + 1):T); 61 | -------------------------------------------------------------------------------- /DCC_toolbox/DCCcode/garchcore.m: -------------------------------------------------------------------------------- 1 | function h=garchcore(data,parameters,covEst,p,q,m,T) 2 | % PURPOSE: 3 | % Forward recursion to construct h's 4 | % 5 | % USAGE: 6 | % h=garchcore(data,parameters,covEst,p,q,m,T); 7 | % 8 | % INPUTS: 9 | % See garchlikelihood 10 | % 11 | % OUTPUTS: 12 | % See garchlikelihood 13 | % 14 | % COMMENTS: 15 | % Helper function part of UCSD_GARCH toolbox. Used if you do not use the MEX file. 16 | % You should use the MEX file. 17 | % 18 | % 19 | % Author: Kevin Sheppard 20 | % kevin.sheppard@economics.ox.ac.uk 21 | % Revision: 2 Date: 12/31/2001 22 | h=zeros(size(data)); 23 | h(1:m)=covEst; 24 | for t = (m + 1):T 25 | h(t) = parameters' * [1 ; data(t-(1:p)).^2; h(t-(1:q)) ]; 26 | end -------------------------------------------------------------------------------- /DCC_toolbox/DCCcode/hessian_2sided.m: -------------------------------------------------------------------------------- 1 | function H = hessian_2sided(f,x,varargin) 2 | % PURPOSE: 3 | % Computes 2-sided finite difference Hessian 4 | % 5 | % USAGE: 6 | % H = hessian_2sided(func,x,varargin) 7 | % 8 | % INPUTS: 9 | % func - function name, fval = func(x,varargin) 10 | % x - vector of parameters (n x 1) 11 | % varargin - optional arguments passed to the function 12 | % 13 | % OUTPUTS: 14 | % H - finite differnce, 2-sided hessian 15 | % 16 | % COMMENTS: 17 | % Code originally from COMPECON toolbox [www4.ncsu.edu/~pfackler] 18 | % documentation modified to fit the format of the Ecoometrics Toolbox 19 | % by James P. LeSage, Dept of Economics 20 | % University of Toledo 21 | % 2801 W. Bancroft St, 22 | % Toledo, OH 43606 23 | % jlesage@spatial-econometrics.com 24 | % 25 | % Further modified (to do 2-sided numerical derivs, rather than 1) by: 26 | % Author: Kevin Sheppard 27 | % kevin.sheppard@economics.ox.ac.uk 28 | % Revision: 3 Date: 4/1/2004 29 | 30 | try 31 | feval(f,x,varargin{:}); 32 | catch 33 | error('There was an error evaluating the function. Please check the arguements.'); 34 | end 35 | 36 | 37 | n = size(x,1); 38 | fx = feval(f,x,varargin{:}); 39 | 40 | % Compute the stepsize (h) 41 | h = eps.^(1/3)*max(abs(x),1e-2); 42 | xh = x+h; 43 | h = xh-x; 44 | ee = sparse(1:n,1:n,h,n,n); 45 | 46 | % Compute forward and backward steps 47 | gp = zeros(n,1); 48 | for i=1:n 49 | gp(i) = feval(f,x+ee(:,i),varargin{:}); 50 | end 51 | gm = zeros(n,1); 52 | for i=1:n 53 | gm(i) = feval(f,x-ee(:,i),varargin{:}); 54 | end 55 | 56 | 57 | H=h*h'; 58 | Hm=H; 59 | Hp=H; 60 | % Compute "double" forward and backward steps 61 | for i=1:n 62 | for j=i:n 63 | Hp(i,j) = feval(f,x+ee(:,i)+ee(:,j),varargin{:}); 64 | Hp(j,i)=Hp(i,j); 65 | Hm(i,j) = feval(f,x-ee(:,i)-ee(:,j),varargin{:}); 66 | Hm(j,i)=Hm(i,j); 67 | end 68 | end 69 | 70 | %Compute the hessian 71 | for i=1:n 72 | for j=i:n 73 | H(i,j) = (Hp(i,j)-gp(i)-gp(j)+fx+fx-gm(i)-gm(j)+Hm(i,j))/H(i,j)/2; 74 | H(j,i) = H(i,j); 75 | end 76 | end 77 | -------------------------------------------------------------------------------- /DCC_toolbox/DCCcode/license.txt: -------------------------------------------------------------------------------- 1 | All of the documentation and software included in the UCSD_Garch toolbox for Matlab is copyrighted by Kevin Sheppard. 2 | 3 | Copyright 2001 Kevin Sheppard 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | All advertising materials mentioning features or use of this software must display the following acknowledgement: 10 | This product includes software developed by the Kevin Sheppard. 11 | Neither the name of the University of California at San Diego nor Kevin Sheppard may be used to endorse or promote products derived from this software without specific prior written permission. 12 | THIS SOFTWARE IS PROVIDED BY KEVIN SHEPPARD ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEVIN SHEPPARD OR UCSD OR THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13 | 14 | The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the Regents of the University of California or UCSD. 15 | 16 | Please feel free to contact the author at kevin.sheppard@economics.ox.ac.uk with comments, suggestions, or bugfixes. 17 | 18 | Enjoy, 19 | Kevin Sheppard 20 | 21 | -------------------------------------------------------------------------------- /DCC_toolbox/DCCcode/tempHt.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/DCCcode/tempHt.mat -------------------------------------------------------------------------------- /DCC_toolbox/Example.m: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % Example script for Dynamic Correlation Toolbox 3 | % 4 | % File created by Martin Lindquist 07/22/14 5 | % 6 | % Makes use of functions from the UCSD_Garch toolbox by Kevin Shepard (Please see license agreement) 7 | % 8 | % Before running this script, begin by adding the DC_toolbox and all its subdirectories to the Matlab path. 9 | % 10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11 | 12 | 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % Create simulated data set 15 | 16 | % Define data dimensions 17 | p = 3; % Number of nodes 18 | T = 200; % Numer of time points 19 | 20 | % Generate null data 21 | mu = zeros(p,1); 22 | Sigma = eye(p); 23 | dat=mvnrnd(mu,Sigma,T); 24 | 25 | % Note the input data has dimensions T-by-p (time by #nodes) 26 | 27 | 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | % Fit DCC 30 | 31 | % Simple quick version that assumes common dynamic across all nodes. Not 32 | % recommended for problems with larger values of p. 33 | 34 | [Ct1 ] = DCCsimple(dat); 35 | 36 | % Slower, more accurate version 37 | [Ct2 ] = DCC(dat); 38 | 39 | % Ct1 is the dynamic correlation matrix 40 | 41 | 42 | 43 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 44 | % Fit sliding-window correlations 45 | windowsize = 20; 46 | [ Ct3 ] = sliding_window(dat,windowsize); 47 | 48 | % Ct2 is the sliding window correlation matrix 49 | 50 | 51 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 52 | % Plot some of the results 53 | 54 | figure 55 | subplot 221 56 | imagesc(Ct2(:,:,100), [-1 1]) % Plot the conditional correlation matrix at time 100 57 | colorbar 58 | title('DCC - conditional correlation at time 100') 59 | 60 | subplot 222 61 | plot(squeeze(Ct2(1,3,:))) % Plot the dyanamic correlation between nodes 1 and 3. 62 | ylim([-0.7 0.7]) 63 | hold 64 | plot(1:T,zeros(T,1),'-r') % Plot the true dyanamic correlation between nodes 1 and 3. 65 | title('DCC - dynamic correlation between nodes 1 and 3') 66 | 67 | 68 | subplot 223 69 | imagesc(Ct3(:,:,100), [-1 1]) % Plot the conditional correlation matrix at time 100 70 | colorbar 71 | title('SWC - conditional correlation at time 10') 72 | 73 | subplot 224 74 | plot(squeeze(Ct3(1,3,:))) % Plot the dyanamic correlation between nodes 1 and 3. 75 | ylim([-0.7 0.7]) 76 | hold 77 | plot(1:T,zeros(T,1),'-r') % Plot the true dyanamic correlation between nodes 1 and 3. 78 | title('SWC - dynamic correlation between nodes 1 and 3') 79 | 80 | -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/GarchDCC_X.mltbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/GarchDCC_X/GarchDCC_X.mltbx -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/GarchDCC_X_example.m: -------------------------------------------------------------------------------- 1 | %% Step (1) Generate Data from Garch-DCC model 2 | K = 10; % dimension of time series 3 | T = 200; % time series length 4 | burnIn = 1000; 5 | 6 | % parameters for modelling the volatility of each dimension as a Garch(1,1) process 7 | theta = [0.01 0.05 0.9]; 8 | % parameters for conditional correlations 9 | para = [0.05 0.93]; 10 | % generate data with true DCC model 11 | % r = T-by-K data matrix 12 | % H0: K*K*T matrix containing H_1,...,H_T, where H_t is the true conditional covariance matrix at time t. 13 | % R0: K*K*T matrix containing R_1,...,R_T, where R_t is the true conditional correlation matrix at time t. 14 | [ r, H0, R0 ] = generateData( K, T, theta, para, burnIn ); 15 | r = r - repmat(mean(r),T,1); % demean 16 | 17 | %% Step (2) Parameter Setting 18 | % (2.1) original dcc 19 | allpair = 0; parallel = 0; 20 | 21 | % (2.2) all bivariate pairs dcc 22 | % allpair = 1; parallel = 0; % No parallel 23 | % OR 24 | % allpair = 1; parallel = 1; parpool; % Parallel mode 25 | 26 | %% Step (3) Run DCC_X, DCC_X_mex (faster on Windows 64bit/Mac) 27 | tic 28 | [ H,R,Theta,X ] = DCC_X( r, allpair, parallel ); 29 | toc 30 | 31 | tic 32 | [ H,R,Theta,X ] = DCC_X_mex( r, allpair, parallel ); 33 | toc 34 | 35 | %% Step (4) compare estimate H,R with true value H0,R0 36 | i = 1; 37 | j = 2; 38 | 39 | figure 40 | plot(1:T,squeeze(H0(i,j,:)),'r.-',1:T,squeeze(H(i,j,:)),'b.-') 41 | xlabel('time') 42 | legend('truth','estimated') -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/LcOriginal.m: -------------------------------------------------------------------------------- 1 | function [ output ] = LcOriginal( epsilon, para ) 2 | % Calculate the correlation component in log-likelihood, eq.(29) in ref paper 3 | % Syntax: 4 | % [ output ] = LcOriginal( epsilon, para ) 5 | % Input: 6 | % epsilon: standardized residual time series, size T-by-K 7 | % para: 1-by-2 dcc parameter vector 8 | % Output: 9 | % a real number proportional to the correlation component in negative log-likelihood( to be minimized ) 10 | % Used by: 11 | % DCC_X.m 12 | 13 | T = size(epsilon,1); 14 | K = size(epsilon,2); 15 | 16 | %S2 = corr(epsilon); 17 | S2 = cov(epsilon); 18 | SS = S2*(1-sum(para)); 19 | 20 | Q = S2; 21 | R = diag(1./sqrt(diag(Q)))*Q*diag(1./sqrt(diag(Q))); 22 | 23 | output = 0; 24 | 25 | if K==2 26 | % when K = 2, use some complicate expression to speed up 27 | p = R(1,2); 28 | for t = 1:T 29 | output = output + log(1-p^2) + (sum(epsilon(t,:).^2)- p*epsilon(t,1)*epsilon(t,2))/(1-p^2); 30 | temp = epsilon(t,:).*sqrt(diag(Q))'; 31 | Q = SS + para(1)*(temp'*temp) + para(2)*Q; 32 | p = Q(1,2)/sqrt(Q(1,1)*Q(2,2)); 33 | end 34 | else 35 | for t = 1:T 36 | output = output + log(det(R)) + epsilon(t,:)/R*epsilon(t,:)'; 37 | temp = epsilon(t,:).*sqrt(diag(Q))'; 38 | Q = SS + para(1)*(temp'*temp) + para(2)*Q; 39 | R = diag(1./sqrt(diag(Q)))*Q*diag(1./sqrt(diag(Q))); 40 | end 41 | end 42 | 43 | end 44 | -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/LcOriginal_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/GarchDCC_X/LcOriginal_mex.mexmaci64 -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/LcOriginal_mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/GarchDCC_X/LcOriginal_mex.mexw64 -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/demos.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | GarchDCC_X 4 | toolbox 5 | HelpIcon.DEMOS 6 | Detail usage please refer to example.m file. 7 | 8 | 9 | 10 | 11 | other 12 | GarchDCC_X_example 13 | html/GarchDCC_X_example.html 14 | 15 | 16 | -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/epsilonToR.m: -------------------------------------------------------------------------------- 1 | function [ R ] = epsilonToR( epsilon, para ) 2 | % auxiliary function, calculate time-varying conditional correlation matrix 3 | % from standardized returns. 4 | % 5 | % Syntax: 6 | % [ R ] = epsilonToR( epsilon, para ) 7 | % Input: 8 | % epsilon: standardized residual time series, size T-by-K 9 | % para: 1-by-2 dcc parameter vector 10 | % Output: 11 | % R: K-by-K-by-T conditional correlation matrix, when K = 2, only 12 | % output the off-diagonal element of R_t to save space, so R is 1-by-T matrix 13 | % Used by: 14 | % DCC_X.m 15 | 16 | 17 | T = size(epsilon,1); 18 | K = size(epsilon,2); 19 | 20 | S2 = corr(epsilon); 21 | SS = S2*(1-sum(para)); 22 | 23 | Q = S2; 24 | 25 | if K==2 26 | R = zeros(1,T); 27 | for t = 1:T 28 | temp = epsilon(t,:).*sqrt(diag(Q))'; 29 | Q = SS + para(1)*(temp'*temp) + para(2)*Q; 30 | R(t) = Q(1,2)/sqrt(Q(1,1)*Q(2,2)); 31 | end 32 | else 33 | R = zeros(K,K,T); 34 | for t = 1:T 35 | temp = epsilon(t,:).*sqrt(diag(Q))'; 36 | Q = SS + para(1)*(temp'*temp) + para(2)*Q; 37 | R(:,:,t) = diag(1./sqrt(diag(Q)))*Q*diag(1./sqrt(diag(Q))); 38 | end 39 | end 40 | 41 | 42 | end -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/generateData.m: -------------------------------------------------------------------------------- 1 | function [ r, H, R ] = generateData( K, T, theta, para, burnIn ) 2 | %% generating simulation data from DCC model 3 | % Syntax: 4 | % [ r, H, R ] = generateData( K, T, theta, para, burnIn ) 5 | % Input: 6 | % K = dimension of time series 7 | % T = length of time series 8 | % theta = garch(1,1) parameters for volatilities 9 | % para = [alpha beta] dynamic correlation parameters 10 | % burnIn = how many initial data to discard 11 | % Output: 12 | % r = T-by-K data matrix 13 | % H: H_1,...,H_T conditional covariance, K*K*T matrix. 14 | % R: R_1,...,R_T conditional correlation, K*K*T matrix. 15 | 16 | %% 17 | alpha = para(1); 18 | beta = para(2); 19 | T0 = T+burnIn; 20 | 21 | % initial value 22 | Q = eye(K); 23 | Rt = eye(K); 24 | mu0 = zeros(1,K); 25 | h = ones(1,K); 26 | S = eye(K); 27 | 28 | H = zeros(K,K,T0); 29 | R = ones(K,K,T0); 30 | 31 | r = zeros(T0,K); 32 | for t = 1:T0 33 | epsilon = mvnrnd(mu0,Rt); 34 | rt = epsilon.*sqrt(h); 35 | r(t,:) = rt; 36 | Q = (1-alpha-beta)*S + alpha*(epsilon'*epsilon) + beta*Q; % Q_{t+1} 37 | Rt = diag(1./sqrt(diag(Q)))*Q*diag(1./sqrt(diag(Q))); % R_{t+1} 38 | h = theta(1) + theta(2)*rt.^2 + theta(3)*h; % D_{t+1} 39 | 40 | R(:,:,t) = Rt; 41 | H(:,:,t) = diag(sqrt(h))*Rt*diag(sqrt(h)); 42 | end 43 | 44 | r = r((burnIn+1):T0,:); 45 | R = R(:,:,(burnIn+1):T0); 46 | H = H(:,:,(burnIn+1):T0); 47 | 48 | end 49 | 50 | -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/html/GarchDCC_X_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/GarchDCC_X/html/GarchDCC_X_example.png -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/html/GarchDCC_X_example_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/GarchDCC_X/html/GarchDCC_X_example_01.png -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/loglikelihood_garch11.m: -------------------------------------------------------------------------------- 1 | function [ output ] = loglikelihood_garch11( data, theta ) 2 | % [Syntax] 3 | % [ output ] = loglikelihood_garch11( data, theta ) 4 | % [Input] 5 | % data: one dimensional time series 6 | % theta: 1-by-3 garch (1,1) parameter vector 7 | % [Output] 8 | % a real number proportional to the negative log-likelihood of univariate garch model( to be minimized ) 9 | % [Used by] 10 | % DCC_X.m 11 | 12 | h = mean(data.^2); 13 | T = size(data,1); 14 | output = 0; 15 | 16 | for t = 1:T 17 | output = output + data(t)^2/h + log(h); 18 | h = theta(1) + theta(2)*data(t)^2 + theta(3)*h; 19 | end 20 | 21 | end 22 | 23 | -------------------------------------------------------------------------------- /DCC_toolbox/GarchDCC_X/rToEpsilon.m: -------------------------------------------------------------------------------- 1 | function [ epsilon, d ] = rToEpsilon( r, theta ) 2 | % auxiliary function, perform eq.(25) line 3 of reference paper:epsilon_t = D_t^(-1)*r_t 3 | % Syntax: 4 | % [ epsilon, d ] = rToEpsilon( r, theta ) 5 | % Input: 6 | % theta: fitted univaraite garch parameter theta (1-by-3 vector) 7 | % r: one dimensional time series 8 | % Output: 9 | % epsilon: standardized residual vector, same size as r. 10 | % d: estimated conditional volatility vector, same size as r. 11 | % Used by: 12 | % DCC_X.m 13 | 14 | T = size(r,1); 15 | epsilon = zeros(size(r)); 16 | d = zeros(size(r)); 17 | d(1) = mean(r.^2); 18 | 19 | for t = 1:(T-1) 20 | epsilon(t) = r(t)/sqrt(d(t)); 21 | d(t+1) = theta(1) + theta(2)*r(t)^2 + theta(3)*d(t); 22 | end 23 | 24 | epsilon(T) = r(T)/sqrt(d(T)); 25 | 26 | end 27 | 28 | -------------------------------------------------------------------------------- /DCC_toolbox/README.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf340 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \margl1440\margr1440\vieww10800\viewh8400\viewkind0 5 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 6 | 7 | \f0\fs24 \cf0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\ 8 | Dynamic Correlation Toolbox\ 9 | \ 10 | Created by Martin Lindquist (mlindqui@jhsph.edu)\ 11 | Last Update: 07/22/14\ 12 | \ 13 | Based on material from the paper:\ 14 | \ 15 | '*******************************'\ 16 | \ 17 | Implements dynamic conditional correlations (DCC) and sliding-windows approaches.\ 18 | \ 19 | The DCC code makes use of functions from the UCSD_Garch toolbox by Kevin Shepard (Please see license agreement ~/DC_toolbox/DCCcode/license.txt)\ 20 | \ 21 | The file 'Example.m' will help illustrate how to run the code on your own data.\ 22 | \ 23 | GARCH_DCCx: Updated toolbox that runs faster\ 24 | by Yuting Xu, 2016\ 25 | Comes with example code and results: see GarchDCC_X_example.html \ 26 | and Matlab App toolbox: GarchDCC_X.mltbx\ 27 | \ 28 | DCC2: In-development DCC model. Do not use yet.\ 29 | \ 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\ 31 | \ 32 | } -------------------------------------------------------------------------------- /DCC_toolbox/SWcode/sliding_window.m: -------------------------------------------------------------------------------- 1 | function [ Ct ] = sliding_window(dat,windowsize) 2 | % function [ output ] = sliding_window(,windowsize) 3 | % 4 | % Sliding window correlation of data 5 | % 6 | % INPUTS: 7 | % 8 | % dat Zero mean T by p matrix 9 | % 10 | % OUTPUTS: 11 | % 12 | % Ct p by p by T array of conditional correlations 13 | % 14 | % 15 | % File created by Martin Lindquist on 07/22/14 16 | % Last update: 07/22/14 17 | 18 | [T,p] = size(dat); 19 | 20 | Ct = NaN(p,p,T); 21 | 22 | for i=(windowsize):T 23 | Ct(:,:,i)=corr(dat((i-windowsize+1):i,:)); 24 | end 25 | 26 | end 27 | 28 | 29 | -------------------------------------------------------------------------------- /DCC_toolbox/SWcode/tapered_sliding_window.m: -------------------------------------------------------------------------------- 1 | function [ Ct ] = tapered_sliding_window(dat,windowsize, sigma) 2 | % function [ output ] = tapered_sliding_window(dat,windowsize, sigma) 3 | % 4 | % Tapered sliding window correlation of data 5 | % 6 | % INPUTS: 7 | % 8 | % dat Zero mean T by p matrix 9 | % 10 | % OUTPUTS: 11 | % 12 | % Ct p by p by T array of conditional correlations 13 | % 14 | % 15 | % File created by Martin Lindquist on 07/22/14 16 | % Last update: 07/22/14 17 | 18 | [T,p] = size(dat); 19 | 20 | b= ones(windowsize,1); 21 | x= -3*sigma:1:3*sigma; 22 | w=normpdf(x,0,sigma); 23 | w = conv(b,w); 24 | w=w./sum(w); 25 | len = length(w); 26 | W = repmat(w,1,p); 27 | 28 | 29 | Ct = NaN(p,p,T); 30 | 31 | 32 | 33 | for i=(len):T 34 | 35 | D = dat((i-len+1):i,:).*W; 36 | 37 | Ct(:,:,i)=corr(D); 38 | end 39 | 40 | end 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /DCC_toolbox/Simulations/dcc_sim1_get_tpr_fpr.m: -------------------------------------------------------------------------------- 1 | function [tpr, fpr] = dcc_sim1_get_tpr_fpr(r, wh_true_timepoints) 2 | % r is a timeseries of correlation values. 3 | % 4 | % Get results (naive TPR, FPR) from sim1. Options (t) hard-coded to match 5 | % dcc_sim_generate_data1.m 6 | 7 | 8 | pcrit = .001; 9 | t = 500; 10 | 11 | % Note: may later want to 12 | % eliminate first and last 20 time points so sliding window is not unfairly 13 | % advantaged (it returns NaNs - but tor's version does not...deal with later) 14 | 15 | 16 | truevec = false(t, 1); 17 | truevec(wh_true_timepoints) = true; 18 | 19 | % approx p < pcrit not correcting for autocorrelation, correcting for mult 20 | % comps, two-tailed 21 | 22 | zcrit = norminv(1 - (pcrit / (2*t) )); 23 | 24 | z = fisherz(r); 25 | se = 1 ./ sqrt(t - 3); 26 | 27 | sig = z - zcrit * se > 0 | z + zcrit * se < 0; 28 | 29 | 30 | tpr = sum(sig(truevec)) ./ sum(truevec); 31 | fpr = sum(sig(~truevec)) ./ sum(~truevec); 32 | 33 | end % function 34 | 35 | -------------------------------------------------------------------------------- /DCC_toolbox/Simulations/dcc_sim_generate_data1.m: -------------------------------------------------------------------------------- 1 | function [regions, wh] = dcc_sim_generate_data1(data_options) 2 | % Simple data generation process for two time series with a correlated section (region) of data 3 | % and zero correlation before and after. Fixed time points and windows 4 | % 5 | % regions = t x 2 matrix of two time series 6 | % wh = which time points have TRUE inter-region correlations 7 | % 8 | % Requires data_options structure with rval and smooth fields 9 | % 10 | % Example: 11 | % regions = dcc_sim_generate_data1(struct('rval', .5, 'smooth', true)); 12 | % 13 | 14 | t = 500; 15 | wh = 151:350; % window 16 | 17 | regions = zeros(t, 2); 18 | 19 | regions(1:150, :) = mvnrnd([0 0], [1 0; 0 1], 150); 20 | regions(351:t, :) = mvnrnd([0 0], [1 0; 0 1], 150); 21 | regions(151:350, :) = mvnrnd([0 0], [1 data_options.rval; data_options.rval 1], 200); 22 | 23 | if data_options.smooth % arbitrary smoothing. Later versions could more precisely control this. 24 | for i = 1:2 25 | regions(:, i) = smooth(regions(:, i)); 26 | end 27 | 28 | for i = 1:2 29 | regions(:, i) = smooth(regions(:, i)); 30 | end 31 | end 32 | 33 | end % function 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /DCC_toolbox/tempHt.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCC_toolbox/tempHt.mat -------------------------------------------------------------------------------- /DCD/DCD.m: -------------------------------------------------------------------------------- 1 | function [ splitPoints, Delta ] = DCD( Y, alpha, beta, eta ) 2 | % Complete DCD program 3 | % [Inputs] 4 | % Y: data matrix, dimsion T-by-J, T = time length, J = # of ROIs 5 | % alpha: type I error rate of comparing two splits, default = 0.05. 6 | % beta: type II error rate of comparing two splits, default = 0.05; 7 | % eta: false positive rate of feature selection, default = 0.02; 8 | % [Outputs] 9 | % splitPoints: Estimate split points. 10 | % calculated minimum segment length 11 | 12 | T = size(Y,1); 13 | J = size(Y,2); 14 | 15 | if ~exist('alpha','var') 16 | alpha = 0.05; 17 | elseif alpha < 0 || alpha > 1 18 | error('invalid valud of alpha') 19 | end 20 | 21 | if ~exist('beta','var') 22 | beta = 0.05; 23 | elseif beta < 0 || beta > 1 24 | error('invalid valud of beta') 25 | end 26 | 27 | if ~exist('eta','var') 28 | eta = 0.02/J; 29 | elseif eta < 0 || eta > 1 30 | error('invalid valud of eta') 31 | else 32 | eta = eta/J; 33 | end 34 | 35 | % Decide minimum length of splits Delta 36 | % through sample size calculation in power analysis of two sample t-test 37 | 38 | beta = beta/(J^2); 39 | Delta = 10; 40 | temp_beta = 100; 41 | while temp_beta > beta 42 | Delta = Delta + 1; 43 | temp_beta = tcdf(tinv(1-alpha/2/J,Delta*2-2)-1/sqrt(2/Delta), Delta*2-2); 44 | end 45 | 46 | if Delta > T/2 47 | error('insufficient time series length under current parameter setting!') 48 | end 49 | 50 | % Decide whether to use feature selection method or not 51 | method = 0; % default, no feature selection 52 | if J > 15 || J > Delta*0.6 53 | method = 1; % with feature selection 54 | end 55 | 56 | 57 | mask0 = ones(1,J + J*(J+1)/2); 58 | 59 | if method == 1 60 | % with feature selection 61 | bic0 = size(Y,1)* (log(det(cov(Y)))+ J); 62 | splitPoints = SplitSearch1( Y, bic0, Delta, alpha, eta, mask0); 63 | else 64 | % no feature selection 65 | bic0 = size(Y,1)* log(det(cov(Y))); 66 | splitPoints = SplitSearch2( Y ,bic0, Delta, alpha); 67 | end 68 | 69 | 70 | end 71 | 72 | -------------------------------------------------------------------------------- /DCD/DCD.mltbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canlab/Lindquist_Dynamic_Correlation/b89f827eccd12b0bb027c37654be047cab13c883/DCD/DCD.mltbx -------------------------------------------------------------------------------- /DCD/SignificantSingle1.m: -------------------------------------------------------------------------------- 1 | function [ SignificantIndicator] = SignificantSingle1( Y, candidateTime, alpha, mask) 2 | % Input: 3 | % Y: data time-by-ROI 4 | % candidateTime: candidate split time point 5 | % alpha: significance level 6 | % Output: 7 | % SignificantIndicator: 0 - NO 1 - YES 8 | 9 | SignificantIndicator = 0; 10 | 11 | if isempty(candidateTime) 12 | return 13 | else 14 | Y1 = Y(1:candidateTime,:); 15 | Y2 = Y(candidateTime+1:end,:); 16 | 17 | x1 = fun1(Y1); 18 | x2 = fun1(Y2); 19 | 20 | % 21 | x1 = x1(:,mask); 22 | x2 = x2(:,mask); 23 | % 24 | m1 = mean(x1); 25 | m2 = mean(x2); 26 | 27 | n1 = size(x1,1); 28 | n2 = size(x2,1); 29 | 30 | J = size(x1,2); 31 | 32 | temp1 = x1-ones(n1,1)*m1; 33 | temp2 = sum(temp1.*temp1)/(n1-1); 34 | 35 | temp3 = x2-ones(n2,1)*m2; 36 | temp4 = sum(temp3.*temp3)/(n2-1); 37 | 38 | stat = (m1 - m2)./sqrt(temp2/n1 + temp4/n2); 39 | %q = norminv((1-alpha/J),0,1); 40 | q = tinv(1-alpha/2/J,n1+n2-2); 41 | 42 | SignificantIndicator = (max(abs(stat))>q); 43 | 44 | end 45 | 46 | 47 | end -------------------------------------------------------------------------------- /DCD/SignificantSingle2.m: -------------------------------------------------------------------------------- 1 | function [ SignificantIndicator] = SignificantSingle2( Y, candidateTime, alpha) 2 | % Input: 3 | % Y: data time-by-ROI 4 | % candidateTime: candidate split time point 5 | % alpha: significance level 6 | % Output: 7 | % SignificantIndicator: 0 - NO 1 - YES 8 | 9 | SignificantIndicator = 0; 10 | 11 | if isempty(candidateTime) 12 | return 13 | else 14 | Y1 = Y(1:candidateTime,:); 15 | Y2 = Y(candidateTime+1:end,:); 16 | 17 | x1 = fun1(Y1); 18 | x2 = fun1(Y2); 19 | 20 | m1 = mean(x1); 21 | m2 = mean(x2); 22 | 23 | n1 = size(x1,1); 24 | n2 = size(x2,1); 25 | 26 | J = size(x1,2); 27 | 28 | temp1 = x1-ones(n1,1)*m1; 29 | temp2 = sum(temp1.*temp1)/(n1-1); 30 | 31 | temp3 = x2-ones(n2,1)*m2; 32 | temp4 = sum(temp3.*temp3)/(n2-1); 33 | 34 | stat = (m1 - m2)./sqrt(temp2/n1 + temp4/n2); 35 | %q = norminv((1-alpha/J),0,1); 36 | q = tinv(1-alpha/2/J,n1+n2-2); 37 | 38 | SignificantIndicator = (max(abs(stat))>q); 39 | 40 | end 41 | 42 | 43 | end -------------------------------------------------------------------------------- /DCD/Split1.m: -------------------------------------------------------------------------------- 1 | function [ timepoint, minBIC_1, minBIC_2] = Split1( Y, BIC, Delta, alpha, mask, Z ) 2 | % For recursively find one split point for input series 3 | % INPUT: 4 | % Y: timelength-by-ROIs matrix 5 | % current optimized penalty parameter lambda 6 | % current minimized BIC 7 | % Delta: minimum distance between splits 8 | % lambda_list: a list of candidate lambdas 9 | % OUTPUT 10 | % timepoint: candidate time point for splitting Y 11 | % into [1,timepoint] and [timepoint + 1, end] 12 | % If timepoint = -1, means no further splitting available 13 | 14 | 15 | T = size(Y,1); % time length 16 | %J = size(Y,2); % number of ROIs 17 | 18 | % auxiliary variables 19 | largest_decrease = 0; 20 | minBIC_t = 0; 21 | minBIC_1 = 0; 22 | minBIC_2 = 0; 23 | 24 | if T < 2*Delta 25 | timepoint = -1; 26 | else 27 | for t = Delta : T-Delta 28 | Y1 = Y(1:t,:); 29 | Y2 = Y(t+1:T,:); 30 | n1 = size(Y1,1); 31 | n2 = size(Y2,1); 32 | 33 | S1 = cov(Y1); 34 | S2 = cov(Y2); 35 | 36 | % 37 | S1new = S1.*Z; 38 | S2new = S2.*Z; 39 | 40 | b1 = n1* ( log(det(S1new)) + trace(S1new\S1) ); 41 | b2 = n2* ( log(det(S2new)) + trace(S2new\S2) ); 42 | 43 | % modified 44 | temp = BIC - (b1+b2); 45 | if temp > largest_decrease 46 | largest_decrease = temp; 47 | minBIC_t = t; 48 | minBIC_1 = b1; 49 | minBIC_2 = b2; 50 | end 51 | 52 | end 53 | 54 | 55 | if minBIC_t == 0 56 | timepoint = -1; 57 | else 58 | timepoint = minBIC_t; 59 | SignificantIndicator = SignificantSingle1( Y, timepoint, alpha, mask); 60 | if SignificantIndicator==0 61 | timepoint = -1; 62 | return 63 | end 64 | 65 | end 66 | end 67 | 68 | 69 | end 70 | 71 | -------------------------------------------------------------------------------- /DCD/Split2.m: -------------------------------------------------------------------------------- 1 | function [ timepoint, minBIC_1, minBIC_2] = Split2( Y, BIC, Delta, alpha ) 2 | % For recursively find one split point for input series 3 | % INPUT: 4 | % Y: timelength-by-ROIs matrix 5 | % current optimized penalty parameter lambda 6 | % current minimized BIC 7 | % Delta: minimum distance between splits 8 | % lambda_list: a list of candidate lambdas 9 | % OUTPUT 10 | % timepoint: candidate time point for splitting Y 11 | % into [1,timepoint] and [timepoint + 1, end] 12 | % If timepoint = -1, means no further splitting available 13 | 14 | 15 | T = size(Y,1); % time length 16 | %J = size(Y,2); % number of ROIs 17 | 18 | % auxiliary variables 19 | largest_decrease = 0; 20 | minBIC_t = 0; 21 | minBIC_1 = 0; 22 | minBIC_2 = 0; 23 | 24 | if T < 2*Delta 25 | timepoint = -1; 26 | else 27 | for t = Delta : T-Delta 28 | Y1 = Y(1:t,:); 29 | Y2 = Y(t+1:T,:); 30 | n1 = size(Y1,1); 31 | n2 = size(Y2,1); 32 | 33 | S1 = cov(Y1); 34 | S2 = cov(Y2); 35 | 36 | b1 = n1*log(det(S1)); 37 | b2 = n2*log(det(S2)); 38 | 39 | % modified 40 | temp = BIC - (b1+b2); 41 | if temp > largest_decrease 42 | largest_decrease = temp; 43 | minBIC_t = t; 44 | minBIC_1 = b1; 45 | minBIC_2 = b2; 46 | end 47 | 48 | end 49 | 50 | 51 | if minBIC_t == 0 52 | timepoint = -1; 53 | else 54 | timepoint = minBIC_t; 55 | SignificantIndicator = SignificantSingle2( Y, timepoint, alpha); 56 | if SignificantIndicator==0 57 | timepoint = -1; 58 | return 59 | end 60 | 61 | end 62 | end 63 | 64 | 65 | end 66 | -------------------------------------------------------------------------------- /DCD/SplitSearch1.m: -------------------------------------------------------------------------------- 1 | function [ timepointSSS_new ] = SplitSearch1( Y, BIC, Delta, alpha, eta, mask0) 2 | %UNTITLED Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | %%% NEW! mask imposed 6 | [mask,Z] = featureSelect(Y,eta,mask0); 7 | mask = logical(mask); 8 | if sum(mask~=mask0)>0 9 | %BIC = size(Y,1)* log(det(cov(Y).*Z)); 10 | S = cov(Y); 11 | Snew = cov(Y).*Z; 12 | BIC = size(Y,1)* (log(det(Snew)) + trace(Snew\S) ); 13 | end 14 | %%% 15 | 16 | [ timepoint, minBIC_1, minBIC_2] = Split1( Y, BIC, Delta, alpha, mask, Z ); 17 | 18 | if timepoint == -1 19 | timepointSSS_new = []; 20 | return 21 | else 22 | t1 = SplitSearch1( Y(1:timepoint,:), minBIC_1, Delta, alpha, eta, mask); 23 | t2 = SplitSearch1( Y((timepoint+1):end,:), minBIC_2, Delta, alpha, eta, mask); 24 | t2 = t2 + timepoint; 25 | timepointSSS_new = [t1 timepoint t2]; 26 | end 27 | 28 | end -------------------------------------------------------------------------------- /DCD/SplitSearch2.m: -------------------------------------------------------------------------------- 1 | function [ timepointSSS_new ] = SplitSearch2( Y ,BIC, Delta, alpha) 2 | 3 | [ timepoint, minBIC_1, minBIC_2] = Split2( Y, BIC, Delta, alpha); 4 | 5 | if timepoint == -1 6 | timepointSSS_new = []; 7 | return 8 | else 9 | t1 = SplitSearch2( Y(1:timepoint,:), minBIC_1, Delta, alpha); 10 | t2 = SplitSearch2( Y((timepoint+1):end,:), minBIC_2, Delta, alpha); 11 | t2 = t2 + timepoint; 12 | timepointSSS_new = [t1 timepoint t2]; 13 | end 14 | 15 | 16 | end 17 | -------------------------------------------------------------------------------- /DCD/featureSelect.m: -------------------------------------------------------------------------------- 1 | function [ index, Z ] = featureSelect( Y, eta, index0 ) 2 | %UNTITLED8 Summary of this function goes here 3 | % Detailed explanation goes here 4 | % Input: 5 | % Y - n-by-J 6 | % eta - false positive rate 7 | % Output 8 | % selections: select nonzero index from J ROIs 9 | n = size(Y,1); 10 | 11 | J = size(Y,2); 12 | 13 | x = fun1(Y); 14 | 15 | m = mean(x); 16 | 17 | s = std(x)/sqrt(size(x,1)); 18 | 19 | temp = m./s; 20 | 21 | %index = (abs(temp)>norminv(1-eta/2,0,1)); 22 | index = (abs(temp)>tinv(1-eta/2,n-1)); 23 | index = index.*index0; 24 | 25 | Z = zeros(J,J); 26 | count = J; 27 | for i = 1:J 28 | for j = i:J 29 | count = count + 1; 30 | Z(i,j) = index(count); 31 | Z(j,i) = Z(i,j); 32 | end 33 | end 34 | 35 | for i = 1:J 36 | Z(i,i)=1; 37 | index(j*(J+1-(j-1)/2)) = 1; 38 | end 39 | 40 | 41 | end 42 | 43 | -------------------------------------------------------------------------------- /DCD/fun1.m: -------------------------------------------------------------------------------- 1 | function [ output ] = fun1( Y ) 2 | %UNTITLED5 Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | n = size(Y,1); 6 | J = size(Y,2); 7 | 8 | m = J + J*(J+1)/2; 9 | output = zeros(n,m); 10 | 11 | output(:,1:J) = Y; 12 | 13 | count = J; 14 | for i = 1:J 15 | for j = i:J 16 | count = count + 1; 17 | output(:,count) = Y(:,i).*Y(:,j); 18 | end 19 | end 20 | 21 | 22 | end 23 | 24 | -------------------------------------------------------------------------------- /DCD/home/yuting/Dropbox/Ubuntu_to_Windows/20150210_DCD/SignificantSingle1.m: -------------------------------------------------------------------------------- 1 | function [ SignificantIndicator] = SignificantSingle1( Y, candidateTime, alpha, mask) 2 | % Input: 3 | % Y: data time-by-ROI 4 | % candidateTime: candidate split time point 5 | % alpha: significance level 6 | % Output: 7 | % SignificantIndicator: 0 - NO 1 - YES 8 | 9 | SignificantIndicator = 0; 10 | 11 | if isempty(candidateTime) 12 | return 13 | else 14 | Y1 = Y(1:candidateTime,:); 15 | Y2 = Y(candidateTime+1:end,:); 16 | 17 | x1 = fun1(Y1); 18 | x2 = fun1(Y2); 19 | 20 | % 21 | x1 = x1(:,mask); 22 | x2 = x2(:,mask); 23 | % 24 | m1 = mean(x1); 25 | m2 = mean(x2); 26 | 27 | n1 = size(x1,1); 28 | n2 = size(x2,1); 29 | 30 | J = size(x1,2); 31 | 32 | temp1 = x1-ones(n1,1)*m1; 33 | temp2 = sum(temp1.*temp1)/(n1-1); 34 | 35 | temp3 = x2-ones(n2,1)*m2; 36 | temp4 = sum(temp3.*temp3)/(n2-1); 37 | 38 | stat = (m1 - m2)./sqrt(temp2/n1 + temp4/n2); 39 | %q = norminv((1-alpha/J),0,1); 40 | q = tinv(1-alpha/2/J,n1+n2-2); 41 | 42 | SignificantIndicator = (max(abs(stat))>q); 43 | 44 | end 45 | 46 | 47 | end -------------------------------------------------------------------------------- /DCD/home/yuting/Dropbox/Ubuntu_to_Windows/20150210_DCD/SignificantSingle2.m: -------------------------------------------------------------------------------- 1 | function [ SignificantIndicator] = SignificantSingle2( Y, candidateTime, alpha) 2 | % Input: 3 | % Y: data time-by-ROI 4 | % candidateTime: candidate split time point 5 | % alpha: significance level 6 | % Output: 7 | % SignificantIndicator: 0 - NO 1 - YES 8 | 9 | SignificantIndicator = 0; 10 | 11 | if isempty(candidateTime) 12 | return 13 | else 14 | Y1 = Y(1:candidateTime,:); 15 | Y2 = Y(candidateTime+1:end,:); 16 | 17 | x1 = fun1(Y1); 18 | x2 = fun1(Y2); 19 | 20 | m1 = mean(x1); 21 | m2 = mean(x2); 22 | 23 | n1 = size(x1,1); 24 | n2 = size(x2,1); 25 | 26 | J = size(x1,2); 27 | 28 | temp1 = x1-ones(n1,1)*m1; 29 | temp2 = sum(temp1.*temp1)/(n1-1); 30 | 31 | temp3 = x2-ones(n2,1)*m2; 32 | temp4 = sum(temp3.*temp3)/(n2-1); 33 | 34 | stat = (m1 - m2)./sqrt(temp2/n1 + temp4/n2); 35 | %q = norminv((1-alpha/J),0,1); 36 | q = tinv(1-alpha/2/J,n1+n2-2); 37 | 38 | SignificantIndicator = (max(abs(stat))>q); 39 | 40 | end 41 | 42 | 43 | end -------------------------------------------------------------------------------- /DCD/home/yuting/Dropbox/Ubuntu_to_Windows/20150210_DCD/Split1.m: -------------------------------------------------------------------------------- 1 | function [ timepoint, minBIC_1, minBIC_2] = Split1( Y, BIC, Delta, alpha, mask, Z ) 2 | % For recursively find one split point for input series 3 | % INPUT: 4 | % Y: timelength-by-ROIs matrix 5 | % current optimized penalty parameter lambda 6 | % current minimized BIC 7 | % Delta: minimum distance between splits 8 | % lambda_list: a list of candidate lambdas 9 | % OUTPUT 10 | % timepoint: candidate time point for splitting Y 11 | % into [1,timepoint] and [timepoint + 1, end] 12 | % If timepoint = -1, means no further splitting available 13 | 14 | 15 | T = size(Y,1); % time length 16 | %J = size(Y,2); % number of ROIs 17 | 18 | % auxiliary variables 19 | largest_decrease = 0; 20 | minBIC_t = 0; 21 | minBIC_1 = 0; 22 | minBIC_2 = 0; 23 | 24 | if T < 2*Delta 25 | timepoint = -1; 26 | else 27 | for t = Delta : T-Delta 28 | Y1 = Y(1:t,:); 29 | Y2 = Y(t+1:T,:); 30 | n1 = size(Y1,1); 31 | n2 = size(Y2,1); 32 | 33 | S1 = cov(Y1); 34 | S2 = cov(Y2); 35 | 36 | % 37 | S1new = S1.*Z; 38 | S2new = S2.*Z; 39 | 40 | b1 = n1* ( log(det(S1new)) + trace(S1new\S1) ); 41 | b2 = n2* ( log(det(S2new)) + trace(S2new\S2) ); 42 | 43 | % modified 44 | temp = BIC - (b1+b2); 45 | if temp > largest_decrease 46 | largest_decrease = temp; 47 | minBIC_t = t; 48 | minBIC_1 = b1; 49 | minBIC_2 = b2; 50 | end 51 | 52 | end 53 | 54 | 55 | if minBIC_t == 0 56 | timepoint = -1; 57 | else 58 | timepoint = minBIC_t; 59 | SignificantIndicator = SignificantSingle1( Y, timepoint, alpha, mask); 60 | if SignificantIndicator==0 61 | timepoint = -1; 62 | return 63 | end 64 | 65 | end 66 | end 67 | 68 | 69 | end 70 | 71 | -------------------------------------------------------------------------------- /DCD/home/yuting/Dropbox/Ubuntu_to_Windows/20150210_DCD/Split2.m: -------------------------------------------------------------------------------- 1 | function [ timepoint, minBIC_1, minBIC_2] = Split2( Y, BIC, Delta, alpha ) 2 | % For recursively find one split point for input series 3 | % INPUT: 4 | % Y: timelength-by-ROIs matrix 5 | % current optimized penalty parameter lambda 6 | % current minimized BIC 7 | % Delta: minimum distance between splits 8 | % lambda_list: a list of candidate lambdas 9 | % OUTPUT 10 | % timepoint: candidate time point for splitting Y 11 | % into [1,timepoint] and [timepoint + 1, end] 12 | % If timepoint = -1, means no further splitting available 13 | 14 | 15 | T = size(Y,1); % time length 16 | %J = size(Y,2); % number of ROIs 17 | 18 | % auxiliary variables 19 | largest_decrease = 0; 20 | minBIC_t = 0; 21 | minBIC_1 = 0; 22 | minBIC_2 = 0; 23 | 24 | if T < 2*Delta 25 | timepoint = -1; 26 | else 27 | for t = Delta : T-Delta 28 | Y1 = Y(1:t,:); 29 | Y2 = Y(t+1:T,:); 30 | n1 = size(Y1,1); 31 | n2 = size(Y2,1); 32 | 33 | S1 = cov(Y1); 34 | S2 = cov(Y2); 35 | 36 | b1 = n1*log(det(S1)); 37 | b2 = n2*log(det(S2)); 38 | 39 | % modified 40 | temp = BIC - (b1+b2); 41 | if temp > largest_decrease 42 | largest_decrease = temp; 43 | minBIC_t = t; 44 | minBIC_1 = b1; 45 | minBIC_2 = b2; 46 | end 47 | 48 | end 49 | 50 | 51 | if minBIC_t == 0 52 | timepoint = -1; 53 | else 54 | timepoint = minBIC_t; 55 | SignificantIndicator = SignificantSingle2( Y, timepoint, alpha); 56 | if SignificantIndicator==0 57 | timepoint = -1; 58 | return 59 | end 60 | 61 | end 62 | end 63 | 64 | 65 | end 66 | -------------------------------------------------------------------------------- /DCD/home/yuting/Dropbox/Ubuntu_to_Windows/20150210_DCD/SplitSearch1.m: -------------------------------------------------------------------------------- 1 | function [ timepointSSS_new ] = SplitSearch1( Y, BIC, Delta, alpha, eta, mask0) 2 | %UNTITLED Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | %%% NEW! mask imposed 6 | [mask,Z] = featureSelect(Y,eta,mask0); 7 | mask = logical(mask); 8 | if sum(mask~=mask0)>0 9 | %BIC = size(Y,1)* log(det(cov(Y).*Z)); 10 | S = cov(Y); 11 | Snew = cov(Y).*Z; 12 | BIC = size(Y,1)* (log(det(Snew)) + trace(Snew\S) ); 13 | end 14 | %%% 15 | 16 | [ timepoint, minBIC_1, minBIC_2] = Split1( Y, BIC, Delta, alpha, mask, Z ); 17 | 18 | if timepoint == -1 19 | timepointSSS_new = []; 20 | return 21 | else 22 | t1 = SplitSearch1( Y(1:timepoint,:), minBIC_1, Delta, alpha, eta, mask); 23 | t2 = SplitSearch1( Y((timepoint+1):end,:), minBIC_2, Delta, alpha, eta, mask); 24 | t2 = t2 + timepoint; 25 | timepointSSS_new = [t1 timepoint t2]; 26 | end 27 | 28 | end -------------------------------------------------------------------------------- /DCD/home/yuting/Dropbox/Ubuntu_to_Windows/20150210_DCD/SplitSearch2.m: -------------------------------------------------------------------------------- 1 | function [ timepointSSS_new ] = SplitSearch2( Y ,BIC, Delta, alpha) 2 | 3 | [ timepoint, minBIC_1, minBIC_2] = Split2( Y, BIC, Delta, alpha); 4 | 5 | if timepoint == -1 6 | timepointSSS_new = []; 7 | return 8 | else 9 | t1 = SplitSearch2( Y(1:timepoint,:), minBIC_1, Delta, alpha); 10 | t2 = SplitSearch2( Y((timepoint+1):end,:), minBIC_2, Delta, alpha); 11 | t2 = t2 + timepoint; 12 | timepointSSS_new = [t1 timepoint t2]; 13 | end 14 | 15 | 16 | end 17 | -------------------------------------------------------------------------------- /DCD/home/yuting/Dropbox/Ubuntu_to_Windows/20150210_DCD/featureSelect.m: -------------------------------------------------------------------------------- 1 | function [ index, Z ] = featureSelect( Y, eta, index0 ) 2 | %UNTITLED8 Summary of this function goes here 3 | % Detailed explanation goes here 4 | % Input: 5 | % Y - n-by-J 6 | % eta - false positive rate 7 | % Output 8 | % selections: select nonzero index from J ROIs 9 | n = size(Y,1); 10 | 11 | J = size(Y,2); 12 | 13 | x = fun1(Y); 14 | 15 | m = mean(x); 16 | 17 | s = std(x)/sqrt(size(x,1)); 18 | 19 | temp = m./s; 20 | 21 | %index = (abs(temp)>norminv(1-eta/2,0,1)); 22 | index = (abs(temp)>tinv(1-eta/2,n-1)); 23 | index = index.*index0; 24 | 25 | Z = zeros(J,J); 26 | count = J; 27 | for i = 1:J 28 | for j = i:J 29 | count = count + 1; 30 | Z(i,j) = index(count); 31 | Z(j,i) = Z(i,j); 32 | end 33 | end 34 | 35 | for i = 1:J 36 | Z(i,i)=1; 37 | index(j*(J+1-(j-1)/2)) = 1; 38 | end 39 | 40 | 41 | end 42 | 43 | -------------------------------------------------------------------------------- /DCD/home/yuting/Dropbox/Ubuntu_to_Windows/20150210_DCD/fun1.m: -------------------------------------------------------------------------------- 1 | function [ output ] = fun1( Y ) 2 | %UNTITLED5 Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | n = size(Y,1); 6 | J = size(Y,2); 7 | 8 | m = J + J*(J+1)/2; 9 | output = zeros(n,m); 10 | 11 | output(:,1:J) = Y; 12 | 13 | count = J; 14 | for i = 1:J 15 | for j = i:J 16 | count = count + 1; 17 | output(:,count) = Y(:,i).*Y(:,j); 18 | end 19 | end 20 | 21 | 22 | end 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lindquist_Dynamic_Correlation 2 | Martin Lindquist's dynamic correlation toolboxes. Designed for fMRI analysis, useful for other applications too. 3 | 4 | DCC : Dynamic conditional correlations, based on GARCH model 5 | 6 | DCR : Dynamic connectivity regression, finds change points in time and time segment-specific graphs 7 | 8 | DCR+ : Dynamic connectivity regression refactorization; substantially improved speed. --------------------------------------------------------------------------------