format long;
load CRSP_SENT_value_weighted_new.mat  % orthogonal sentiment index




%% the high-low sentiment month defined in Stambaugh_Yu_Yuan_JFE_12

aaa = sort(Xt, 'descend');
RegimeSYY=zeros(546,1);
for i=1:546
    if Xt(i)<aaa(273);
        RegimeSYY(i)=-9;
    else
        RegimeSYY(i)=3;
    end
end

save('Para_sentiment_Medium.mat','P12','P21','psi1','psi2','sigma_X','pi1','RegimeSYY','high_m');



