DCC Graphs help required
DCC Graphs help required
Dear sir or madam,
I am using the following:
GARCH(P=1,Q=1,MV=DCC,RVECTORS=RR,HMATRICES=HH) * 2007:12:31 ADPRICE DDPRCE FDPRICE GDPRICE IDPRICE PDPRICE
I know that HH gives me the Covariance matrix which allows me to access the covariance to plot the graph.
for example:
SET cov_ad 1 1435 =hh(t)(1,2)
GRAPH(STYLE=LINE, HEADER="Covariance of US with Germany") 1
# cov_ad 1 1435
I was wondering if there is a similar option for the dynamic correlation. If not can i use the following example to calculate the dynamic correlations:
SET corr_ad 1 1435 = hh(t)(1,2)/SQRT(hh(t)(1,1)*hh(t)(2,2))
Or what do I have to do to get to the Dynamic correlations.
Many Thanks,
Bachar
I am using the following:
GARCH(P=1,Q=1,MV=DCC,RVECTORS=RR,HMATRICES=HH) * 2007:12:31 ADPRICE DDPRCE FDPRICE GDPRICE IDPRICE PDPRICE
I know that HH gives me the Covariance matrix which allows me to access the covariance to plot the graph.
for example:
SET cov_ad 1 1435 =hh(t)(1,2)
GRAPH(STYLE=LINE, HEADER="Covariance of US with Germany") 1
# cov_ad 1 1435
I was wondering if there is a similar option for the dynamic correlation. If not can i use the following example to calculate the dynamic correlations:
SET corr_ad 1 1435 = hh(t)(1,2)/SQRT(hh(t)(1,1)*hh(t)(2,2))
Or what do I have to do to get to the Dynamic correlations.
Many Thanks,
Bachar
Re: DCC Graphs help required
Yes. That would be the simplest way to get the conditional correlations. The covariance matrix at T is obtained by combining the dynamic correlation matrix with the variances. What that SET instruction is doing is backing out the step of multiplying through by the square roots of the variances.
Re: DCC Graphs help required
Dear Tom,
Many Thanks for your help
Let me just make sure that I understood the procedure correctly.
GARCH(P=1,Q=1,MV=DCC,RVECTORS=RR,HMATRICES=HH) * 2007:12:31 ADPRICE DDPRCE FDPRICE GDPRICE IDPRICE PDPRICE
SET corr_ad 1 1435 = hh(t)(1,2)/SQRT(hh(t)(1,1)*hh(t)(2,2))
GRAPH(STYLE=LINE, HEADER="Covariance of US with Germany") 1
# cov_ad 1 1435
Is that correct
Once again many thanks for your help.
Bachar
Many Thanks for your help
Let me just make sure that I understood the procedure correctly.
GARCH(P=1,Q=1,MV=DCC,RVECTORS=RR,HMATRICES=HH) * 2007:12:31 ADPRICE DDPRCE FDPRICE GDPRICE IDPRICE PDPRICE
SET corr_ad 1 1435 = hh(t)(1,2)/SQRT(hh(t)(1,1)*hh(t)(2,2))
GRAPH(STYLE=LINE, HEADER="Covariance of US with Germany") 1
# cov_ad 1 1435
Is that correct
Once again many thanks for your help.
Bachar
Re: DCC Graphs help required
You're computing the correlation, but graphing the covariance? (which it appears you haven't computed yet)
Re: DCC Graphs help required
doh,
Idiot!!
sorry about that error that'll teach me to double check.
I meant to type:
GARCH(P=1,Q=1,MV=DCC,RVECTORS=RR,HMATRICES=HH) * 2007:12:31 ADPRICE DDPRCE FDPRICE GDPRICE IDPRICE PDPRICE
SET corr_ad 1 1435 = hh(t)(1,2)/SQRT(hh(t)(1,1)*hh(t)(2,2))
GRAPH(STYLE=LINE, HEADER="Correlation of US with Germany") 1
# corr_ad 1 1435
Many Thanks,
Bachar
Idiot!!
sorry about that error that'll teach me to double check.
I meant to type:
GARCH(P=1,Q=1,MV=DCC,RVECTORS=RR,HMATRICES=HH) * 2007:12:31 ADPRICE DDPRCE FDPRICE GDPRICE IDPRICE PDPRICE
SET corr_ad 1 1435 = hh(t)(1,2)/SQRT(hh(t)(1,1)*hh(t)(2,2))
GRAPH(STYLE=LINE, HEADER="Correlation of US with Germany") 1
# corr_ad 1 1435
Many Thanks,
Bachar
Re: DCC Graphs help required
That should work (assuming the range is OK). A more flexible way to write that would bembfakhry wrote:doh,
Idiot!!![]()
sorry about that error that'll teach me to double check.
I meant to type:
GARCH(P=1,Q=1,MV=DCC,RVECTORS=RR,HMATRICES=HH) * 2007:12:31 ADPRICE DDPRCE FDPRICE GDPRICE IDPRICE PDPRICE
SET corr_ad 1 1435 = hh(t)(1,2)/SQRT(hh(t)(1,1)*hh(t)(2,2))
GRAPH(STYLE=LINE, HEADER="Correlation of US with Germany") 1
# corr_ad 1 1435
Many Thanks,
Bachar
set corr_ad %regstart() %regend() = %cvtocorr(hh(t))(1,2)
GRAPH(STYLE=LINE, HEADER="Correlation of US with Germany") 1
# corr_ad
That picks up the range of the GARCH instruction in %regstart() to %regend() so you don't have to figure it out yourself. And the %cvtocorr(...) is a bit simpler to read and modify for a different combination of countries.
Re: DCC Graphs help required
Dear Tom,
Thanks for the short cut but I keep getting the following error:
SET corr_ad %regstart() %regend() = %cvtocorr(hh(t)(1,2))
## SX22. Expected Type REAL, Got SYMMETRIC[REAL] Instead
>>>>tocorr(hh(t)(1,2))<<<<
Bachar
Thanks for the short cut but I keep getting the following error:
SET corr_ad %regstart() %regend() = %cvtocorr(hh(t)(1,2))
## SX22. Expected Type REAL, Got SYMMETRIC[REAL] Instead
>>>>tocorr(hh(t)(1,2))<<<<
Bachar
Re: DCC Graphs help required
You somehow got the parentheses wrong. Why don't you copy and paste out of my message instead of re-typing?
Re: DCC Graphs help required
Dear Tom,
DOH idiot
Once again sorry for dumbness
It helps if you're not tired!!
Many thanks for the short cut
Thanks,
Bachar
DOH idiot
Once again sorry for dumbness
It helps if you're not tired!!
Many thanks for the short cut
Thanks,
Bachar