<div dir="ltr"><div><img src="cid:ii_jp21t4cp0" alt="image.png" width="562" height="101"><br><br>Unfortunately, the gosolnp method does not work. <br><br>Tried implementing fit.control as best I understood it.  <br><br><div><img src="cid:ii_jp21w81y1" alt="image.png" width="562" height="101"><br><br>Also does not work.</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 28, 2018 at 10:33 PM alexios galanos <<a href="mailto:alexios@4dscape.com">alexios@4dscape.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Try setting the solver in the resume command to "gosolnp".<br>
It may also have helped to set fit.control(scale=1) in the ugarchroll, <br>
but you can set this in resume as well.<br>
<br>
Alexios<br>
<br>
On 11/28/18 7:22 PM, Ilya Kipnis wrote:<br>
> I just completed Kris Boudt's datacamp course on GARCH models, and <br>
> thought I'd give it a spin in a more reasonable setting. I've run into <br>
> an error that the course didn't cover. I'm using a rolling window of 504 <br>
> trading days to try to fit a GJR-GARCH with AR1 return innovations and a <br>
> skewed student t distribution and refitting the model every 22 days (so, <br>
> basically every month) on SPY returns.<br>
> <br>
> In the course, it was possible to convert this output into a data frame, <br>
> with an as.data.frame command.<br>
> <br>
> Unfortunately, the course didn't cover what happened when over the <br>
> course of ~300 model fits, there would be the occasional failure to <br>
> converge, which throws the following error:<br>
> <br>
> image.png<br>
> <br>
> Here's my MRE:<br>
> <br>
> require(rugarch)<br>
> require(quantmod)<br>
> <br>
> # get SPY data from Yahoo (also tried with Quandl, data isn't the issue)<br>
> getSymbols("SPY", from = '1990-01-01')<br>
> <br>
> spyRets <- Return.calculate(Ad(SPY))<br>
> <br>
> # GJR garch with AR1 innovations under a skewed student T distribution <br>
> for returns<br>
> gjrSpec <- ugarchspec(mean.model = list(armaOrder = c(1,0)),<br>
>                        variance.model = list(model = "gjrGARCH"),<br>
>                        distribution.model = "sstd")<br>
> <br>
> # Use rolling window of 504 days, refitting the model every 22 trading days<br>
> t1 <- Sys.time()<br>
> garchroll <- ugarchroll(gjrSpec, data = spyRets,<br>
>                          n.start = 504, refit.window = "moving",  <br>
> refit.every = 22)<br>
> t2 <- Sys.time()<br>
> print(t2-t1)<br>
> <br>
> # try to convert predictions to data frame, as in course -- error thrown <br>
> regarding non-converged estimation windows<br>
> garchroll <- as.data.frame(garchroll)<br>
> <br>
> With a screenshot for better readability:<br>
> <br>
> image.png<br>
> I also tried the resume command from the following post <br>
> <a href="https://stat.ethz.ch/pipermail/r-sig-finance/2013q2/011720.html" rel="noreferrer" target="_blank">https://stat.ethz.ch/pipermail/r-sig-finance/2013q2/011720.html</a>, which <br>
> did not solve my problem.<br>
> <br>
> I feel that this is a pretty straightforward application of the rugarch <br>
> package, and that there is most likely a solution that simply wasn't <br>
> covered in the course. I'd be greatly appreciative if someone could help <br>
> me over this hill (albeit at the risk of revealing that I'm not exactly <br>
> an expert on GARCH models).<br>
> <br>
> Thank you so much.<br>
> <br>
> Sincerely,<br>
> <br>
> Ilya Kipnis (author of Quantstrat TradeR)<br>
> <br>
> _______________________________________________<br>
> <a href="mailto:R-SIG-Finance@r-project.org" target="_blank">R-SIG-Finance@r-project.org</a> mailing list<br>
> <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" rel="noreferrer" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br>
> -- Subscriber-posting only. If you want to post, subscribe first.<br>
> -- Also note that this is not the r-help list where general R questions should go.<br>
><br>
<br>
_______________________________________________<br>
<a href="mailto:R-SIG-Finance@r-project.org" target="_blank">R-SIG-Finance@r-project.org</a> mailing list<br>
<a href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" rel="noreferrer" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br>
-- Subscriber-posting only. If you want to post, subscribe first.<br>
-- Also note that this is not the r-help list where general R questions should go.<br>
</blockquote></div>