[R] exiting mclapply early on error

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Tue Oct 13 18:43:11 CEST 2020


This may be O/T. If so, either reply privately or not at all.

"objective function diverges to infinity."

How do you operationally define that? Detecting Inf -- e.g. 1/0, log(0),
etc -- is straightforward. But how do you know other than via math whether
iterations will continue to diverge or not? Would you not need to
operationalize that by defining  divergence criteria? -- e.g. too many
iterations, objective function grows/shrinks too slowly, etc. In other
words, more or less the usual adapted to your particular context.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Oct 13, 2020 at 9:13 AM Giovanni Righi <grighi using uga.edu> wrote:

> Thanks for the response, Jeremie. I wholeheartedly agree about testing.
>
> In my case, this feature would be used purely to reduce computation time.
> I’m calculating
> an expensive (and embarrassingly parallel) likelihood function, and for
> some parameter combinations
> my objective function diverges to infinity. In those instances, I’d like
> to throw an error that stops
> subsequent computations and that I could catch to return a value of
> infinity. I agree, though,
> that the default should allow all processes to finish.
>
> What I’ve suggested does not seem possible with mclapply(). Do you know
> how I could suggest
> this as a feature request to the maintainer of the parallel package?
>
> Thanks,
> Giovanni
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list