<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>End to end examples to extract data objects from results and resolve errors in eric zivot’s presentations on DCC correlations at <a href="https://faculty.washington.edu/ezivot/econ589/DCCgarchPowerpoint.pdf">https://faculty.washington.edu/ezivot/econ589/DCCgarchPowerpoint.pdf</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Rmgarch is just rugarch for more than one series at the same time making it richer in functionality. Also make sure input data does not have NAs using na.omit. Also instead of as.data.frame try  converting into xts objects as well. Easier with some rugarch extensions. (These two last methods take care of all errors in between) <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>There is a corresponding one on copulas later also by zivot for his uw advanced econ class<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Best regards<o:p></o:p></p><p class=MsoNormal>Amit<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b>From:</b> R-SIG-Finance <r-sig-finance-bounces@r-project.org> <b>On Behalf Of </b>Ilya Kipnis<br><b>Sent:</b> Thursday, November 29, 2018 8:53 AM<br><b>To:</b> r-sig-finance@r-project.org<br><b>Subject:</b> [R-SIG-Finance] Just finished Kris Boudt's course, running into errors from non-convergence in rugarch<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div><div><p class=MsoNormal>I just completed Kris Boudt's datacamp course on GARCH models, and thought I'd give it a spin in a more reasonable setting. I've run into an error that the course didn't cover. I'm using a rolling window of 504 trading days to try to fit a GJR-GARCH with AR1 return innovations and a skewed student t distribution and refitting the model every 22 days (so, basically every month) on SPY returns.  <br><br>In the course, it was possible to convert this output into a data frame, with an as.data.frame command.<br><br>Unfortunately, the course didn't cover what happened when over the course of ~300 model fits, there would be the occasional failure to converge, which throws the following error:<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal><img border=0 width=418 height=61 style='width:4.3541in;height:.6354in' id="_x0000_i1025" src="cid:image001.png@01D487C9.107227C0" alt=image.png><o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>Here's my MRE:<o:p></o:p></p><div><p class=MsoNormal>require(rugarch)<o:p></o:p></p></div><div><p class=MsoNormal>require(quantmod)<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal># get SPY data from Yahoo (also tried with Quandl, data isn't the issue)<o:p></o:p></p></div><div><p class=MsoNormal>getSymbols("SPY", from = '1990-01-01')<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>spyRets <- Return.calculate(Ad(SPY))<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal># GJR garch with AR1 innovations under a skewed student T distribution for returns<o:p></o:p></p></div><div><p class=MsoNormal>gjrSpec <- ugarchspec(mean.model = list(armaOrder = c(1,0)),<o:p></o:p></p></div><div><p class=MsoNormal>                      variance.model = list(model = "gjrGARCH"),<o:p></o:p></p></div><div><p class=MsoNormal>                      distribution.model = "sstd")<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal># Use rolling window of 504 days, refitting the model every 22 trading days<o:p></o:p></p></div><div><p class=MsoNormal>t1 <- Sys.time()<o:p></o:p></p></div><div><p class=MsoNormal>garchroll <- ugarchroll(gjrSpec, data = spyRets, <o:p></o:p></p></div><div><p class=MsoNormal>                        n.start = 504, refit.window = "moving",  refit.every = 22)<o:p></o:p></p></div><div><p class=MsoNormal>t2 <- Sys.time()<o:p></o:p></p></div><div><p class=MsoNormal>print(t2-t1)<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal># try to convert predictions to data frame, as in course -- error thrown regarding non-converged estimation windows<o:p></o:p></p></div><div><p class=MsoNormal>garchroll <- as.data.frame(garchroll)<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>With a screenshot for better readability:<o:p></o:p></p><div><p class=MsoNormal><img border=0 width=542 height=205 style='width:5.6458in;height:2.1354in' id="_x0000_i1026" src="cid:image002.png@01D487C9.107227C0" alt=image.png><br>I also tried the resume command from the following post <a href="https://stat.ethz.ch/pipermail/r-sig-finance/2013q2/011720.html">https://stat.ethz.ch/pipermail/r-sig-finance/2013q2/011720.html</a>, which did not solve my problem.  <br><br>I feel that this is a pretty straightforward application of the rugarch package, and that there is most likely a solution that simply wasn't covered in the course. I'd be greatly appreciative if someone could help me over this hill (albeit at the risk of revealing that I'm not exactly an expert on GARCH models).  <br><br>Thank you so much.<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Sincerely,<br><br>Ilya Kipnis (author of Quantstrat TradeR)<o:p></o:p></p></div></div></div></div></div></body></html>