naffe15 / BVAR_

Empirical macro toolbox
GNU General Public License v3.0
130 stars 76 forks source link

Error in checkrestrictions2 #11

Open auhernandez opened 2 years ago

auhernandez commented 2 years ago

When I run the examples in the toolbox I got the following errors:

Operands to the logical and (&&) and or (||) operators must be convertible to logical scalar values. Error in checkrestrictions2 (line 22) if count == size(restriction,2) || count1 == size(restriction,2) % if all signs are verified stop Error in iresponsesign (line 73) [d,fsign] = checkrestrictions2(signrestriction,y); Error in bvar (line 951) [irsign,Omega] = iresponse_sign(Phi(1 : ny*lags, 1 : ny),Sigma,hor,signs); Error in example_3irf (line 25) bvar1 = bvar(y,lags,options);

Any idea how to fix it?

naffe15 commented 2 years ago

not sure why this happens. Which version of matlab do you have?

Try to change the line 22 in checkrestrictions2 with the following
if (count == size(restriction,2)) || (count1 == size(restriction,2))

auhernandez commented 2 years ago

They just installed Matlab 2021. Version 2017 is still available but not for long should i use it?

naffe15 commented 2 years ago

I have version R2021a and I do not have any issue. Do you have the same version 2021a? Try with 2017 and let me know