function DCCfore=DCCforecast(data,dccP,dccQ,archP,garchQ);
[parameters, Ht, Qt]=dcc_mvgarch(data,dccP,dccQ,archP,garchQ);
[t,k]=size(data);
forecast1=parameters(1)+parameters(2)*data(t,k-1)*data(t,k-1)+parameters(3)*Ht(k-1,k-1,t);
forecast2=parameters(4)+parameters(5)*data(t,k)*data(t,k)+parameters(6)*Ht(k,k,t);
a=parameters(7);
b=parameters(8);
for i=1:t
Htt1(i)=Ht(1,1,i);
Htt2(i)=Ht(2,2,i);
end
Htt=[Htt1' Htt2'];
stdresid=data./sqrt(Htt);
Qbar=cov(stdresid);
forecastQ=Qbar*(1-a-b)+a*(stdresid(t,:))'*(stdresid(t,:))+b*Qt(:,:,t+1);
forecastR=forecastQ./(sqrt(diag(forecastQ))*sqrt(diag(forecastQ))');
forecast12=forecastR(1,2)*sqrt(forecast1)*sqrt(forecast2);
DCCfore=[forecast1 forecast12; forecast12 forecast2];