Conversion to logical from struct is not possible.
Show older comments
Hi! I am currently working on a Markov Switching DCC-GARCH model using Matlab and got stuck. I believe someone has asked this question before but as I am very new to Matlab, I still can't figure out how to fix mine. Here's the code I use:
addpath('MS_Regress-Matlab-master');
addpath('m_Files');
addpath('data_Files');
[filename,pathname]=uigetfile('*.xlsx');
[data,textdata,raw] = xlsread(filename,1);
date=datenum(textdata(2:397,1),'dd/mm/yyyy');
s_start = '01/01/1989';
s_end = '01/12/2021';
date_find=datenum([s_start; s_end],'dd/mm/yyyy');
ss=datefind(date_find(1,1),date);
se=datefind(date_find(2,1),date);
cant=data(1:396,1:2);
R_eq=diff(log(cant));
dep=R_eq; % Defifines the dependent variables in system
nLag=3; % Number of vector autoregressive lags in 2x1 system (p)
k=2; % Number of states/regimes (K)
doIntercept=1; % Add intercept to equations (1= Yes; 0= No) (whether ? is MS)
advOpt.distrib='Normal';
advOpt.std_method = 1; % Defifining the method for calculation of standard errors.
advOpt.diagCovMat = 0; % Whether we will estimate by MLE also MS covariances (H feature)
advOpt.doPlots = 1; % Does not produce automatic plots (you are in charge of that!)
advOpt.printIter = 0; % When set to 0, does not print iterations to the screeen
[Spec_Out]=MS_VAR_Fit_tvtp(dep,nLag,k,doIntercept,advOpt);
Screenshot:

Here is the data: https://docs.google.com/spreadsheets/d/1WGPw54y6ctJYG1HQ6L97jlTpDPmeo6Gd/edit?usp=sharing&ouid=101920988099355662450&rtpof=true&sd=true
Does anyone know how to fix this?
Thank you!
Accepted Answer
More Answers (0)
Categories
Find more on Historical Contests in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!