You need to read the help file for -mgarch dcc postestimation-
. You will find the following example of computing the dynamic correlations and their forecasts.
webuse stocks
mgarch dcc (toyota nissan = , noconstant) (honda = , noconstant), ///
arch(1) garch(1)
tsappend, add(50)
predict H*, variance dynamic(2016)
tsline H_nissan_toyota H_honda_toyota H_honda_nissan if t>1600, ///
legend(rows(3)) xline(2015)
which produces the graph of the dynamic correlations between the three individual stocks.
Update 1
If you are only interested in the in-sample fits of the conditional correlations, then it becomes really simple, and you can drop the tsappend
command:
webuse stocks
mgarch dcc (toyota nissan = , noconstant) (honda = , noconstant), ///
arch(1) garch(1)
predict H*, variance
tsline H_nissan_toyota H_honda_toyota H_honda_nissan if t>1600, ///
legend(rows(3))
The option t>1600
asks that the in-sample predictions be plotted starting at "time period" 1600 (this dataset has a time index that runs from 1 to 2015). The xline
option asks for a vertical line at t=2015 (in the previous example, this was to indicate that at t=2015, forecasts were out-of-sample), and the legend(row(3))
specifies that you want the graph legend to placed in three separate rows -- this is just graph formatting.
Update 2
The OP has asked about adding explanatory variables in the equations for the conditional mean and the conditional variance. This is explained in the help file for mgarch dcc
. The syntax is
mgarch dcc eq [eq ... eq] [if] [in] [, options]
where each eq has the form
(depvarlist = [indepvars] [, eqoptions])
The optional argument [indepvars]
allows you to add explanatory variables to the conditional mean to any one, to sets of, or to all the dependent variables at the same time.
The optional equation options, eqoptions
, has the following optional component
het(varlist) include varlist in the specification of the conditional variance
which allows you to add explanatory variables to the conditional variance equation of any one, to sets of, or to all the dependent variables at the same time.
Example
So, for example, if you had three series return1
, return2
and return3
, and three independent variables x1
, x2
and x3
, then the command
mgarch dcc (return1 return2 = x1 x2, het(x1 x2 x3)) (return3 = x3, het(x1 x2 x3))
implies that the variables x1
and x2
enter the conditional mean of return1
and return2
, x3
enters the conditional mean of return3
. Similarly, x1
, x2
and x3
enter the conditional variance of return1
, return2
and return3
.