Thank you Alexios.
Before I got your reply, I checked ChatGPT. One of its solutions was the
one I tried and reported below its failure. But another was:

try(fit <- ugarchfit(GARCHspec, solver="hybrid", returns))
    if(inherits(fit, "try-error")){
      message("  --> fit failed (error). Skipping.")
      next
    }
And it works! Surprisingly, I never get the message "fit failed (error).
Skipping".
Instead, I have the system message
Error in robustvcv(fun = f, pars = ipars[estidx, 1], nlag = nlag, hess =
fit$hessian, : object 'B' not found

(which I guess points at switching to another solver)

or
Error : $ operator is invalid for atomic vectors

but then the process continued with other parameters.

Cheers, Alec


On Wed, Dec 17, 2025 at 7:28 PM Alexios Galanos <[email protected]> wrote:

> Hi Anatoly, try wrapping it in a ‘try/catch’ function. Additionally, I
> suggest you switch to tsgarch. rugarch is in minimal maintenance mode it’s
> the intention to slowly transition everyone to use the new package. With
> the exception of a few models/features, there is little missing from
> tsgarch and it is a more robust/modern GARCH package.
>
> Alexios
>
> > On Dec 18, 2025, at 07:17, Anatoly Schmidt <[email protected]> wrote:
> >
> > I'm wondering if there is an option to skip a non-convergent combo of
> garch
> > input parameters within the loop upon different parameter values.
> > I thought something like
> > if(convergence(ugarchfit(GARCHspec, solver="hybrid", returns)) != "0") {
> >      print("NA")
> >      next
> > }
> > It did not give an error for the runs with 'good' parameters. But in case
> > of a 'bad' parameter combo, I got the following:
> >
> > error in evaluating the argument 'object' in selecting a method for
> > function 'convergence': object 'B' not found
> >
> > Thanks much, Alec
> >
> > --
> > Anatoly Schmidt
> > Adjunct Professor, Finance and Risk Engineering, NYU Tandon School
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.linkedin.com_in_alec-2Dschmidt-2D9a761716_&d=DwIFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=CPekRlIiK6v83hOL1MBVGQ&m=z7JjOM861jrHuHRwto8z69jfs02lutlHGQzgMwPUXXJxJaNXKUmFwvLnTfS4HCRs&s=v3bFfvL5vv7OGPOY8aI2-gvB5C0EY9kSZMkdwgAAi9A&e=
> >
> >    [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > [email protected] mailing list
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dsig-2Dfinance&d=DwIFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=CPekRlIiK6v83hOL1MBVGQ&m=z7JjOM861jrHuHRwto8z69jfs02lutlHGQzgMwPUXXJxJaNXKUmFwvLnTfS4HCRs&s=3B4nRdRsIxyJWDtSQUmiyJyUmDBmG1wuoWPxNQqSMV0&e=
> > -- Subscriber-posting only. If you want to post, subscribe first.
> > -- Also note that this is not the r-help list where general R questions
> should go.
>

        [[alternative HTML version deleted]]

_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should 
go.

Reply via email to