<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Not a direct fix, but if you are fitting that many models (I
      presume, in a simulation study?), you may want to consider using
      stochastic approximation instead of the default
      Geyer-Thompson-Hummel scheme.  (Use main.method="Stochastic" in
      the control() list.)  SA converges more readily in non-optimal
      cases, and fails more gracefully.  I've now started using that as
      a go-to for simulation studies, or other unsupervised settings
      where a small fraction of cases with very slow convergence can
      cause problems.  (Just be sure to turn off the bridge sampler if
      you don't need it, because its settings make it become very slow
      if you tune up your MCMC settings with SA (which you should).)  <br>
    </p>
    <p>Hope that helps!</p>
    <p>-Carter<br>
    </p>
    <div class="moz-cite-prefix">On 12/16/22 7:13 AM, James Moody wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:DM6PR05MB5564C6CAC1E2A94EF6BB2422A5E69@DM6PR05MB5564.namprd05.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@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;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        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;
        font-family:"Calibri",sans-serif;
        color:windowtext;}span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="font-size:11.0pt">Hey Folks –
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Hope you are
            well.  <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Is there a
            control parameter or similar that would change the behavior
            when the model detects an error?  I.e. I’m seeing this:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;color:red">Error
            in check.objfun.output(out, minimize, d) :
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;color:red">  objfun
            returned value that is NA or NaN<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;color:red">MLE
            could not be found. Trying Nelder-Mead...<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Then it goes
            on and iterates/searches for a (in my case) hopeless
            solution, which is *<b>very</b>* slow.   <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Is there any
            way to get it to just bump out when this (or similar)
            happens? Would like to set it up so if it detects anything
            like this, it just stops trying. 
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">If it were
            just one case, I would just interrupt it by hand … but this
            is embedded in a set of 100s of such models, so running
            unobserved, and when it hits one of these it slows the
            process down to a crawl…<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Thanks in
            advance,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Peaceful
            Thoughts,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Jim<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">James Moody<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Professor of
            Sociology<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Director,
            Duke Network Analysis Center<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
statnet_help mailing list
<a class="moz-txt-link-abbreviated" href="mailto:statnet_help@u.washington.edu">statnet_help@u.washington.edu</a>
<a class="moz-txt-link-freetext" href="https://urldefense.com/v3/__http://mailman13.u.washington.edu/mailman/listinfo/statnet_help__;!!CzAuKJ42GuquVTTmVmPViYEvSg!LXP3f4NLB_jyVjQCHg_Q1zgKAcSKpv5l-0jblx8QKgDuwNGlWrCWzt2x2Q6tieF4Jd_1y9Ln0YxeZ5oE$">https://urldefense.com/v3/__http://mailman13.u.washington.edu/mailman/listinfo/statnet_help__;!!CzAuKJ42GuquVTTmVmPViYEvSg!LXP3f4NLB_jyVjQCHg_Q1zgKAcSKpv5l-0jblx8QKgDuwNGlWrCWzt2x2Q6tieF4Jd_1y9Ln0YxeZ5oE$</a> 
</pre>
    </blockquote>
  </body>
</html>